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

From: Arnaud Lacombe
Date: Fri Jul 01 2011 - 19:32:23 EST


This avoid having to deals with multiline shell command in the Makefile and
increase readability.

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

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
--
1.7.3.4.574.g608b.dirty

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/