Skip to contentSkip to conversation

Refactor makefiles for u-boot.cfg rules

PATCH New Masahiro Yamada 3 participants 21 messages Sep 26, 2016 – Oct 8, 2016 Kbuild

lore
Share & tools
lore
#0 lore raw

cover Refactor makefiles for u-boot.cfg rules

The Makefiles are getting cluttered for u-boot.cfg.

I do not think that we should make effort for u-boot.cfg because it is almost the same as include/autoconf.mk.tmp

I was consindering this series as a replacement
for Stephen Warren's fixes, but I was late.

Anyway, I do not like code duplication, so here it is.

Masahiro Yamada (5):
check-config: fix wrong comment about how to build whitelist
kbuild: move no_new_adhoc_configs_check to "all" target command
kbuild: make dependencies in scripts/Makefile.autoconf more readable
kbuild: generate u-boot.cfg as a byproduct of include/autoconf.mk
check-config: allow to complete build even with ad-hoc CONFIG options

 Makefile                  | 29 ++++++-----------------------
 scripts/Makefile.autoconf | 42 +++++++++++++++++++++++++++---------------
 scripts/Makefile.spl      | 20 +-------------------
 scripts/check-config.sh   | 12 +++---------
 4 files changed, 37 insertions(+), 66 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/5 check-config: fix wrong comment about how to build whitelist

The command suggested in this comment block is wrong; it would not rip off CONFIG options that had already been converted to Kconfig.

Instead, we should use the scripts/build-whitelist.sh tool.

---

 scripts/check-config.sh | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
scripts/check-config.sh +2 -7
index 28c8fe9..6618dfb 100755
@@ -5,13 +5,8 @@
 # Check that the u-boot.cfg file provided does not introduce any new
 # ad-hoc CONFIG options
 #
-# You can generate the list of current ad-hoc CONFIG options (those which are
-# not in Kconfig) with this command:
-#
-# export LC_ALL=C LC_COLLATE=C
-# git grep CONFIG_ |tr ' \t' '\n\n' |sed -n 's/^\(CONFIG_[A-Z0-9_]*\).*/\1/p' \
-#	|sort |uniq >scripts/config_whitelist.txt;
-# unset LC_ALL LC_COLLATE
+# Use scripts/build-whitelist.sh to generate the list of current ad-hoc
+# CONFIG options (those which are not in Kconfig).
 
 # Usage
 #    check-config.sh <path to u-boot.cfg> <path to whitelist file> <source dir>
Signature · 1 line
1.9.1
#2 lore raw

PATCH 1/5 check-config: fix wrong comment about how to build whitelist

Hi Masahiro,

Quoted 18 lines · Masahiro Yamada

The command suggested in this comment block is wrong; it would not rip off CONFIG options that had already been converted to Kconfig.

Instead, we should use the scripts/build-whitelist.sh tool.

---

 scripts/check-config.sh | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
scripts/check-config.sh +0 -0
index 28c8fe9..6618dfb 100755
@@ -5,13 +5,8 @@
 # Check that the u-boot.cfg file provided does not introduce any new
 # ad-hoc CONFIG options

scripts/check-config.sh line 9

Quoted 10 lines
scripts/check-config.sh +2 -7
 #
-# You can generate the list of current ad-hoc CONFIG options (those which are
-# not in Kconfig) with this command:
-#
-# export LC_ALL=C LC_COLLATE=C
-# git grep CONFIG_ |tr ' \t' '\n\n' |sed -n 's/^\(CONFIG_[A-Z0-9_]*\).*/\1/p' \
-#      |sort |uniq >scripts/config_whitelist.txt;
-# unset LC_ALL LC_COLLATE
+# Use scripts/build-whitelist.sh to generate the list of current ad-hoc
+# CONFIG options (those which are not in Kconfig).

For me the LC setup is needed. Does it work correctly without it for you? I found that the sorting was wrong.

Quoted 6 lines
scripts/check-config.sh +0 -1
 # Usage
 #    check-config.sh <path to u-boot.cfg> <path to whitelist file> <source dir>
--

1.9.1

Regards,
Simon

#3 lore raw

PATCH 1/5 check-config: fix wrong comment about how to build whitelist

Hi Simon,

2016-09-27 9:34 GMT+09:00 Simon Glass <[email protected]>:

