Nico Huber has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30584
Change subject: Hook up Kconfig Ada spec file ......................................................................
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 --- M Makefile M Makefile.inc M src/lib/Makefile.inc A src/lib/cb.ads 4 files changed, 22 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/84/30584/1
diff --git a/Makefile b/Makefile index f12b616..3acb97d 100644 --- a/Makefile +++ b/Makefile @@ -44,6 +44,7 @@
DOTCONFIG ?= $(top)/.config KCONFIG_CONFIG = $(DOTCONFIG) +KCONFIG_AUTOADS := $(obj)/cb-config.ads KCONFIG_AUTOHEADER := $(obj)/config.h KCONFIG_AUTOCONFIG := $(obj)/auto.conf KCONFIG_DEPENDENCIES := $(obj)/auto.conf.cmd @@ -51,10 +52,12 @@ KCONFIG_TRISTATE := $(obj)/tristate.conf KCONFIG_NEGATIVES := 1 KCONFIG_STRICT := 1 +KCONFIG_PACKAGE := CB.Config
COREBOOT_EXPORTS += KCONFIG_CONFIG KCONFIG_AUTOHEADER KCONFIG_AUTOCONFIG COREBOOT_EXPORTS += KCONFIG_DEPENDENCIES KCONFIG_SPLITCONFIG KCONFIG_TRISTATE COREBOOT_EXPORTS += KCONFIG_NEGATIVES KCONFIG_STRICT +COREBOOT_EXPORTS += KCONFIG_AUTOADS KCONFIG_PACKAGE
# directory containing the toplevel Makefile.inc TOPLEVEL := . @@ -179,6 +182,12 @@ $(KCONFIG_AUTOHEADER): $(KCONFIG_CONFIG) $(objutil)/kconfig/conf +$(MAKE) oldconfig
+$(KCONFIG_AUTOADS): $(KCONFIG_AUTOHEADER) + true + +$(obj)/%/$(notdir $(KCONFIG_AUTOADS)): $(KCONFIG_AUTOADS) + cp $< $@ + # Add a new class of source/object files to the build system add-class= \ $(eval $(1)-srcs:=) \ @@ -263,6 +272,11 @@ # 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 @@ -311,7 +325,7 @@ 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 b25ac6b..4292e79 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -210,7 +210,9 @@ 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 2fd4e4c..1bfe9cd 100644 --- a/src/lib/Makefile.inc +++ b/src/lib/Makefile.inc @@ -295,6 +295,8 @@ $(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 0000000..41a2a42 --- /dev/null +++ b/src/lib/cb.ads @@ -0,0 +1,2 @@ +package CB is +end CB;
Matt DeVillier has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30584 )
Change subject: Hook up Kconfig Ada spec file ......................................................................
Patch Set 2:
seems sane. tested with 30583/30585 on google/link
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30584 )
Change subject: Hook up Kconfig Ada spec file ......................................................................
Patch Set 2: Code-Review+2
Hello Arthur Heymans, Matt DeVillier, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30584
to look at the new patch set (#3).
Change subject: Hook up Kconfig Ada spec file ......................................................................
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 --- M Makefile M Makefile.inc M src/lib/Makefile.inc A src/lib/cb.ads 4 files changed, 16 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/84/30584/3
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30584 )
Change subject: Hook up Kconfig Ada spec file ......................................................................
Patch Set 3:
Patch Set 2: Code-Review+2
Thanks! needed a manual rebase, though.
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30584 )
Change subject: Hook up Kconfig Ada spec file ......................................................................
Patch Set 3: Code-Review+2
Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/30584 )
Change subject: Hook up Kconfig Ada spec file ......................................................................
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 --- M Makefile M Makefile.inc M src/lib/Makefile.inc A src/lib/cb.ads 4 files changed, 16 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, approved
diff --git a/Makefile b/Makefile index 13b73ff..45b0bc5 100644 --- a/Makefile +++ b/Makefile @@ -188,6 +188,9 @@ $(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 @@ # 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 @@ 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 594ef36..7d6bc7c 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -215,7 +215,9 @@ 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 68431f9..fa1ff8b 100644 --- a/src/lib/Makefile.inc +++ b/src/lib/Makefile.inc @@ -296,6 +296,8 @@ $(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 0000000..41a2a42 --- /dev/null +++ b/src/lib/cb.ads @@ -0,0 +1,2 @@ +package CB is +end CB;