summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2019-01-01 22:06:01 +0100
committerPatrick Georgi <pgeorgi@google.com>2019-02-06 16:20:35 +0000
commitb56797707541a596427d59558f5a147415ea844f (patch)
tree9877667459c5a8d311e30c720efa1e5f58a8c421 /Makefile
parent0226789dcca9e92591daf61aa288bbf01ceabdeb (diff)
downloadcoreboot-b56797707541a596427d59558f5a147415ea844f.tar.gz
coreboot-b56797707541a596427d59558f5a147415ea844f.tar.bz2
coreboot-b56797707541a596427d59558f5a147415ea844f.zip
Hook up Kconfig Ada spec file
We generate a $(obj)/cb-config.ads once and copy it per stage that uses it to $(obj)/<stage>/cb-config.ads (to simplify the gnat-bind step). The Ada package is called `CB.Config`. As there was no `CB` package yet, add that too. Change-Id: I963a6517ef4bcf84f2c8e9ae8d24a0d6b971d2b0 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/30584 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 9 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 13b73ff10788..45b0bc5f8c2f 100644
--- a/Makefile
+++ b/Makefile
@@ -188,6 +188,9 @@ $(KCONFIG_AUTOCONFIG): $(KCONFIG_AUTOHEADER)
$(KCONFIG_AUTOADS): $(KCONFIG_AUTOCONFIG) $(objutil)/kconfig/toada
$(objutil)/kconfig/toada CB.Config <$< >$@
+$(obj)/%/$(notdir $(KCONFIG_AUTOADS)): $(KCONFIG_AUTOADS)
+ cp $< $@
+
# Add a new class of source/object files to the build system
add-class= \
$(eval $(1)-srcs:=) \
@@ -272,6 +275,11 @@ $(eval $(postinclude-hooks))
# Eliminate duplicate mentions of source files in a class
$(foreach class,$(classes),$(eval $(class)-srcs:=$(sort $($(class)-srcs))))
+# Build Kconfig .ads if necessary
+ifeq ($(CONFIG_RAMSTAGE_ADA),y)
+ramstage-srcs += $(obj)/ramstage/$(notdir $(KCONFIG_AUTOADS))
+endif
+
# To track dependencies, we need all Ada specification (.ads) files in
# *-srcs. Extract / filter all specification files that have a matching
# body (.adb) file here (specifications without a body are valid sources
@@ -320,7 +328,7 @@ define create_cc_template
ifn$(EMPTY)def $(1)-objs_$(2)_template
de$(EMPTY)fine $(1)-objs_$(2)_template
ifn$(EMPTY)eq ($(filter ads adb,$(2)),)
-$$(call src-to-obj,$1,$$(1).$2): $$(1).$2 $$(call create_ada_deps,$1,$$(call src-to-ali,$1,$$(1).$2)) $(KCONFIG_AUTOHEADER) $(4)
+$$(call src-to-obj,$1,$$(1).$2): $$(1).$2 $$(call create_ada_deps,$1,$$(call src-to-ali,$1,$$(1).$2)) $(4)
@printf " GCC $$$$(subst $$$$(obj)/,,$$$$(@))\n"
$(GCC_$(1)) \
$$$$(ADAFLAGS_$(1)) $$$$(addprefix -I,$$$$($(1)-ada-dirs)) \