Quoted 27 lines

Hi Masahiro,

Quoted 23 lines · Masahiro Yamada

The command suggested in this comment block is wrong; it would not rip off CONFIG options that had already been converted to Kconfig.

Instead, we should use the scripts/build-whitelist.sh tool.

---

 scripts/check-config.sh | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
scripts/check-config.sh +0 -4
index 28c8fe9..6618dfb 100755
@@ -5,13 +5,8 @@
 # Check that the u-boot.cfg file provided does not introduce any new
 # ad-hoc CONFIG options
 #
-# You can generate the list of current ad-hoc CONFIG options (those which are
-# not in Kconfig) with this command:
-#
-# export LC_ALL=C LC_COLLATE=C
Quoted 8 lines

scripts/check-config.sh line 9

Quoted 5 lines
scripts/check-config.sh +2 -3
-# git grep CONFIG_ |tr ' \t' '\n\n' |sed -n 's/^\(CONFIG_[A-Z0-9_]*\).*/\1/p' \
-#      |sort |uniq >scripts/config_whitelist.txt;
-# unset LC_ALL LC_COLLATE
+# Use scripts/build-whitelist.sh to generate the list of current ad-hoc
+# CONFIG options (those which are not in Kconfig).

For me the LC setup is needed. Does it work correctly without it for you? I found that the sorting was wrong.

I am not quite sure about this, but it worked for me.

I can see

export LC_ALL=C
export LC_COLLATE=C

in both check-config.sh and build-whitelist.sh

That's why?

Signature · 2 lines
Best Regards
Masahiro Yamada
#4 lore raw

PATCH 1/5 check-config: fix wrong comment about how to build whitelist

Quoted 46 lines · Masahiro Yamada

Hi Simon,

2016-09-27 9:34 GMT+09:00 Simon Glass <[email protected]>:

Quoted 27 lines

Hi Masahiro,

Quoted 23 lines · Masahiro Yamada

The command suggested in this comment block is wrong; it would not rip off CONFIG options that had already been converted to Kconfig.

Instead, we should use the scripts/build-whitelist.sh tool.

---

 scripts/check-config.sh | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
scripts/check-config.sh +0 -4
index 28c8fe9..6618dfb 100755
@@ -5,13 +5,8 @@
 # Check that the u-boot.cfg file provided does not introduce any new
 # ad-hoc CONFIG options
 #
-# You can generate the list of current ad-hoc CONFIG options (those which are
-# not in Kconfig) with this command:
-#
-# export LC_ALL=C LC_COLLATE=C
Quoted 8 lines

scripts/check-config.sh line 9

Quoted 5 lines
scripts/check-config.sh +2 -3
-# git grep CONFIG_ |tr ' \t' '\n\n' |sed -n 's/^\(CONFIG_[A-Z0-9_]*\).*/\1/p' \
-#      |sort |uniq >scripts/config_whitelist.txt;
-# unset LC_ALL LC_COLLATE
+# Use scripts/build-whitelist.sh to generate the list of current ad-hoc
+# CONFIG options (those which are not in Kconfig).

For me the LC setup is needed. Does it work correctly without it for you? I found that the sorting was wrong.

I am not quite sure about this, but it worked for me.

I can see

Quoted 7 lines

export LC_ALL=C
export LC_COLLATE=C

in both check-config.sh and build-whitelist.sh

That's why?

OK thanks. I must have fixed it and forgotten about it.

BTW, what do you think about updating moveconfig.py to remove things from the whitelist as well?

Regards,
Simon

#5 lore raw

PATCH 1/5 check-config: fix wrong comment about how to build whitelist

2016-10-06 1:50 GMT+09:00 Simon Glass <[email protected]>:

Quoted 2 lines

BTW, what do you think about updating moveconfig.py to remove things from the whitelist as well?

Yeah, I was also thinking of this.

Signature · 2 lines
Best Regards
Masahiro Yamada
#6 lore raw

PATCH 1/5 check-config: fix wrong comment about how to build whitelist

In reply to Masahiro Yamada
Quoted 7 lines · Masahiro Yamada

The command suggested in this comment block is wrong; it would not rip off CONFIG options that had already been converted to Kconfig.

Instead, we should use the scripts/build-whitelist.sh tool.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161008/493f1b9d/attachment.sig>
#7 lore raw

