aboutsummaryrefslogtreecommitdiffstats
path: root/memdisk
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-04-27 21:42:45 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-04-27 21:42:45 -0700
commite6d94cc986897ac80a13a5eedd8ab38d581b0453 (patch)
treee6a9bab1f51a0eb4274e9dc77465f9cf3941e160 /memdisk
parent593236b4086e21f9552bb0281f6093b7cce875e9 (diff)
downloadsyslinux.git-e6d94cc986897ac80a13a5eedd8ab38d581b0453.tar.gz
syslinux.git-e6d94cc986897ac80a13a5eedd8ab38d581b0453.tar.xz
syslinux.git-e6d94cc986897ac80a13a5eedd8ab38d581b0453.zip
Unify dependency generation: MCONFIG.embedded
Unify dependency generation and move common rules into MCONFIG.embedded. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'memdisk')
-rw-r--r--memdisk/Makefile58
-rw-r--r--memdisk/memdisk.inc4
2 files changed, 12 insertions, 50 deletions
diff --git a/memdisk/Makefile b/memdisk/Makefile
index 7b557e11..201dffaf 100644
--- a/memdisk/Makefile
+++ b/memdisk/Makefile
@@ -15,10 +15,9 @@ topdir = ..
include $(topdir)/MCONFIG.embedded
-include $(topdir)/version.mk
-CFLAGS = $(GCCOPT) -g -W -Wall -Wno-sign-compare -DDATE='"$(DATE)"'
-SFLAGS = $(GCCOPT) -D__ASSEMBLY__
+INCLUDES = -I$(topdir)/com32/include
+CFLAGS += -DDATE='"$(DATE)"'
LDFLAGS = $(GCCOPT) -g
-INCLUDE = -I$(topdir)/com32/include
NASM = nasm
NASMOPT = -O9999
NFLAGS = -dDATE='"$(DATE)"'
@@ -49,7 +48,7 @@ all: memdisk # e820test
# tidy, clean removes everything except the final binary
tidy dist:
- rm -f *.o *.s *.tmp *.o16 *.s16 *.bin *.lst *.elf e820test
+ rm -f *.o *.s *.tmp *.o16 *.s16 *.bin *.lst *.elf e820test .*.d
clean: tidy
@@ -58,39 +57,17 @@ spotless: clean
rm -f memdisk .depend
memdisk16.o: memdisk16.asm
- $(NASM) $(NASMOPT) $(NFLAGS) $(NINCLUDE) -f elf -l $*.lst -o $@ $<
-%.o: %.s
- $(CC) $(SFLAGS) -c -o $@ $<
+# Cancel rule
+%.o: %.asm
-%.o: %.S
- $(CC) $(INCLUDE) $(SFLAGS) -c -o $@ $<
-
-%.o16: %.s16
- $(CC) $(SFLAGS) -x assembler -c -o $@ $<
-
-%.o: %.c
- $(CC) $(INCLUDE) $(CFLAGS) -c -o $@ $<
-
-%.s16: %.s
- echo '.code16gcc' | cat - $< > $@
-
-%.s: %.S
- $(CC) $(INCLUDE) $(SFLAGS) -E -o $@ $<
-
-%.s16: %.S16
- $(CC) $(INCLUDE) $(SFLAGS) -x assembler-with-cpp -E -o $@ $<
-
-%.s: %.c
- $(CC) $(INCLUDE) $(CFLAGS) -S -o $@ $<
-
-%.i: %.c
- $(CC) $(INCLUDE) $(CFLAGS) -E -o $@ $<
-
-# Cancel default rule
-%.o: %.c
+memdisk16.o: memdisk16.asm
+ ( $(NASM) -DDEPEND $(NFLAGS) $(NINCLUDE) -o $@ $< ; echo '' ) >> .$@.d ; true
+ $(NASM) -f elf $(NASMOPT) $(NFLAGS) $(NINCLUDE) -o $@ -l $*.lst $<
+.PRECIOUS: %.bin
%.bin: %.asm
+ ( $(NASM) -DDEPEND $(NFLAGS) $(NINCLUDE) -o $@ $< ; echo '' ) >> .$@.d ; true
$(NASM) -f bin $(NASMOPT) $(NFLAGS) $(NINCLUDE) -o $@ -l $*.lst $<
memdisk_%.o: memdisk_%.bin
@@ -111,21 +88,8 @@ memdisk: memdisk16.bin memdisk32.bin postprocess.pl
e820test: e820test.c e820func.c msetup.c
$(CC) -m32 -g -W -Wall -DTEST -o $@ $^
-.depend:
- rm -f .depend
- for csrc in *.c ; do $(CC) $(INCLUDE) $(CFLAGS) -MM $$csrc >> .depend ; done ; true
- for ssrc in *.S ; do $(CC) $(INCLUDE) $(SFLAGS) -MM $$ssrc >> .depend ; done ; true
- for nsrc in $(NASMSRC) ; do \
- ( $(NASM) -DDEPEND $(NINCLUDE) -o \
- `echo $$nsrc | sed -e 's/\.asm/\.bin/'` -M $$nsrc ; \
- echo '' ) >> .depend ; done ; true
-
-depend:
- rm -f .depend
- $(MAKE) .depend
-
# This file contains the version number, so add a dependency for it
setup.s: ../version
# Include dependencies file
--include .depend
+-include .*.d
diff --git a/memdisk/memdisk.inc b/memdisk/memdisk.inc
index 27e9fdb1..fa4fe3e5 100644
--- a/memdisk/memdisk.inc
+++ b/memdisk/memdisk.inc
@@ -17,9 +17,7 @@
;
; ****************************************************************************
-%ifndef DEPEND
-%include "../version.gen"
-%endif
+%include "../version.gen"
; %define DEBUG_TRACERS ; Uncomment to get debugging tracers