path: root/mbr/Makefile
diff options
authorH. Peter Anvin <hpa@zytor.com>2008-05-29 15:11:38 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-05-29 15:11:38 -0700
commitb536209dfb7bd50c37061735fe10d2c19a97d26d (patch)
tree9d8ca6882fc5d9721fb0efea1abfd6dc09886814 /mbr/Makefile
parent3ec40a0119587f63411475c76c69f9db24c7598e (diff)
Move files out of root into core, dos, and utils
Move source files out of the root directory; the root is a mess and has become virtually unmaintainable. The Syslinux core now lives in core/; the Linux and generic utilities has moved into utils/, and copybs.com has moved into dos/; it had to go somewhere, and it seemed as good a place as any.
Diffstat (limited to 'mbr/Makefile')
1 files changed, 11 insertions, 5 deletions
diff --git a/mbr/Makefile b/mbr/Makefile
index 76a47e05..7aa56eae 100644
--- a/mbr/Makefile
+++ b/mbr/Makefile
@@ -22,34 +22,40 @@ gcc_ok = $(shell tmpf=$(TMPFILE); if $(CC) $(1) -c -x c /dev/null -o $$tmpf 2>
M32 := $(call gcc_ok,-m32,) $(call gcc_ok,-ffreestanding,) $(call gcc_ok,-fno-stack-protector)
CC = gcc
-LD = ld -m elf_i386
+LD = ld
+LDFLAGS = -m elf_i386
SFLAGS = $(M32) -march=i386
OBJCOPY = objcopy
PERL = perl
.SUFFIXES: .S .s .o .elf
-all: mbr.bin gptmbr.bin
+all: mbr.bin mbr_bin.c gptmbr.bin gptmbr_bin.c
%.o: %.S
$(CC) $(SFLAGS) -Wa,-a=$*.lst -c -o $@ $<
+%_bin.c: %.bin ../bin2c.pl
+ $(PERL) ../bin2c.pl syslinux_$* < $< > $@
mbr.elf: mbr.o mbr.ld
- $(LD) -T mbr.ld -e _start -o $@ $<
+ $(LD) $(LDFLAGS) -T mbr.ld -e _start -o $@ $<
mbr.bin: mbr.elf checksize.pl
$(OBJCOPY) -O binary $< $@
$(PERL) checksize.pl mbr.bin 440
+mbr_bin.c: mbr.bin
gptmbr.elf: gptmbr.o mbr.ld
- $(LD) -T mbr.ld -e _start -o $@ $<
+ $(LD) $(LDFLAGS) -T mbr.ld -e _start -o $@ $<
gptmbr.bin: gptmbr.elf checksize.pl
$(OBJCOPY) -O binary $< $@
$(PERL) checksize.pl gptmbr.bin 424
+tidy dist:
rm -f *.o *.elf *.lst
clean: tidy