summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2018-09-08 17:25:51 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2018-09-08 19:33:47 +0200
commit374f48873424f9167f508a53a80f3ea1c2d41c46 (patch)
tree3a4d93f34e261df55e4ba7551678350dd4ecbce7 /examples
parent87fe0b8a96d8aa522b47dee46dfeaf4fbc0c306b (diff)
Clean up kernel Makefile patch and add new targets
Add two new targets: - 'make kmenuconfig' runs the menuconfig interface - 'make dumpvarsconfig' lists all referenced environment variables together with their values (assuming they used the preprocessor syntax) Remove the 'kconfiglibtestconfig' target, which is no longer used. Also clean up the target definitions. The joys of ancient code.
Diffstat (limited to 'examples')
-rw-r--r--examples/dumpvars.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/examples/dumpvars.py b/examples/dumpvars.py
new file mode 100644
index 0000000..5ce65c2
--- /dev/null
+++ b/examples/dumpvars.py
@@ -0,0 +1,15 @@
+# Shows a list of all (set) environment variables referenced in the Kconfig
+# files, together with their values.
+#
+# Note: This only works for environment variables referenced via the $(FOO)
+# preprocessor syntax. The older $FOO syntax is maintained for backwards
+# compatibility.
+
+import os
+import sys
+
+import kconfiglib
+
+
+for var in kconfiglib.Kconfig(sys.argv[1]).env_vars:
+ print("{:16} '{}'".format(var, os.environ[var]))