diff mbox

[U-Boot,6/7] kconfig: invoke silentoldconfig if spl, tpl/.config is updated

Message ID 1411727024-19153-7-git-send-email-yamada.m@jp.panasonic.com
State Superseded
Delegated to: Tom Rini
Headers show

Commit Message

Masahiro Yamada Sept. 26, 2014, 10:23 a.m. UTC
When spl/.config is updated by "make spl/menuconfig" or friends,
spl/include/config/auto.conf, spl/include/generated/autoconf.h
and some other files must be updated by "make silentoldconfig".

There is no hook for SPL in the top Makefile, so this commit
touches .config when spl/.config is updated to invoke silentoldconfig.
Likewise for TPL.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
---

 scripts/multiconfig.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
diff mbox

Patch

diff --git a/scripts/multiconfig.sh b/scripts/multiconfig.sh
index b5185a8..d128bee 100644
--- a/scripts/multiconfig.sh
+++ b/scripts/multiconfig.sh
@@ -297,9 +297,24 @@  do_others () {
 	else
 		objdir=${1%/*}
 		check_enabled_subimage $1 $objdir
+
+		if [ -f "$objdir/$KCONFIG_CONFIG" ]; then
+			timestamp_before=$(stat --printf="%Y" \
+						$objdir/$KCONFIG_CONFIG)
+		fi
 	fi
 
 	run_make_config $target $objdir
+
+	if [ "$timestamp_before" -a -f "$objdir/$KCONFIG_CONFIG" ]; then
+		timestamp_after=$(stat --printf="%Y" $objdir/$KCONFIG_CONFIG)
+
+		if [ "$timestamp_after" -gt "$timestamp_before" ]; then
+			# $objdir/.config has been updated.
+			# touch .config to invoke "make silentoldconfig"
+			touch $KCONFIG_CONFIG
+		fi
+	fi
 }
 
 progname=$(basename $0)