PATCH 2/5 kbuild: move no_new_adhoc_configs_check to "all" target command

In reply to Masahiro Yamada

I am going to move the build rule of u-boot.cfg. Before that, no_new_adhoc_configs_check must be tweaked to not depend on it.

The ad-hoc option check can be done at the end of build, along with other checks.

---

 Makefile | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
Makefile +6 -8
index c30f90a..2f7a52b 100644
@@ -741,7 +741,7 @@ endif
 
 # Always append ALL so that arch config.mk's can add custom ones
 ALL-y += u-boot.srec u-boot.bin u-boot.sym System.map u-boot.cfg \
-	binary_size_check no_new_adhoc_configs_check
+	binary_size_check
 
 ALL-$(CONFIG_ONENAND_U_BOOT) += u-boot-onenand.bin
 ifeq ($(CONFIG_SPL_FSL_PBL),y)
@@ -820,6 +820,11 @@ ifeq ($(CONFIG_DM_I2C_COMPAT)$(CONFIG_SANDBOX),y)
 	@echo "before sending patches to the mailing list."
 	@echo "===================================================="
 endif
+	@# Check that this build does not use CONFIG options that we do not
+	@# know about unless they are in Kconfig. All the existing CONFIG
+	@# options are whitelisted, so new ones should not be added.
+	$(srctree)/scripts/check-config.sh u-boot.cfg \
+		$(srctree)/scripts/config_whitelist.txt ${srctree} 1>&2
 
 PHONY += dtbs
 dtbs: dts/dt.dtb
@@ -950,13 +955,6 @@ endif
 u-boot.cfg:	include/config.h FORCE
 	$(call if_changed_dep,cpp_cfg)
 
-# Check that this build does not use CONFIG options that we don't know about
-# unless they are in Kconfig. All the existing CONFIG options are whitelisted,
-# so new ones should not be added.
-no_new_adhoc_configs_check: u-boot.cfg FORCE
-	$(srctree)/scripts/check-config.sh $< \
-		$(srctree)/scripts/config_whitelist.txt ${srctree} 1>&2
-
 ifdef CONFIG_TPL
 SPL_PAYLOAD := tpl/u-boot-with-tpl.bin
 else
Signature · 1 line
1.9.1
#8 lore raw

PATCH 2/5 kbuild: move no_new_adhoc_configs_check to "all" target command

Quoted 11 lines · Masahiro Yamada

I am going to move the build rule of u-boot.cfg. Before that, no_new_adhoc_configs_check must be tweaked to not depend on it.

The ad-hoc option check can be done at the end of build, along with other checks.

---

 Makefile | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
#9 lore raw

PATCH 2/5 kbuild: move no_new_adhoc_configs_check to "all" target command

In reply to Masahiro Yamada
Quoted 8 lines · Masahiro Yamada

I am going to move the build rule of u-boot.cfg. Before that, no_new_adhoc_configs_check must be tweaked to not depend on it.

The ad-hoc option check can be done at the end of build, along with other checks.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161008/b14affaf/attachment.sig>
#10 lore raw

PATCH 3/5 kbuild: make dependencies in scripts/Makefile.autoconf more readable

In reply to Masahiro Yamada

I do not remember why I wrote the code like this, but let's make it a bit more readable.

---

 scripts/Makefile.autoconf | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
scripts/Makefile.autoconf +4 -7
index 01a739d..ba674f8 100644
@@ -46,7 +46,7 @@ quiet_cmd_autoconf_dep = GEN     $@
 	-MQ include/config/auto.conf $(srctree)/include/common.h > $@ || {	\
 		rm $@; false;							\
 	}
-include/autoconf.mk.dep: FORCE
+include/autoconf.mk.dep: include/config.h FORCE
 	$(call cmd,autoconf_dep)
 
 # We are migrating from board headers to Kconfig little by little.
@@ -71,20 +71,17 @@ quiet_cmd_autoconf = GEN     $@
 		rm [email protected]; false;							\
 	}
 
-include/autoconf.mk: FORCE
+include/autoconf.mk: include/config.h FORCE
 	$(call cmd,autoconf)
 
