In generated choice menus, move the selection options outside the choice menu.
/trunk/kconfig/kconfig.mk | 60 35 25 0 +++++++++++++++++++++++++++++++----------------------
/trunk/config/kernel.in | 6 0 6 0 -----
/trunk/config/target.in | 6 0 6 0 -----
3 files changed, 35 insertions(+), 37 deletions(-)
1 # ===========================================================================
2 # crosstool-NG configuration targets
3 # These targets are used from top-level makefile
5 # Derive the project version from, well, the project version:
6 export PROJECTVERSION=$(CT_VERSION)
8 KCONFIG_TOP = config/config.in
9 obj = $(CT_TOP_DIR)/kconfig
10 PHONY += clean help oldconfig menuconfig config defoldconfig
12 # Darwin (MacOS-X) does not have proper libintl support
13 ifeq ($(shell uname -s),Darwin)
17 ifneq ($(KBUILD_NO_NLS),)
18 CFLAGS += -DKBUILD_NO_NLS
21 # Build a list of all config files
22 ARCH_CONFIG_FILES = $(wildcard $(CT_LIB_DIR)/config/arch/*.in)
23 KERNEL_CONFIG_FILES = $(wildcard $(CT_LIB_DIR)/config/kernel/*.in)
24 DEBUG_CONFIG_FILES = $(wildcard $(CT_LIB_DIR)/config/debug/*.in)
25 TOOL_CONFIG_FILES = $(wildcard $(CT_LIB_DIR)/config/tools/*.in)
27 STATIC_CONFIG_FILES = $(shell find $(CT_LIB_DIR)/config -type f -name '*.in')
28 GEN_CONFIG_FILES=$(CT_TOP_DIR)/config.gen/arch.in \
29 $(CT_TOP_DIR)/config.gen/kernel.in \
30 $(CT_TOP_DIR)/config.gen/tools.in \
31 $(CT_TOP_DIR)/config.gen/debug.in
33 CONFIG_FILES=$(STATIC_CONFIG_FILES) $(GEN_CONFIG_FILES)
36 ARCHS = $(patsubst $(CT_LIB_DIR)/config/arch/%.in,%,$(ARCH_CONFIG_FILES))
37 KERNELS = $(patsubst $(CT_LIB_DIR)/config/kernel/%.in,%,$(KERNEL_CONFIG_FILES))
38 DEBUGS = $(patsubst $(CT_LIB_DIR)/config/debug/%.in,%,$(DEBUG_CONFIG_FILES))
39 TOOLS = $(patsubst $(CT_LIB_DIR)/config/tools/%.in,%,$(TOOL_CONFIG_FILES))
41 $(GEN_CONFIG_FILES): $(CT_TOP_DIR)/config.gen \
42 $(CT_LIB_DIR)/kconfig/kconfig.mk
44 $(CT_TOP_DIR)/config.gen: $(KCONFIG_TOP)
45 @mkdir -p $(CT_TOP_DIR)/config.gen
47 # Function build_gen_choice_in:
48 # $1 : destination file
49 # $2 : name for the entries family (eg. Architecture, kernel...)
50 # $3 : prefix for the choice entries (eg. ARCH, KERNEL...)
51 # $4 : base directory containing config files
52 # $5 : list of config entries (eg. for architectures: "alpha arm ia64"...,
53 # and for kernels: "bare-metal linux"...)
54 # Example to build the kernels generated config file:
55 # $(call build_gen_choice_in,config.gen/kernel.in,Target OS,KERNEL,config/kernel,$(KERNELS))
56 define build_gen_choice_in
58 @(echo "# $(2) menu"; \
59 echo "# Generated file, do not edit!!!"; \
63 echo " prompt \"$(2)\""; \
65 for entry in $(5); do \
66 file="$(4)/$${entry}.in"; \
67 _entry=$$(echo "$${entry}" |sed -r -s -e 's/[-.+]/_/g;'); \
68 echo "config $(3)_$${_entry}"; \
70 printf " prompt \"$${entry}"; \
71 if grep -E '^# +EXPERIMENTAL$$' $${file} >/dev/null 2>&1; then \
72 echo " (EXPERIMENTAL)\""; \
73 echo " depends on EXPERIMENTAL"; \
80 for entry in $(5); do \
81 file="$(4)/$${entry}.in"; \
82 _entry=$$(echo "$${entry}" |sed -r -s -e 's/[-.+]/_/g;'); \
84 echo "if $(3)_$${_entry}"; \
86 echo " default \"$${entry}\" if $(3)_$${_entry}"; \
87 echo "source $${file}"; \
93 $(CT_TOP_DIR)/config.gen/arch.in: $(ARCH_CONFIG_FILES)
94 $(call build_gen_choice_in,$(patsubst $(CT_TOP_DIR)/%,%,$@),Target Architecture,ARCH,config/arch,$(ARCHS))
96 $(CT_TOP_DIR)/config.gen/kernel.in: $(KERNEL_CONFIG_FILES)
97 $(call build_gen_choice_in,$(patsubst $(CT_TOP_DIR)/%,%,$@),Target OS,KERNEL,config/kernel,$(KERNELS))
99 # Function build_gen_menu_in:
100 # $1 : destination file
101 # $2 : name of entries family (eg. Tools, Debug...)
102 # $3 : prefix for the menu entries (eg. TOOL, DEBUG)
103 # $4 : base directory containing config files
104 # $5 : list of config entries (eg. for tools: "libelf sstrip"..., and for
105 # debug: "dmalloc duma gdb"...)
106 # Example to build the tools generated config file:
107 # $(call build_gen_menu_in,config.gen/tools.in,Tools,TOOL,config/tools,$(TOOLS))
108 define build_gen_menu_in
110 @(echo "# $(2) facilities menu"; \
111 echo "# Generated file, do not edit!!!"; \
113 for entry in $(5); do \
114 file="$(4)/$${entry}.in"; \
115 _entry=$$(echo "$${entry}" |sed -r -s -e 's/[-.+]/_/g;'); \
116 echo "menuconfig $(3)_$${_entry}"; \
118 printf " prompt \"$${entry}"; \
119 if grep -E '^# +EXPERIMENTAL$$' $${file} >/dev/null 2>&1; then \
120 echo " (EXPERIMENTAL)\""; \
121 echo " depends on EXPERIMENTAL"; \
125 echo "if $(3)_$${_entry}"; \
126 echo "source $${file}"; \
133 $(CT_TOP_DIR)/config.gen/tools.in: $(TOOL_CONFIG_FILES)
134 $(call build_gen_menu_in,$(patsubst $(CT_TOP_DIR)/%,%,$@),Tools,TOOL,config/tools,$(TOOLS))
136 $(CT_TOP_DIR)/config.gen/debug.in: $(DEBUG_CONFIG_FILES)
137 $(call build_gen_menu_in,$(patsubst $(CT_TOP_DIR)/%,%,$@),Debug,DEBUG,config/debug,$(DEBUGS))
139 config menuconfig oldconfig defoldconfig: $(KCONFIG_TOP)
142 @ln -sf $(CT_LIB_DIR)/config config
144 menuconfig: $(CONFIG_FILES) $(obj)/mconf
145 @$(obj)/mconf $(KCONFIG_TOP)
147 config: $(CONFIG_FILES) $(obj)/conf
148 @$(obj)/conf $(KCONFIG_TOP)
150 oldconfig: $(CONFIG_FILES) $(obj)/conf
151 @$(obj)/conf -s $(KCONFIG_TOP)
153 defoldconfig: $(CONFIG_FILES) $(obj)/conf
154 @yes "" |$(obj)/conf -s $(KCONFIG_TOP)
156 # Help text used by make help
158 @echo ' config - Update current config using a line-oriented program'
159 @echo ' menuconfig - Update current config using a menu based program'
160 @echo ' oldconfig - Update current config using a provided .config as base'
161 @echo ' build log piped into stdin'
165 SHIPPED := $(CT_LIB_DIR)/kconfig/zconf.tab.c $(CT_LIB_DIR)/kconfig/lex.zconf.c $(CT_LIB_DIR)/kconfig/zconf.hash.c
167 $(obj)/conf $(obj)/mconf: $(obj)
172 HEADERS = $(CT_LIB_DIR)/kconfig/expr.h \
173 $(CT_LIB_DIR)/kconfig/lkc.h \
174 $(CT_LIB_DIR)/kconfig/lkc_proto.h
176 FILES = $(CT_LIB_DIR)/kconfig/confdata.c \
177 $(CT_LIB_DIR)/kconfig/expr.c \
178 $(CT_LIB_DIR)/kconfig/menu.c \
179 $(CT_LIB_DIR)/kconfig/symbol.c \
180 $(CT_LIB_DIR)/kconfig/util.c
182 $(obj)/mconf: $(SHIPPED) $(CT_LIB_DIR)/kconfig/mconf.c \
183 $(HEADERS) $(FILES) \
184 $(CT_LIB_DIR)/kconfig/kconfig.mk
185 @echo ' LD kconfig/mconf'
186 @$(HOST_CC) $(CFLAGS) -o $@ $(CT_LIB_DIR)/kconfig/{mconf.c,zconf.tab.c,lxdialog/*.c} \
187 $(shell $(CT_LIB_DIR)/kconfig/lxdialog/check-lxdialog.sh -ccflags) \
188 $(shell $(CT_LIB_DIR)/kconfig/lxdialog/check-lxdialog.sh -ldflags $(HOST_CC))
190 $(obj)/conf: $(SHIPPED) $(CT_LIB_DIR)/kconfig/conf.c \
191 $(HEADERS) $(FILES) \
192 $(CT_LIB_DIR)/kconfig/kconfig.mk
193 @echo ' LD kconfig/conf'
194 @$(HOST_CC) $(CFLAGS) -o $@ $(CT_LIB_DIR)/kconfig/{conf.c,zconf.tab.c}
197 @rm -f $(CT_TOP_DIR)/kconfig/{,m}conf
198 @rmdir --ignore-fail-on-non-empty $(CT_TOP_DIR)/kconfig 2>/dev/null || true
199 @rm -f $(CT_TOP_DIR)/config 2>/dev/null || true
200 @rm -rf $(CT_TOP_DIR)/config.gen