diff mbox

[U-Boot,1/6] Create a .cfg file containing the CONFIG options used to build

Message ID 1423199175-4816-2-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass Feb. 6, 2015, 5:06 a.m. UTC
At present CONFIG options are split across Kconfig and board config headers
files. Also we have multiple files containing these CONFIG options.

In order to see exactly what is being used for building, create a .cfg
file which holds these options as reported by the C preprocessor.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 Makefile             | 10 +++++++++-
 scripts/Makefile.spl |  9 ++++++++-
 2 files changed, 17 insertions(+), 2 deletions(-)

Comments

Simon Glass April 18, 2015, 10:19 p.m. UTC | #1
Hi,

On 5 February 2015 at 22:06, Simon Glass <sjg@chromium.org> wrote:
> At present CONFIG options are split across Kconfig and board config headers
> files. Also we have multiple files containing these CONFIG options.
>
> In order to see exactly what is being used for building, create a .cfg
> file which holds these options as reported by the C preprocessor.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
>  Makefile             | 10 +++++++++-
>  scripts/Makefile.spl |  9 ++++++++-
>  2 files changed, 17 insertions(+), 2 deletions(-)

There have been no comments on this. I'm going to apply it, but if
there are any concerns please let me know.

Applied to u-boot-x86/buildman.

Regards,
Simon
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 92faed6..737c0ba 100644
--- a/Makefile
+++ b/Makefile
@@ -708,7 +708,7 @@  DO_STATIC_RELA =
 endif
 
 # Always append ALL so that arch config.mk's can add custom ones
-ALL-y += u-boot.srec u-boot.bin System.map binary_size_check
+ALL-y += u-boot.srec u-boot.bin System.map u-boot.cfg binary_size_check
 
 ALL-$(CONFIG_ONENAND_U_BOOT) += u-boot-onenand.bin
 ifeq ($(CONFIG_SPL_FSL_PBL),y)
@@ -849,6 +849,11 @@  ifndef CONFIG_SYS_UBOOT_START
 CONFIG_SYS_UBOOT_START := 0
 endif
 
+# Create a file containing the configuration options the image was built with
+quiet_cmd_cpp_cfg = CFG     $@
+cmd_cpp_cfg = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) -ansi \
+		-D__ASSEMBLY__ -x assembler-with-cpp -P -dM -E -o $@ $<
+
 MKIMAGEFLAGS_u-boot.img = -A $(ARCH) -T firmware -C none -O u-boot \
 	-a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_UBOOT_START) \
 	-n "U-Boot $(UBOOTRELEASE) for $(BOARD) board"
@@ -873,6 +878,9 @@  u-boot.sha1:	u-boot.bin
 u-boot.dis:	u-boot
 		$(OBJDUMP) -d $< > $@
 
+u-boot.cfg:	include/config.h
+	$(call if_changed,cpp_cfg)
+
 ifdef CONFIG_TPL
 SPL_PAYLOAD := tpl/u-boot-with-tpl.bin
 else
diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index ecf3037..d832c52 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -146,7 +146,7 @@  endif
 boot.bin: $(obj)/u-boot-spl.bin
 	$(call if_changed,mkimage)
 
-ALL-y	+= $(obj)/$(SPL_BIN).bin
+ALL-y	+= $(obj)/$(SPL_BIN).bin $(obj)/$(SPL_BIN).cfg
 
 ifdef CONFIG_SAMSUNG
 ALL-y	+= $(obj)/$(BOARD)-spl.bin
@@ -164,6 +164,13 @@  endif
 
 all:	$(ALL-y)
 
+quiet_cmd_cpp_cfg = CFG     $@
+cmd_cpp_cfg = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) -ansi \
+		-D__ASSEMBLY__ -x assembler-with-cpp -P -dM -E -o $@ $<
+
+$(obj)/$(SPL_BIN).cfg:	include/config.h
+	$(call if_changed,cpp_cfg)
+
 ifdef CONFIG_SAMSUNG
 ifdef CONFIG_VAR_SIZE_SPL
 VAR_SIZE_PARAM = --vs