From af97d33ec426b9414133fd82d958cf9ab52a390f Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Mon, 8 Feb 2010 15:46:37 +0000 Subject: Clean up ACPI: - unify all iasl related rules into the toplevel Makefile - build a filesystem standard for ACPI files and use it - pass ACPI sources through cpp, so constants can be shared between C and ACPI more easily - use cpp's #include instead of ACPI's Include() so cpp gets the whole picture Signed-off-by: Patrick Georgi Acked-by: Stefan Reinauer git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5094 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- Makefile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index e526ba9079..461ee13b0b 100644 --- a/Makefile +++ b/Makefile @@ -138,12 +138,13 @@ subdirs:=$(PLATFORM-y) $(BUILD-y) $(eval $(call evaluate_subdirs)) -define c_dsl_template -$(obj)/$(1)%.c: src/$(1)%.dsl $(obj)/build.h +define objs_dsl_template +$(obj)/$(1)%.o: src/$(1)%.asl @printf " IASL $$(subst $$(shell pwd)/,,$$(@))\n" - iasl -p $$(basename $$@) -tc $$< - perl -pi -e 's/AmlCode/AmlCode_$$(notdir $$(basename $$@))/g' $$(basename $$@).hex - mv $$(basename $$@).hex $$@ + $(CPP) -D__ACPI__ -P $(CPPFLAGS) -include $(obj)/config.h -I$(src) -I$(src)/mainboard/$(MAINBOARDDIR) $$< -o $$(basename $$@).asl + iasl -p $$(basename $$@) -tc $$(basename $$@).asl + mv $$(basename $$@).hex $$(basename $$@).c + $(CC) -m32 $$(CFLAGS) $$(if $$(subst dsdt,,$$(basename $$(notdir $$@))), -DAmlCode=AmlCode_$$(basename $$(notdir $$@))) -c -o $$@ $$(basename $$@).c endef define objs_c_template @@ -196,7 +197,7 @@ endef usetemplate=$(foreach d,$(sort $(dir $($(1)))),$(eval $(call $(1)_$(2)_template,$(subst $(obj)/,,$(d))))) usetemplate=$(foreach d,$(sort $(dir $($(1)))),$(eval $(call $(1)_$(2)_template,$(subst $(obj)/,,$(d))))) -$(eval $(call usetemplate,c,dsl)) +$(eval $(call usetemplate,objs,dsl)) $(eval $(call usetemplate,objs,c)) $(eval $(call usetemplate,objs,S)) $(eval $(call usetemplate,initobjs,c)) -- cgit v1.2.3