Commit 6ee5283f authored by Nico Huber's avatar Nico Huber Committed by Matt Devillier

Hook up Kconfig Ada spec file

We generate a $(obj)/ once and copy it per stage that uses
it to $(obj)/<stage>/ (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: 's avatarNico Huber <>
parent e44c28a0
......@@ -185,6 +185,9 @@ $(KCONFIG_AUTOHEADER): $(KCONFIG_CONFIG) $(objutil)/kconfig/conf
$(obj)/%/$(notdir $(KCONFIG_AUTOADS)): $(KCONFIG_AUTOADS)
cp $< $@
# Add a new class of source/object files to the build system
add-class= \
$(eval $(1)-srcs:=) \
......@@ -269,6 +272,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
ramstage-srcs += $(obj)/ramstage/$(notdir $(KCONFIG_AUTOADS))
# 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
......@@ -317,7 +325,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)) \
......@@ -210,7 +210,9 @@ verstage-c-deps:=$$(OPTION_TABLE_H)
$(foreach type,ads adb, \
$(foreach stage,$(COREBOOT_STANDARD_STAGES), \
$(eval $(stage)-$(type)-deps := $(obj)/libgnat-$(ARCH-$(stage)-y)/libgnat.a)))
$(eval $(stage)-$(type)-deps := \
$(obj)/$(stage)/$(notdir $(KCONFIG_AUTOADS)) \
# Add handler to copy linker scripts
define generic-objs_ld_template_gen
......@@ -299,6 +299,8 @@ $(objcbfs)/%.debug.rmod: $(objcbfs)/%.debug | $(RMODTOOL)
$(obj)/%.elf.rmod: $(obj)/%.elf | $(RMODTOOL)
$(RMODTOOL) -i $< -o $@
ramstage-$(CONFIG_RAMSTAGE_ADA) +=
to-ada-hex = $(eval $(1) := 16\\\#$(patsubst 0x%,%,$($(1)))\\\#)
package CB is
end CB;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment