From 26ac91d0df2f346d32bb732bc2d41a71006fc7d8 Mon Sep 17 00:00:00 2001 From: AceVest Date: Mon, 25 Jun 2018 15:30:04 +0800 Subject: [PATCH] add menuconfig --- rtos/Kconfig | 16 + rtos/components/debug/Kconfig | 0 rtos/components/debug/Kconfig.projbuild | 0 rtos/components/kernel/Kconfig | 0 rtos/components/kernel/Kconfig.projbuild | 7 + rtos/components/kernel/component.mk | 1 + rtos/components/test/Kconfig | 0 rtos/components/test/Kconfig.projbuild | 0 rtos/main/..config.tmp | 8 + rtos/{make/sdkconfig => main/.config} | 5 + rtos/main/.config.old | 9 + rtos/main/makefile | 19 + rtos/make/Kconfig.projbuild | 10 + rtos/make/makefile | 24 - rtos/make/project.mk | 29 + rtos/tools/kconfig/.config | 9 + rtos/tools/kconfig/conf | Bin 137456 -> 0 bytes rtos/tools/kconfig/conf.d | 130 -- rtos/tools/kconfig/lxdialog/checklist.d | 137 -- rtos/tools/kconfig/lxdialog/inputbox.d | 137 -- rtos/tools/kconfig/lxdialog/menubox.d | 137 -- rtos/tools/kconfig/lxdialog/textbox.d | 137 -- rtos/tools/kconfig/lxdialog/util.d | 138 -- rtos/tools/kconfig/lxdialog/yesno.d | 137 -- rtos/tools/kconfig/mconf | Bin 183944 -> 0 bytes rtos/tools/kconfig/mconf.d | 152 -- rtos/tools/kconfig/zconf.hash.c | 249 --- rtos/tools/kconfig/zconf.lex.c | 2556 --------------------- rtos/tools/kconfig/zconf.tab.c | 2564 ---------------------- rtos/tools/kconfig/zconf.tab.d | 137 -- 30 files changed, 113 insertions(+), 6635 deletions(-) create mode 100644 rtos/Kconfig create mode 100644 rtos/components/debug/Kconfig create mode 100644 rtos/components/debug/Kconfig.projbuild create mode 100644 rtos/components/kernel/Kconfig create mode 100644 rtos/components/kernel/Kconfig.projbuild create mode 100644 rtos/components/kernel/component.mk create mode 100644 rtos/components/test/Kconfig create mode 100644 rtos/components/test/Kconfig.projbuild create mode 100644 rtos/main/..config.tmp rename rtos/{make/sdkconfig => main/.config} (62%) create mode 100644 rtos/main/.config.old create mode 100644 rtos/main/makefile create mode 100644 rtos/make/Kconfig.projbuild delete mode 100644 rtos/make/makefile create mode 100644 rtos/tools/kconfig/.config delete mode 100755 rtos/tools/kconfig/conf delete mode 100644 rtos/tools/kconfig/conf.d delete mode 100644 rtos/tools/kconfig/lxdialog/checklist.d delete mode 100644 rtos/tools/kconfig/lxdialog/inputbox.d delete mode 100644 rtos/tools/kconfig/lxdialog/menubox.d delete mode 100644 rtos/tools/kconfig/lxdialog/textbox.d delete mode 100644 rtos/tools/kconfig/lxdialog/util.d delete mode 100644 rtos/tools/kconfig/lxdialog/yesno.d delete mode 100755 rtos/tools/kconfig/mconf delete mode 100644 rtos/tools/kconfig/mconf.d delete mode 100644 rtos/tools/kconfig/zconf.hash.c delete mode 100644 rtos/tools/kconfig/zconf.lex.c delete mode 100644 rtos/tools/kconfig/zconf.tab.c delete mode 100644 rtos/tools/kconfig/zconf.tab.d diff --git a/rtos/Kconfig b/rtos/Kconfig new file mode 100644 index 0000000..88457ff --- /dev/null +++ b/rtos/Kconfig @@ -0,0 +1,16 @@ +menu "RTOS Configuration" + +config BLINK_GPIO + int "Blink GPIO number" + range 0 34 + default 2 + help + GPIO number (IOxx) to blink on and off. + + Some GPIOs are used for other purposes (flash connections, etc.) and cannot be used to blink. + + GPIOs 35-39 are input-only so cannot be used as outputs. + +endmenu + +source "$COMPONENT_KCONFIGS_PROJBUILD" diff --git a/rtos/components/debug/Kconfig b/rtos/components/debug/Kconfig new file mode 100644 index 0000000..e69de29 diff --git a/rtos/components/debug/Kconfig.projbuild b/rtos/components/debug/Kconfig.projbuild new file mode 100644 index 0000000..e69de29 diff --git a/rtos/components/kernel/Kconfig b/rtos/components/kernel/Kconfig new file mode 100644 index 0000000..e69de29 diff --git a/rtos/components/kernel/Kconfig.projbuild b/rtos/components/kernel/Kconfig.projbuild new file mode 100644 index 0000000..83eedc8 --- /dev/null +++ b/rtos/components/kernel/Kconfig.projbuild @@ -0,0 +1,7 @@ +menu "Kernel config" +config KERNEL_NAME + string "Kernel name" + default "rtos" + help + what's the kenel name +endmenu diff --git a/rtos/components/kernel/component.mk b/rtos/components/kernel/component.mk new file mode 100644 index 0000000..51b0f91 --- /dev/null +++ b/rtos/components/kernel/component.mk @@ -0,0 +1 @@ +COMPONENT_CONFIG_ONLY := 1 diff --git a/rtos/components/test/Kconfig b/rtos/components/test/Kconfig new file mode 100644 index 0000000..e69de29 diff --git a/rtos/components/test/Kconfig.projbuild b/rtos/components/test/Kconfig.projbuild new file mode 100644 index 0000000..e69de29 diff --git a/rtos/main/..config.tmp b/rtos/main/..config.tmp new file mode 100644 index 0000000..af8a18c --- /dev/null +++ b/rtos/main/..config.tmp @@ -0,0 +1,8 @@ +deps_config := \ + /Users/ace/workspace/acecode/rtos/Kconfig + +include/config/auto.conf: \ + $(deps_config) + + +$(deps_config): ; diff --git a/rtos/make/sdkconfig b/rtos/main/.config similarity index 62% rename from rtos/make/sdkconfig rename to rtos/main/.config index 818afe4..8dfc153 100644 --- a/rtos/make/sdkconfig +++ b/rtos/main/.config @@ -2,3 +2,8 @@ # Automatically generated file; DO NOT EDIT. # Linux Kernel Configuration # + +# +# RTOS Configuration +# +CONFIG_BLINK_GPIO=2 diff --git a/rtos/main/.config.old b/rtos/main/.config.old new file mode 100644 index 0000000..8dfc153 --- /dev/null +++ b/rtos/main/.config.old @@ -0,0 +1,9 @@ +# +# Automatically generated file; DO NOT EDIT. +# Linux Kernel Configuration +# + +# +# RTOS Configuration +# +CONFIG_BLINK_GPIO=2 diff --git a/rtos/main/makefile b/rtos/main/makefile new file mode 100644 index 0000000..d5c60d6 --- /dev/null +++ b/rtos/main/makefile @@ -0,0 +1,19 @@ +include $(RTOS_PATH)/make/project.mk + +.PHONY: test +test: + @echo $(COMPONENT_KCONFIGS_PROJBUILD) + +define RunConf + mkdir -p $(BUILD_DIR_BASE)/include/config + cd $(BUILD_DIR_BASE); KCONFIG_AUTOHEADER=$(abspath $(BUILD_DIR_BASE)/include/sdkconfig.h) \ + COMPONENT_KCONFIGS="$(COMPONENT_KCONFIGS)" KCONFIG_CONFIG=$(SDKCONFIG) \ + COMPONENT_KCONFIGS_PROJBUILD="$(COMPONENT_KCONFIGS_PROJBUILD)" \ + $(KCONFIG_TOOL_DIR)/$1 $(RTOS_PATH)/Kconfig +endef + +.PHONY: menuconfig +menuconfig: $(KCONFIG_TOOL_DIR)/mconf $(KCONFIG_TOOL_DIR)/conf + $(call RunConf,mconf) + $(call RunConf,conf --silentoldconfig) + diff --git a/rtos/make/Kconfig.projbuild b/rtos/make/Kconfig.projbuild new file mode 100644 index 0000000..56fdf19 --- /dev/null +++ b/rtos/make/Kconfig.projbuild @@ -0,0 +1,10 @@ +menu "Example Configuration" + +config EXAMPLE_CONF_VAL + int "example configuration value" + range 0 34 + default 3 + help + example configuration value + +endmenu diff --git a/rtos/make/makefile b/rtos/make/makefile deleted file mode 100644 index 350cb35..0000000 --- a/rtos/make/makefile +++ /dev/null @@ -1,24 +0,0 @@ -include project.mk - - -.PHONY: test -COMPONENT_PATHS := $(foreach comp,$(COMPONENTS),$(firstword $(foreach cd,$(COMPONENT_DIRS),$(wildcard $(dir $(cd))$(comp) $(cd)/$(comp))))) -test: - @echo $(fuck) - @echo $(COMPONENT_PATHS) - @echo $(wildcard $(RTOS_PATH)) - @echo $(realpath $(wildcard $(RTOS_PATH))) - @echo $(COMPONENTS) - @echo $(COMPONENT_DIRS) - @echo $(foreach cd,$(COMPONENT_DIRS), $(wildcard $(cd)/*/component.mk)) - -define RunConf - mkdir -p $(BUILD_DIR_BASE)/include/config - cd $(BUILD_DIR_BASE); KCONFIG_AUTOHEADER=$(abspath $(BUILD_DIR_BASE)/include/sdkconfig.h) \ - COMPONENT_KCONFIGS="$(COMPONENT_KCONFIGS)" KCONFIG_CONFIG=$(SDKCONFIG) \ - COMPONENT_KCONFIGS_PROJBUILD="$(COMPONENT_KCONFIGS_PROJBUILD)" \ - $(KCONFIG_TOOL_DIR)/$1 $(RTOS_PATH)/Kconfig -endef - -menuconfig: $(KCONFIG_TOOL_DIR)/mconf - $(call RunConf,mconf) diff --git a/rtos/make/project.mk b/rtos/make/project.mk index 350c0d9..9a443da 100644 --- a/rtos/make/project.mk +++ b/rtos/make/project.mk @@ -1,3 +1,21 @@ +CC ?= gcc +LD ?= ld +AR ?= ar +OBJCOPY ?= objcopy +SIZE ?= size +HOSTCC := $(CC) +HOSTLD := $(LD) +HOSTAR := $(AR) +HOSTOBJCOPY := $(OBJCOPY) +HOSTSIZE := $(SIZE) +CC := $(call dequote,$(CONFIG_TOOLPREFIX))gcc +CXX := $(call dequote,$(CONFIG_TOOLPREFIX))c++ +LD := $(call dequote,$(CONFIG_TOOLPREFIX))ld +AR := $(call dequote,$(CONFIG_TOOLPREFIX))ar +OBJCOPY := $(call dequote,$(CONFIG_TOOLPREFIX))objcopy +SIZE := $(call dequote,$(CONFIG_TOOLPREFIX))size +export CC CXX LD AR OBJCOPY SIZE + # ?= 的意思是如果没有赋值过则赋值?=后面的值 OS ?= @@ -39,13 +57,24 @@ endif COMPONENTS := $(dir $(foreach cd,$(COMPONENT_DIRS), \ $(wildcard $(cd)/*/component.mk) $(wildcard $(cd)/component.mk))) +COMPONENTS := $(sort $(foreach comp,$(COMPONENTS),$(lastword $(subst /, ,$(comp))))) export COMPONENTS #endif COMPONENT_PATHS := $(foreach comp,$(COMPONENTS),$(firstword $(foreach cd,$(COMPONENT_DIRS),$(wildcard $(dir $(cd))$(comp) $(cd)/$(comp))))) COMPONENT_KCONFIGS := $(foreach component,$(COMPONENT_PATHS),$(wildcard $(component)/Kconfig)) + # COMPONENT_KCONFIGS_PROJBUILD 会在$(RTOS_PATH)/Kconfig里用到 COMPONENT_KCONFIGS_PROJBUILD := $(foreach component,$(COMPONENT_PATHS),$(wildcard $(component)/Kconfig.projbuild)) SDKCONFIG ?= $(PROJECT_PATH)/sdkconfig KCONFIG_TOOL_DIR=$(RTOS_PATH)/tools/kconfig + + +# Workaround to run make parallel (-j). mconf and conf cannot be made simultaneously +$(KCONFIG_TOOL_DIR)/mconf: $(KCONFIG_TOOL_DIR)/conf + +# reset MAKEFLAGS as the menuconfig makefile uses implicit compile rules +$(KCONFIG_TOOL_DIR)/mconf $(KCONFIG_TOOL_DIR)/conf: $(wildcard $(KCONFIG_TOOL_DIR)/*.c) + MAKEFLAGS="" CC=$(HOSTCC) LD=$(HOSTLD) \ + $(MAKE) -C $(KCONFIG_TOOL_DIR) diff --git a/rtos/tools/kconfig/.config b/rtos/tools/kconfig/.config new file mode 100644 index 0000000..8b6da9a --- /dev/null +++ b/rtos/tools/kconfig/.config @@ -0,0 +1,9 @@ +# +# Automatically generated file; DO NOT EDIT. +# Linux Kernel Configuration +# + +# +# RTOS Configuration +# +CONFIG_BLINK_GPIO=23 diff --git a/rtos/tools/kconfig/conf b/rtos/tools/kconfig/conf deleted file mode 100755 index 71aa412945be61f2ee6e558b7fefd37085f71e65..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 137456 zcmeFadwf*Y_5VEqj>b!zcu9-*c!z2gEKw9jgEBf=qIii~Z>V?|6@^r+je?Vr9FC(@ zOQqHe)>^gRXe$=2Ku{zBZHX0YT4@`Vwr48Z=+|nrD$o0~_Bk_?fd0O(=k+}QJdb(3 zPR`kTuf5jVYp=cb+Sgh2$vdBKnn+X(OeCfcNF)-~JRO@P61hYzUx~!_JQTj#N!p)_phRFaHApN83KU`6HZQ_c5+`3%iq=yOB9B;gvSF*_BUa|)C;CfjRL&- z`sU8!o3_8h5N{_9J%3Zy5gEkt~h_fC0AT{rG@*}@7yI0-#Jk} zh5PdqCD}`QGR^d4?3k0sl%=2#R%#pAGtm{w7Sg=*p7RgugGo>WIH#5xm0v@s&572@@ur`(^yq zNBAy|gr#sfK9#dEW{&rU_1c%e`Oi7|bw&6T{_=V~|J+o)=XCow+4)9E7(*fXykT!((Gyz6`^9XlSu<5T> zBzm?;SX&rOTIX98iJyUJE-|MOK~jyI){S3cR<@;}iT$)hw=xj|TQo+54NUoo-i>M0jY*}rc85&Of+CFcR#Ki{AO z*CMToKKV|%cFNQXF5mx%VkYwK%_BZ1zfqBxjf{py;RJH+0kg9q*o%@qKU6eV3Eni zmD!Jp8e_y33?et2PV-AaP6>Wa;_F0E7c{9=*j5>X<}mb;kgL`-(1i&SV&J|0b8<@pEg1e{>O9@0m*QZU;{$Xz0mIfVrm7D4e(U@e*B~S>rW_~b}Ur-O{MW~0tE>&td!tpQ_9zeQ_A(eo;MD(9l z$BiIfq;SSx4r6yg--_kuRtxB2!X~Z2Ykxv|lPwJNbDbpl`Iq>gyzy~pI0%c*wtbcj zJwMlBi4XKk3@iQIGNrWa-Y=!?qihJ~Hp_Op5^E@ACfnRe{UN?Yc+K5}Q8fh78Ghq8 z2tq~F)FiF&8xnJkm8hxH$+)pplxM*j-hBo|VZz$AiNaH~{oFzl3bY5I*ik6j05Umd zo4X*aMX16LOxv5gP?%R~XyGX!Hri7~n`$AU2Qv|-;)F9u82+Kv*txX5^14_ddlGoJ zG3{$jCpTZboxzN9Ca}6t*wsZfyhL^JsDRd-P5}nNOyG@r92VL>qdLMtG~sz9`?