forked from ulfalizer/Kconfiglib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile.patch
More file actions
53 lines (50 loc) · 1.68 KB
/
makefile.patch
File metadata and controls
53 lines (50 loc) · 1.68 KB
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
52
From 01899aa5e6d1f33e1965d7934bea2ff97a48bc89 Mon Sep 17 00:00:00 2001
From: Ulf Magnusson <ulfalizer@gmail.com>
Date: Tue, 9 Jun 2015 13:01:34 +0200
Subject: [PATCH] Kconfiglib scripts/kconfig/Makefile patch.
---
scripts/kconfig/Makefile | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 8c12c20c55a6..88c618b34915 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -27,1 +27,36 @@ gconfig: $(obj)/gconf
+PHONY += scriptconfig iscriptconfig kconfiglibtestconfig
+
+ifneq ($(filter scriptconfig iscriptconfig,$(MAKECMDGOALS)),)
+PYTHONCMD ?= python
+endif
+
+ifneq ($(filter scriptconfig,$(MAKECMDGOALS)),)
+ifndef SCRIPT
+$(error Use "make scriptconfig SCRIPT=<path to script> [SCRIPT_ARG=<argument>]")
+endif
+endif
+
+scriptconfig:
+ifdef SCRIPT_ARG
+ $(Q)PYTHONPATH="$(srctree)/Kconfiglib:$$PYTHONPATH" \
+ "$(PYTHONCMD)" "$(SCRIPT)" $(Kconfig) "$(SCRIPT_ARG)"
+else
+ $(Q)PYTHONPATH="$(srctree)/Kconfiglib:$$PYTHONPATH" \
+ "$(PYTHONCMD)" "$(SCRIPT)" $(Kconfig)
+endif
+
+iscriptconfig:
+ $(Q)PYTHONPATH="$(srctree)/Kconfiglib:$$PYTHONPATH" "$(PYTHONCMD)" -i -c \
+ "import kconfiglib; \
+ import sys; \
+ kconf = kconfiglib.Kconfig(sys.argv[4 if \"$(PYTHONCMD)\".startswith(\"ipython\") else 1]); \
+ print(\"A Kconfig instance 'kconf' for the architecture $(ARCH) has been created.\")" \
+ $(Kconfig)
+
+# Used by testsuite.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 $(Kconfig)
+
menuconfig: $(obj)/mconf
--
2.14.1