-spl/include/autoconf.mk: FORCE
+spl/include/autoconf.mk: include/config.h FORCE
 	$(Q)mkdir -p $(dir $@)
 	$(call cmd,autoconf,-DCONFIG_SPL_BUILD)
 
-tpl/include/autoconf.mk: FORCE
+tpl/include/autoconf.mk: include/config.h FORCE
 	$(Q)mkdir -p $(dir $@)
 	$(call cmd,autoconf,-DCONFIG_SPL_BUILD -DCONFIG_TPL_BUILD)
 
-include/autoconf.mk include/autoconf.mk.dep \
-	spl/include/autoconf.mk tpl/include/autoconf.mk: include/config.h
-
 # include/config.h
 # Prior to Kconfig, it was generated by mkconfig. Now it is created here.
 define filechk_config_h
Signature · 1 line
1.9.1
#12 lore raw

PATCH 3/5 kbuild: make dependencies in scripts/Makefile.autoconf more readable

In reply to Masahiro Yamada
Quoted 5 lines · Masahiro Yamada

I do not remember why I wrote the code like this, but let's make it a bit more readable.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161008/7bf54ffe/attachment.sig>
#13 lore raw

PATCH 4/5 kbuild: generate u-boot.cfg as a byproduct of include/autoconf.mk

In reply to Masahiro Yamada

Our build system still parses ad-hoc CONFIG options in header files and generates include/autoconf.mk so that Makefiles can reference them. This gimmick was introduced in the pre-Kconfig days and will be kept until Kconfig migration is completed.

The include/autoconf.mk is generated like follows:

[1] Preprocess include/common.h with -DDO_DEPS_ONLY and retrieve macros into include/autoconf.mk.tmp
[2] Reformat include/autoconf.mk.dep into include/autoconf.mk with tools/scripts/define2mk.sed script
[3] Remove include/autoconf.mk.tmp

Here, include/autoconf.mk.tmp is similar to u-boot.cfg, which is also generated by preprocessing include/config.h with -DDO_DEPS_ONLY. In other words, there is much overlap among include/autoconf.mk and u-boot.cfg build rules.

So, the idea is to split the build rule of include/autoconf.mk into two stages. The first preprocesses headers into u-boot.cfg. The second parses the u-boot.cfg into include/autoconf.mk. The build rules of u-boot.cfg in Makefile and spl/Makefile will be gone.

---

 Makefile                  | 17 +----------------
 scripts/Makefile.autoconf | 37 ++++++++++++++++++++++++++-----------
 scripts/Makefile.spl      | 20 +-------------------
 3 files changed, 28 insertions(+), 46 deletions(-)
Makefile +1 -16
index 2f7a52b..095e348 100644
@@ -740,8 +740,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 u-boot.sym System.map u-boot.cfg \
-	binary_size_check
+ALL-y += u-boot.srec u-boot.bin u-boot.sym System.map binary_size_check
 
 ALL-$(CONFIG_ONENAND_U_BOOT) += u-boot-onenand.bin
 ifeq ($(CONFIG_SPL_FSL_PBL),y)
@@ -941,20 +940,6 @@ u-boot.sha1:	u-boot.bin
 u-boot.dis:	u-boot
 		$(OBJDUMP) -d $< > $@
 
-# If .u-boot.cfg.d is still present, then either:
-# a) The previous build used a Makefile that used if_changed rather than
-#    if_changed_dep when building u-boot.cfg, and hence any later builds will
-#    be unaware of the dependencies for u-boot.cfg. In this case, we must
-#    delete u-boot.cfg to force it and .u-boot.cfg.cmd to be rebuilt the
-#    correct way.
-# b) The previous build failed or was interrupted while building u-boot.cfg,
-#    so deleting u-boot.cfg isn't going to cause any additional work.
-ifneq ($(wildcard $(obj)/.u-boot.cfg.d),)
-  unused := $(shell rm -f $(obj)/u-boot.cfg)
-endif
-u-boot.cfg:	include/config.h FORCE
-	$(call if_changed_dep,cpp_cfg)
-
 ifdef CONFIG_TPL
 SPL_PAYLOAD := tpl/u-boot-with-tpl.bin
 else
scripts/Makefile.autoconf +26 -11
index ba674f8..2f85eb9 100644
@@ -58,29 +58,44 @@ include/autoconf.mk.dep: include/config.h FORCE
 # same CONFIG macros
 quiet_cmd_autoconf = GEN     $@
       cmd_autoconf = \
