build system: extend src-to-obj for non-.c/.S files
It also creates file names in the build directory and with the stage sliced in, but keeps the extension for anything not .c or .S. Also some handling for non-.c/.S files was adapted to match. This is inspired by the commit listed below, but rewritten to match upstream, and split in smaller pieces to keep intent clear. Change-Id: If8f89a7daffcf51f430b64c3293d2a817ae5120f Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Based-On-Change-Id: I50af7dacf616e0f8ff4c43f4acc679089ad7022b Based-On-Signed-off-by: Julius Werner <jwerner@chromium.org> Based-On-Reviewed-on: https://chromium-review.googlesource.com/219170 Reviewed-on: http://review.coreboot.org/9175 Reviewed-by: Aaron Durbin <adurbin@google.com> Tested-by: build bot (Jenkins)
This commit is contained in:
committed by
Patrick Georgi
parent
5c9f534269
commit
db273065f6
@@ -142,10 +142,10 @@ bootblock-c-deps:=$$(OPTION_TABLE_H)
|
||||
#######################################################################
|
||||
# Add handler to compile ACPI's ASL
|
||||
define ramstage-objs_asl_template
|
||||
$(obj)/$(1).ramstage.o: src/$(1).asl $(obj)/config.h
|
||||
$(obj)/$(1).ramstage.asl: src/$(1).asl $(obj)/config.h
|
||||
@printf " IASL $$(subst $(top)/,,$$(@))\n"
|
||||
$(CC_ramstage) -x assembler-with-cpp -E -MMD -MT $$(@) -D__ACPI__ -P -include $(src)/include/kconfig.h -I$(obj) -I$(src) -I$(src)/include -I$(src)/arch/$(ARCHDIR-$(ARCH-ramstage-y))/include -I$(src)/mainboard/$(MAINBOARDDIR) $$< -o $$(basename $$@).asl
|
||||
cd $$(dir $$@); $(IASL) -p $$(notdir $$@) -tc $$(notdir $$(basename $$@)).asl
|
||||
$(CC_ramstage) -x assembler-with-cpp -E -MMD -MT $$(@) -D__ACPI__ -P -include $(src)/include/kconfig.h -I$(obj) -I$(src) -I$(src)/include -I$(src)/arch/$(ARCHDIR-$(ARCH-ramstage-y))/include -I$(src)/mainboard/$(MAINBOARDDIR) $$< -o $$@
|
||||
cd $$(dir $$@); $(IASL) -p $$(notdir $$@) -tc $$(notdir $$@)
|
||||
mv $$(basename $$@).hex $$(basename $$@).c
|
||||
$(CC_ramstage) $$(CFLAGS_ramstage) $$(CPPFLAGS_ramstage) $$(if $$(subst dsdt,,$$(basename $$(notdir $(1)))), -DAmlCode=AmlCode_$$(basename $$(notdir $(1)))) -c -o $$@ $$(basename $$@).c
|
||||
# keep %.o: %.c rule from catching the temporary .c file after a make clean
|
||||
|
Reference in New Issue
Block a user