On Fri, May 28, 2010 at 07:01:35PM +0900, Isaku Yamahata wrote:
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.
[...]
####### 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
This doesn't look right - gcc should be emitting file dependencies on its own. How about:
--- a/Makefile +++ b/Makefile @@ -187,8 +187,10 @@ $(OUT)vgabios.bin: $(OUT)vgabios.bin.raw tools/buildrom.py src/acpi-dsdt.hex: src/acpi-dsdt.dsl @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 $(OUT)acpi-dsdt $(OUT)acpi-dsdt.dsl.i + $(Q)cp $(OUT)acpi-dsdt.hex $@ + +$(OUT)ccode32flat.o: src/acpi-dsdt.hex
####### Generic rules clean:
-Kevin