-	$(CPP) $(c_flags) $2 -DDO_DEPS_ONLY -dM $(srctree)/include/common.h > [email protected] && { \
-		sed -n -f $(srctree)/tools/scripts/define2mk.sed [email protected] |		\
+		sed -n -f $(srctree)/tools/scripts/define2mk.sed $< |			\
 		while read line; do							\
 			if [ -n "${KCONFIG_IGNORE_DUPLICATES}" ] ||			\
 			   ! grep -q "$${line%=*}=" include/config/auto.conf; then	\
 				echo "$$line";						\
 			fi								\
-		done > $@;								\
-		rm [email protected];								\
-	} || {										\
-		rm [email protected]; false;							\
+		done > $@
+
+quiet_cmd_u_boot_cfg = CFG     $@
+      cmd_u_boot_cfg = \
+	$(CPP) $(c_flags) $2 -DDO_DEPS_ONLY -dM $(srctree)/include/common.h > [email protected] && { \
+		grep 'define CONFIG_' [email protected] > $@;			\
+		rm [email protected];						\
+	} || {								\
+		rm [email protected]; false;					\
 	}
 
-include/autoconf.mk: include/config.h FORCE
+u-boot.cfg: include/config.h FORCE
+	$(call cmd,u_boot_cfg)
+
+spl/u-boot.cfg: include/config.h FORCE
+	$(Q)mkdir -p $(dir $@)
+	$(call cmd,u_boot_cfg,-DCONFIG_SPL_BUILD)
+
+tpl/u-boot.cfg: include/config.h FORCE
+	$(Q)mkdir -p $(dir $@)
+	$(call cmd,u_boot_cfg,-DCONFIG_SPL_BUILD -DCONFIG_TPL_BUILD)
+
+include/autoconf.mk: u-boot.cfg
 	$(call cmd,autoconf)
 
-spl/include/autoconf.mk: include/config.h FORCE
+spl/include/autoconf.mk: spl/u-boot.cfg
 	$(Q)mkdir -p $(dir $@)
-	$(call cmd,autoconf,-DCONFIG_SPL_BUILD)
+	$(call cmd,autoconf)
 
-tpl/include/autoconf.mk: include/config.h FORCE
+tpl/include/autoconf.mk: tpl/u-boot.cfg
 	$(Q)mkdir -p $(dir $@)
-	$(call cmd,autoconf,-DCONFIG_SPL_BUILD -DCONFIG_TPL_BUILD)
+	$(call cmd,autoconf)
 
 # include/config.h
 # Prior to Kconfig, it was generated by mkconfig. Now it is created here.
scripts/Makefile.spl +1 -19
index 5a7f79c..677eef2 100644
@@ -152,7 +152,7 @@ spl/boot.bin: $(obj)/u-boot-spl.bin FORCE
 	$(call if_changed,mkimage)
 endif
 
-ALL-y	+= $(obj)/$(SPL_BIN).bin $(obj)/$(SPL_BIN).cfg
+ALL-y	+= $(obj)/$(SPL_BIN).bin
 
 ifdef CONFIG_SAMSUNG
 ALL-y	+= $(obj)/$(BOARD)-spl.bin
@@ -212,24 +212,6 @@ quiet_cmd_fdtgrep = FDTGREP $@
 $(obj)/$(SPL_BIN).dtb: dts/dt.dtb $(objtree)/tools/fdtgrep FORCE
 	$(call if_changed,fdtgrep)
 
-quiet_cmd_cpp_cfg = CFG     $@
-cmd_cpp_cfg = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) -ansi \
-	-DDO_DEPS_ONLY -D__ASSEMBLY__ -x assembler-with-cpp -P -dM -E -o $@ $<
-
-# If .u-boot.cfg.d is still present, then either:
-# a) The previous build used a Makefile that used if_changed rather than
-#    if_changed_dep when building u-boot.cfg, and hence any later builds will
-#    be unaware of the dependencies for u-boot.cfg. In this case, we must
-#    delete u-boot.cfg to force it and .u-boot.cfg.cmd to be rebuilt the
-#    correct way.
-# b) The previous build failed or was interrupted while building u-boot.cfg,
-#    so deleting u-boot.cfg isn't going to cause any additional work.
-ifneq ($(wildcard $(obj)/.$(SPL_BIN).d),)
-  unused := $(shell rm -f $(obj)/$(SPL_BIN).cfg)
-endif
-$(obj)/$(SPL_BIN).cfg:	include/config.h FORCE
-	$(call if_changed_dep,cpp_cfg)
-
 pythonpath = PYTHONPATH=tools
 
 quiet_cmd_dtocc = DTOC C  $@
