pxechn.c32: PXE NBP chainloader
[profile/ivi/syslinux.git] / diag / mbr / Makefile
1 ## -----------------------------------------------------------------------
2 ##
3 ##   Copyright 2007-2009 H. Peter Anvin - All Rights Reserved
4 ##   Copyright 2009 Intel Corporation; author: H. Peter Anvin
5 ##
6 ##   This program is free software; you can redistribute it and/or modify
7 ##   it under the terms of the GNU General Public License as published by
8 ##   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
9 ##   Boston MA 02111-1307, USA; either version 2 of the License, or
10 ##   (at your option) any later version; incorporated herein by reference.
11 ##
12 ## -----------------------------------------------------------------------
13
14 #
15 # Makefile for MBR
16 #
17
18 topdir = ../..
19 mbrdir = $(topdir)/mbr
20 MAKEDIR = $(topdir)/mk
21 include $(MAKEDIR)/embedded.mk
22
23 all:    handoff.bin
24
25 %.o: %.S
26         $(CC) $(MAKEDEPS) $(SFLAGS) -Wa,-a=$*.lst -c -o $@ $<
27
28 .PRECIOUS: %.elf
29 %.elf: %.o $(mbrdir)/mbr.ld
30         $(LD) $(LDFLAGS) -T $(mbrdir)/mbr.ld -e _start -o $@ $<
31
32 %.bin: %.elf $(mbrdir)/checksize.pl
33         $(OBJCOPY) -O binary $< $@
34         $(PERL) checksize.pl $@
35         $(CHMOD) -x $@
36
37 handoff.bin: handoff.elf $(mbrdir)/checksize.pl
38         $(OBJCOPY) -O binary $< $@
39         $(PERL) $(mbrdir)/checksize.pl $@ 420
40         $(CHMOD) -x $@
41
42 mbr_bin.c: mbr.bin
43
44 tidy dist:
45         rm -f *.o *.elf *.lst .*.d
46
47 clean: tidy
48
49 spotless: clean
50         rm -f *.bin
51
52 -include .*.d