summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile10
-rw-r--r--Makefile.inc4
-rw-r--r--src/lib/Makefile.inc2
-rw-r--r--src/lib/cb.ads2
4 files changed, 16 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 13b73ff107..45b0bc5f8c 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)) \
diff --git a/Makefile.inc b/Makefile.inc
index 594ef36ad7..7d6bc7ce47 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -215,7 +215,9 @@ verstage-c-deps:=$$(OPTION_TABLE_H)
bootblock-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)) \
+ $(obj)/libgnat-$(ARCH-$(stage)-y)/libgnat.a)))
# Add handler to copy linker scripts
define generic-objs_ld_template_gen
diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc
index 68431f9ce5..fa1ff8bccd 100644
--- a/src/lib/Makefile.inc
+++ b/src/lib/Makefile.inc
@@ -296,6 +296,8 @@ $(objcbfs)/%.debug.rmod: $(objcbfs)/%.debug | $(RMODTOOL)
$(obj)/%.elf.rmod: $(obj)/%.elf | $(RMODTOOL)
$(RMODTOOL) -i $< -o $@
+ramstage-$(CONFIG_RAMSTAGE_ADA) += cb.ads
+
ifeq ($(CONFIG_RAMSTAGE_LIBHWBASE),y)
to-ada-hex = $(eval $(1) := 16\\\#$(patsubst 0x%,%,$($(1)))\\\#)
diff --git a/src/lib/cb.ads b/src/lib/cb.ads
new file mode 100644
index 0000000000..41a2a427de
--- /dev/null
+++ b/src/lib/cb.ads
@@ -0,0 +1,2 @@
+package CB is
+end CB;