Signature · 1 line
1.9.1
#14 lore raw

PATCH 4/5 kbuild: generate u-boot.cfg as a byproduct of include/autoconf.mk

Quoted 23 lines · Masahiro Yamada

Our build system still parses ad-hoc CONFIG options in header files and generates include/autoconf.mk so that Makefiles can reference them. This gimmick was introduced in the pre-Kconfig days and will be kept until Kconfig migration is completed.

The include/autoconf.mk is generated like follows:

[1] Preprocess include/common.h with -DDO_DEPS_ONLY and retrieve macros into include/autoconf.mk.tmp
[2] Reformat include/autoconf.mk.dep into include/autoconf.mk with tools/scripts/define2mk.sed script
[3] Remove include/autoconf.mk.tmp

Here, include/autoconf.mk.tmp is similar to u-boot.cfg, which is also generated by preprocessing include/config.h with -DDO_DEPS_ONLY. In other words, there is much overlap among include/autoconf.mk and u-boot.cfg build rules.

So, the idea is to split the build rule of include/autoconf.mk into two stages. The first preprocesses headers into u-boot.cfg. The second parses the u-boot.cfg into include/autoconf.mk. The build rules of u-boot.cfg in Makefile and spl/Makefile will be gone.

Quoted 7 lines

---

 Makefile                  | 17 +----------------
 scripts/Makefile.autoconf | 37 ++++++++++++++++++++++++++-----------
 scripts/Makefile.spl      | 20 +-------------------
 3 files changed, 28 insertions(+), 46 deletions(-)
#15 lore raw

PATCH 4/5 kbuild: generate u-boot.cfg as a byproduct of include/autoconf.mk

In reply to Masahiro Yamada
Quoted 18 lines · Masahiro Yamada

Our build system still parses ad-hoc CONFIG options in header files and generates include/autoconf.mk so that Makefiles can reference them. This gimmick was introduced in the pre-Kconfig days and will be kept until Kconfig migration is completed.

The include/autoconf.mk is generated like follows:

[1] Preprocess include/common.h with -DDO_DEPS_ONLY and retrieve macros into include/autoconf.mk.tmp
[2] Reformat include/autoconf.mk.dep into include/autoconf.mk with tools/scripts/define2mk.sed script
[3] Remove include/autoconf.mk.tmp

Here, include/autoconf.mk.tmp is similar to u-boot.cfg, which is also generated by preprocessing include/config.h with -DDO_DEPS_ONLY. In other words, there is much overlap among include/autoconf.mk and u-boot.cfg build rules.

Quoted 7 lines

So, the idea is to split the build rule of include/autoconf.mk into two stages. The first preprocesses headers into u-boot.cfg. The second parses the u-boot.cfg into include/autoconf.mk. The build rules of u-boot.cfg in Makefile and spl/Makefile will be gone.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161008/fe814714/attachment.sig>
#16 lore raw

PATCH 5/5 check-config: allow to complete build even with ad-hoc CONFIG options

In reply to Masahiro Yamada

Currently, the check-config.sh terminates the build when unknown ad-hoc options are detected. I think it is too much because we may want to patch config headers locally in a build/deployment project.

So, let's relax check-config.sh to just warn even if it detects options that are not in the whitelist. Instead, this check can be done at the end of build, along with other checks. It will catch more attention.

Even with this change, the Buildman tool catches new warnings, so Tom can give NACK to new ad-hoc options.

---

 scripts/check-config.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
scripts/check-config.sh +1 -2
index 6618dfb..9d2cfc6 100755
@@ -37,14 +37,13 @@ cat `find ${srctree} -name "Kconfig*"` |sed -n \
 	-e 's/^menuconfig \([A-Za-z0-9_]*\).*$/CONFIG_\1/p' |sort |uniq > ${ok}
 comm -23 ${suspects} ${ok} >${new_adhoc}
 if [ -s ${new_adhoc} ]; then
