[SeaBIOS] [PATCH] seabios: remove iasl output file when error.

Isaku Yamahata yamahata at valinux.co.jp
Fri May 28 12:01:35 CEST 2010


Surprisingly iasl creates output file even when compilation error.
So typing make after an error will succeed.
This patch prevents it by removing the output file when error.
And adds related dependencies to compile when .hex is missing.

Signed-off-by: Isaku Yamahata <yamahata at valinux.co.jp>
---
 Makefile |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 72d711d..d69c630 100644
--- a/Makefile
+++ b/Makefile
@@ -184,11 +184,16 @@ $(OUT)vgabios.bin: $(OUT)vgabios.bin.raw tools/buildrom.py
 	$(Q)./tools/buildrom.py $< $@
 
 ####### dsdt build rules
-src/acpi-dsdt.hex: src/acpi-dsdt.dsl
+$(OUT)%.dsl.i: src/%.dsl
+	$(Q)cpp -P $< > $@
+
+src/%.hex: $(OUT)%.dsl.i
 	@echo "Compiling DSDT"
-	$(Q)cpp -P $< > $(OUT)acpi-dsdt.dsl.i
-	$(Q)iasl -tc -p $@ $(OUT)acpi-dsdt.dsl.i
-	$(Q)rm $(OUT)acpi-dsdt.dsl.i
+	$(Q)iasl -tc -p $@ $< || (e=$$?; rm $@; exit $$e)
+
+src/acpi.c: src/acpi-dsdt.hex
+$(OUT)ccode32flat.o: src/acpi.c
+$(OUT)../src/acpi-dsdt.hex: src/acpi-dsdt.hex
 
 ####### Generic rules
 clean:
-- 
1.6.6.1




More information about the SeaBIOS mailing list