summaryrefslogtreecommitdiff
path: root/makefile.patch
blob: 2c8d56c2ad07275cefd3c9711eba12f62e70fe96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From 79b531fed7fdf05069c04a3f78c3c97ab9d4d3a0 Mon Sep 17 00:00:00 2001
From: Ulf Magnusson <ulfalizer@gmail.com>
Date: Fri, 7 Dec 2012 03:58:36 +0100
Subject: [PATCH] Kconfiglib scripts/kconfig/Makefile patch.

---
 scripts/kconfig/Makefile |   28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 3091794..d3bb0d6 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -11,6 +11,34 @@ else
 Kconfig := Kconfig
 endif
 
+PHONY += scriptconfig iscriptconfig kconfiglibtestconfig
+
+ifneq ($(filter scriptconfig iscriptconfig,$(MAKECMDGOALS)),)
+PYTHONCMD ?= python
+endif
+
+scriptconfig:
+	$(Q)if [ -z "$(SCRIPT)" ]; then                                                                       \
+			echo 'No script argument provided; use "make scriptconfig SCRIPT=<path to script>".'; \
+	else                                                                                                  \
+			PYTHONPATH="$(srctree)/Kconfiglib:$$PYTHONPATH"                                       \
+			  "$(PYTHONCMD)" "$(SCRIPT)" $(srctree)/$(Kconfig);                                   \
+	fi
+
+iscriptconfig:
+	$(Q)PYTHONPATH="$(srctree)/Kconfiglib:$$PYTHONPATH" "$(PYTHONCMD)" -i -c \
+	  "import kconfiglib; \
+	   import sys; \
+	   c = kconfiglib.Config(sys.argv[1]); \
+	   print \"A Config instance 'c' for the architecture ({0}) has been created.\".format(c.get_arch())" \
+	  $(srctree)/$(Kconfig)
+
+# Used by kconfigtest.py to be able to compare output for nonsensical
+# arch/defconfig combinations, which has proven effective for finding obscure
+# bugs
+kconfiglibtestconfig: $(obj)/conf
+	$(Q)$< --defconfig=.config $(srctree)/$(Kconfig)
+
 xconfig: $(obj)/qconf
 	$< $(Kconfig)
 
-- 
1.7.9.5