diff options
Diffstat (limited to 'examples/kconfig-static')
-rw-r--r-- | examples/kconfig-static/Kconfig | 22 | ||||
-rw-r--r-- | examples/kconfig-static/Makefile | 19 | ||||
-rw-r--r-- | examples/kconfig-static/nfpkeys.json | 1 | ||||
-rwxr-xr-x | examples/kconfig-static/nfpvalues.sh | 22 |
4 files changed, 64 insertions, 0 deletions
diff --git a/examples/kconfig-static/Kconfig b/examples/kconfig-static/Kconfig new file mode 100644 index 0000000..1b02bac --- /dev/null +++ b/examples/kconfig-static/Kconfig @@ -0,0 +1,22 @@ +choice +prompt "pi or tau?" + +config X5 +bool "X = 5" + +config X6 +bool "X = 6" +depends on !Y0 + +endchoice + +choice +prompt "apples or oranges?" + +config Y4 +bool "Y = 4" + +config Y0 +bool "Y = 0" + +endchoice diff --git a/examples/kconfig-static/Makefile b/examples/kconfig-static/Makefile new file mode 100644 index 0000000..9e56c12 --- /dev/null +++ b/examples/kconfig-static/Makefile @@ -0,0 +1,19 @@ +default: + @true + +config: + kconfig-qconf Kconfig + +randconfig: + kconfig-conf --randconfig Kconfig + +clean: + @true + +nfpvalues: + @./nfpvalues.sh + +nfpkeys: + @cat nfpkeys.json + +.PHONY: default config randconfig clean nfpvalues nfpkeys diff --git a/examples/kconfig-static/nfpkeys.json b/examples/kconfig-static/nfpkeys.json new file mode 100644 index 0000000..82a3e7f --- /dev/null +++ b/examples/kconfig-static/nfpkeys.json @@ -0,0 +1 @@ +{"Synthetic": {"X": {"unit": "apples", "description": "NFP X", "minimize": true}, "Y": {"unit": "oranges", "description": "NFP Y", "minimize": true}}} diff --git a/examples/kconfig-static/nfpvalues.sh b/examples/kconfig-static/nfpvalues.sh new file mode 100755 index 0000000..574aa47 --- /dev/null +++ b/examples/kconfig-static/nfpvalues.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +. ./.config + +X=0 +Y=0 + +if [ "$CONFIG_X5" = y ]; then + X=5 +fi +if [ "$CONFIG_X6" = y ]; then + X=6 +fi + +if [ "$CONFIG_Y0" = y ]; then + Y=0 +fi +if [ "$CONFIG_Y4" = y ]; then + Y=4 +fi + +echo '{"Synthetic": {"X": '$X', "Y": '$Y'}}' |