diff mbox

[RFC,4/4] kconfig/streamline_config.pl: move config generation to script

Message ID 1309563076-5050-5-git-send-email-lacombar@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Arnaud Lacombe July 1, 2011, 11:31 p.m. UTC
This avoid having to deals with multiline shell command in the Makefile and
increase readability.

Cc: Steven Rostedt <srostedt@redhat.com>
---
 scripts/kconfig/Makefile       |   14 +-------------
 scripts/kconfig/localconfig.sh |   20 ++++++++++++++++++++
 2 files changed, 21 insertions(+), 13 deletions(-)
 create mode 100755 scripts/kconfig/localconfig.sh
diff mbox

Patch

diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 8a59adf..d48ddc9 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -34,19 +34,7 @@  silentoldconfig: $(obj)/conf
 	$< --$@ $(Kconfig)
 
 localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
-	$(Q)mkdir -p include/generated
-	$(Q)perl $< $(srctree) $(Kconfig) > .tmp.config
-	$(Q)if [ -f .config ]; then 					\
-			cmp -s .tmp.config .config ||			\
-			(mv -f .config .config.old.1;			\
-			 mv -f .tmp.config .config;			\
-			 $(obj)/conf --silentoldconfig $(Kconfig);	\
-			 mv -f .config.old.1 .config.old)		\
-	else								\
-			mv -f .tmp.config .config;			\
-			$(obj)/conf --silentoldconfig $(Kconfig);	\
-	fi
-	$(Q)rm -f .tmp.config
+	$(Q)$(src)/localconfig.sh
 
 # Create new linux.pot file
 # Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files
diff --git a/scripts/kconfig/localconfig.sh b/scripts/kconfig/localconfig.sh
new file mode 100755
index 0000000..64dd295
--- /dev/null
+++ b/scripts/kconfig/localconfig.sh
@@ -0,0 +1,20 @@ 
+#!/bin/sh
+#
+
+mkdir -p include/generated
+
+perl "${srctree}/scripts/kconfig/streamline_config.pl" ${srctree}/ ${Kconfig} $1 > .tmp.config
+
+if [ -f .config ]; then
+	if ! cmp -s .tmp.config .config; then
+		mv -f .config .config.old.1
+		mv -f .tmp.config .config
+		${obj}/conf --silentoldconfig ${Kconfig}
+		mv -f .config.old.1 .config.old
+	fi
+else
+	mv -f .tmp.config .config
+	${obj}/conf --silentoldconfig ${Kconfig}
+fi
+
+rm -f .tmp.config