aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2012-12-11 22:40:16 -0500
committerKevin O'Connor <kevin@koconnor.net>2012-12-11 22:40:16 -0500
commitc39a27297ab38ff5808e955d16fd1a6d9656e715 (patch)
tree94d9e6cb4f3b4d7ad9d0d49c583e45bf19d729cb /Makefile
parentfa2eacbb9affd0d6b56a28a71041f7e63505805c (diff)
downloadseabios-hppa-c39a27297ab38ff5808e955d16fd1a6d9656e715.zip
seabios-hppa-c39a27297ab38ff5808e955d16fd1a6d9656e715.tar.gz
seabios-hppa-c39a27297ab38ff5808e955d16fd1a6d9656e715.tar.bz2
Add compile checking phase to build.
The build textually includes all the code together in one unit for the compiler in order to use gcc's -fwhole-program option. Textually including all the code can mask subtle code errors (eg, forgetting to include the correct headers) and can lead to confusing error reports from the compiler. So, compile each file individually in addition to the normal textually inclusive build. This improves the error checking while still obtaining the benefits of -fwhole-program. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 8 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index b89a038..f28d86c 100644
--- a/Makefile
+++ b/Makefile
@@ -109,6 +109,10 @@ $(OUT)%.s: %.c
@echo " Compiling to assembler $@"
$(Q)$(CC) $(CFLAGS16) -S -c $< -o $@
+$(OUT)%.o: %.c $(OUT)autoconf.h
+ @echo " Compile checking $@"
+ $(Q)$(CC) $(CFLAGS32FLAT) -c $< -o $@
+
$(OUT)%.lds: %.lds.S
@echo " Precompiling $@"
$(Q)$(CPP) -P -D__ASSEMBLY__ $< -o $@
@@ -122,11 +126,11 @@ $(OUT)asm-offsets.h: $(OUT)asm-offsets.s
@echo " Generating offset file $@"
$(Q)./tools/gen-offsets.sh $< $@
-$(OUT)ccode16.o: $(OUT)autoconf.h ; $(call whole-compile, $(CFLAGS16), $(addprefix src/, $(SRC16)),$@)
+$(OUT)ccode16.o: $(OUT)autoconf.h $(patsubst %.c, out/%.o,$(SRC16)) ; $(call whole-compile, $(CFLAGS16), $(addprefix src/, $(SRC16)),$@)
-$(OUT)code32seg.o: $(OUT)autoconf.h ; $(call whole-compile, $(CFLAGS32SEG), $(addprefix src/, $(SRC32SEG)),$@)
+$(OUT)code32seg.o: $(OUT)autoconf.h $(patsubst %.c, out/%.o,$(SRC32SEG)) ; $(call whole-compile, $(CFLAGS32SEG), $(addprefix src/, $(SRC32SEG)),$@)
-$(OUT)ccode32flat.o: $(OUT)autoconf.h ; $(call whole-compile, $(CFLAGS32FLAT), $(addprefix src/, $(SRC32FLAT)),$@)
+$(OUT)ccode32flat.o: $(OUT)autoconf.h $(patsubst %.c, out/%.o,$(SRC32FLAT)) ; $(call whole-compile, $(CFLAGS32FLAT), $(addprefix src/, $(SRC32FLAT)),$@)
$(OUT)romlayout.o: romlayout.S $(OUT)asm-offsets.h
@echo " Compiling (16bit) $@"
@@ -216,7 +220,7 @@ $(OUT)%.hex: src/%.dsl ./tools/acpi_extract_preprocess.py ./tools/acpi_extract.p
$(Q)$(PYTHON) ./tools/acpi_extract.py $(OUT)$*.lst > $(OUT)$*.off
$(Q)cat $(OUT)$*.off > $@
-$(OUT)ccode32flat.o: $(OUT)acpi-dsdt.hex $(OUT)ssdt-proc.hex $(OUT)ssdt-pcihp.hex $(OUT)ssdt-susp.hex $(OUT)q35-acpi-dsdt.hex
+$(OUT)acpi.o: $(OUT)acpi-dsdt.hex $(OUT)ssdt-proc.hex $(OUT)ssdt-pcihp.hex $(OUT)ssdt-susp.hex $(OUT)q35-acpi-dsdt.hex
################ Kconfig rules