Merge branch 'master' into lua
[profile/ivi/syslinux.git] / 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 include $(topdir)/MCONFIG.embedded
20
21 all:    mbr.bin   altmbr.bin   gptmbr.bin   isohdpfx.bin   isohdppx.bin \
22         mbr_c.bin altmbr_c.bin gptmbr_c.bin isohdpfx_c.bin isohdppx_c.bin \
23         mbr_f.bin altmbr_f.bin gptmbr_f.bin isohdpfx_f.bin isohdppx_f.bin
24
25 %.o: %.S
26         $(CC) $(MAKEDEPS) $(SFLAGS) -Wa,-a=$*.lst -c -o $@ $<
27
28 %_c.o: %.S
29         $(CC) $(MAKEDEPS) $(SFLAGS) -Wa,-a=$*_c.lst -DCTRL_80 -c -o $@ $<
30
31 %_f.o: %.S
32         $(CC) $(MAKEDEPS) $(SFLAGS) -Wa,-a=$*_f.lst -DFORCE_80 -c -o $@ $<
33
34 .PRECIOUS: %.elf
35 %.elf: %.o mbr.ld
36         $(LD) $(LDFLAGS) -T mbr.ld -e _start -o $@ $<
37
38 %.bin: %.elf checksize.pl
39         $(OBJCOPY) -O binary $< $@
40         $(PERL) checksize.pl $@
41         $(CHMOD) -x $@
42
43 mbr_bin.c: mbr.bin
44
45 tidy dist:
46         rm -f *.o *.elf *.lst .*.d
47
48 clean: tidy
49
50 spotless: clean
51         rm -f *.bin
52
53 -include .*.d