-	echo "Error: You must add new CONFIG options using Kconfig"
+	echo "Warning: You must add new CONFIG options using Kconfig"
 	echo "The following new ad-hoc CONFIG options were detected:"
 	cat ${new_adhoc}
 	echo
 	echo "Please add these via Kconfig instead. Find a suitable Kconfig"
 	echo "file and add a 'config' or 'menuconfig' option."
 	# Don't delete the temporary files in case they are useful
-	exit 1
 else
 	rm ${suspects} ${ok} ${new_adhoc}
 fi
Signature · 1 line
1.9.1
#17 lore raw

PATCH 5/5 check-config: allow to complete build even with ad-hoc CONFIG options

Hi Masahiro,

Quoted 9 lines · Masahiro Yamada

Currently, the check-config.sh terminates the build when unknown ad-hoc options are detected. I think it is too much because we may want to patch config headers locally in a build/deployment project.

So, let's relax check-config.sh to just warn even if it detects options that are not in the whitelist. Instead, this check can be done at the end of build, along with other checks. It will catch more attention.

Quoted 8 lines

Even with this change, the Buildman tool catches new warnings, so Tom can give NACK to new ad-hoc options.

---

 scripts/check-config.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

I am not sure this is a good idea. We need buildman to fail the build; otherwise patches will make it to mainline with new CONFIGs. Perhaps we should have an ENV variable to skip the check?

Regards,
Simon

#18 lore raw

PATCH 5/5 check-config: allow to complete build even with ad-hoc CONFIG options

Hi Simon,

2016-09-27 9:34 GMT+09:00 Simon Glass <[email protected]>:

Quoted 19 lines

Hi Masahiro,

Quoted 15 lines · Masahiro Yamada

Currently, the check-config.sh terminates the build when unknown ad-hoc options are detected. I think it is too much because we may want to patch config headers locally in a build/deployment project.

So, let's relax check-config.sh to just warn even if it detects options that are not in the whitelist. Instead, this check can be done at the end of build, along with other checks. It will catch more attention.

Even with this change, the Buildman tool catches new warnings, so Tom can give NACK to new ad-hoc options.

---

Quoted 6 lines
Quoted 2 lines
 scripts/check-config.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

I am not sure this is a good idea. We need buildman to fail the build; otherwise patches will make it to mainline with new CONFIGs. Perhaps we should have an ENV variable to skip the check?

It is OK for me as long as there is a way to work-around this check, ENV or whatever.

Signature · 2 lines
Best Regards
Masahiro Yamada
#19 lore raw

PATCH 5/5 check-config: allow to complete build even with ad-hoc CONFIG options

In reply to Masahiro Yamada
Quoted 3 lines · Masahiro Yamada

Currently, the check-config.sh terminates the build when unknown ad-hoc options are detected. I think it is too much because we may want to patch config headers locally in a build/deployment project.

I'm not yet convinced this is a good use case. In the not-so-long-now term include/configs/ should go away. So you wouldn't be able to do an ad-hoc thing like this for testing. And tossing stuff ad-hoc into $(BOARDDIR)/Kconfig should be easy enough too, yes?

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160927/02d5fb01/attachment.sig>
#20 lore raw

PATCH 5/5 check-config: allow to complete build even with ad-hoc CONFIG options

Hi Tom, Simon,

2016-09-28 2:44 GMT+09:00 Tom Rini <[email protected]>:

Quoted 11 lines · Masahiro Yamada
Quoted 4 lines

Currently, the check-config.sh terminates the build when unknown ad-hoc options are detected. I think it is too much because we may want to patch config headers locally in a build/deployment project.

I'm not yet convinced this is a good use case. In the not-so-long-now term include/configs/ should go away. So you wouldn't be able to do an ad-hoc thing like this for testing. And tossing stuff ad-hoc into $(BOARDDIR)/Kconfig should be easy enough too, yes?

You are right.

I tend to add local-hack options into my header file
just because it is easier than creating Kconfig entries and enabling them from a defconfig,
but it is possible to do so with a little more effort.

So, I retract this patch and marked the Patchwork one as Rejected.

Signature · 2 lines
Best Regards
Masahiro Yamada