Save the toolchain configuration to its own file, as an auto-extracting shell script:
- get rid of the 'extractconfig' action, it was cumbersome to use, and badly documented,
- introduce a skeleton for the config script,
- update auto-completion,
- document the config script.
/trunk/kconfig/kconfig.mk | 9 2 7 0 ++-------
/trunk/scripts/crosstool.sh | 6 5 1 0 +++++-
/trunk/docs/overview.txt | 21 9 12 0 +++++++++------------
/trunk/tools/toolchain-config.in | 8 8 0 0 ++++++++
/trunk/ct-ng.comp | 2 1 1 0 +-
5 files changed, 25 insertions(+), 21 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)/arch/*/config.in)
23 KERN_CONFIG_FILES = $(wildcard $(CT_LIB_DIR)/config/kernel/*.in)
24 DEBUG_CONFIG_FILES = $(wildcard $(CT_LIB_DIR)/config/debug/*.in)
25 TOOLS_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/debug.in \
31 $(CT_TOP_DIR)/config.gen/tools.in
33 CONFIG_FILES=$(STATIC_CONFIG_FILES) $(GEN_CONFIG_FILES)
36 ARCHS = $(patsubst $(CT_LIB_DIR)/arch/%/config.in,%,$(ARCH_CONFIG_FILES))
37 KERNELS = $(patsubst $(CT_LIB_DIR)/config/kernel/%.in,%,$(KERN_CONFIG_FILES))
39 $(GEN_CONFIG_FILES): $(CT_TOP_DIR)/config.gen \
40 $(CT_LIB_DIR)/kconfig/kconfig.mk
42 $(CT_TOP_DIR)/config.gen: $(KCONFIG_TOP)
43 @mkdir -p $(CT_TOP_DIR)/config.gen
45 $(CT_TOP_DIR)/config.gen/arch.in: $(ARCH_CONFIG_FILES)
46 @echo ' IN config.gen/arch.in'
47 @(echo "# Architectures menu"; \
48 echo "# Generated file, do not edit!!!"; \
50 for arch in $(ARCHS); do \
51 _arch=$$(echo "$${arch}" |sed -r -s -e 's/[-.+]/_/g;'); \
52 echo "config ARCH_$${_arch}"; \
54 printf " prompt \"$${arch}"; \
55 if grep -E '^# +EXPERIMENTAL$$' config/arch/$${arch}/config.in >/dev/null 2>&1; then \
56 echo " (EXPERIMENTAL)\""; \
57 echo " depends on EXPERIMENTAL"; \
61 echo "if ARCH_$${_arch}"; \
63 echo " default \"$${arch}\" if ARCH_$${_arch}"; \
64 echo "source config/arch/$${arch}/config.in"; \
70 $(CT_TOP_DIR)/config.gen/kernel.in: $(KERN_CONFIG_FILES)
71 @echo ' IN config.gen/kernel.in'
72 @(echo "# Kernel menu"; \
73 echo "# Generated file, do not edit!!!"; \
75 for kern in $(KERNELS); do \
76 _kern=$$(echo "$${kern}" |sed -r -s -e 's/[-.+]/_/g;'); \
77 echo "config KERNEL_$${_kern}"; \
79 printf " prompt \"$${kern}"; \
80 if grep -E '^# +EXPERIMENTAL$$' config/kernel/$${kern}.in >/dev/null 2>&1; then \
81 echo " (EXPERIMENTAL)\""; \
82 echo " depends on EXPERIMENTAL"; \
86 echo "if KERNEL_$${_kern}"; \
87 echo "config KERNEL"; \
88 echo " default \"$${kern}\" if KERNEL_$${_kern}"; \
89 echo "source config/kernel/$${kern}.in"; \
95 $(CT_TOP_DIR)/config.gen/debug.in: $(DEBUG_CONFIG_FILES)
96 @echo ' IN config.gen/debug.in'
97 @(echo "# Debug facilities menu"; \
98 echo "# Generated file, do not edit!!!"; \
99 echo "menu \"Debug facilities\""; \
100 for f in $(patsubst $(CT_LIB_DIR)/%,%,$(DEBUG_CONFIG_FILES)); do \
101 echo "source $${f}"; \
106 $(CT_TOP_DIR)/config.gen/tools.in: $(TOOLS_CONFIG_FILES)
107 @echo ' IN config.gen/tools.in'
108 @(echo "# Tools facilities menu"; \
109 echo "# Generated file, do not edit!!!"; \
110 echo "menu \"Tools facilities\""; \
111 for f in $(patsubst $(CT_LIB_DIR)/%,%,$(TOOLS_CONFIG_FILES)); do \
112 echo "source $${f}"; \
117 config menuconfig oldconfig defoldconfig: $(KCONFIG_TOP)
120 @ln -sf $(CT_LIB_DIR)/config config
122 menuconfig: $(CONFIG_FILES) $(obj)/mconf
123 @$(obj)/mconf $(KCONFIG_TOP)
125 config: $(CONFIG_FILES) $(obj)/conf
126 @$(obj)/conf $(KCONFIG_TOP)
128 oldconfig: $(CONFIG_FILES) $(obj)/conf
129 @$(obj)/conf -s $(KCONFIG_TOP)
131 defoldconfig: $(CONFIG_FILES) $(obj)/conf
132 @yes "" |$(obj)/conf -s $(KCONFIG_TOP)
134 # Help text used by make help
136 @echo ' config - Update current config using a line-oriented program'
137 @echo ' menuconfig - Update current config using a menu based program'
138 @echo ' oldconfig - Update current config using a provided .config as base'
139 @echo ' build log piped into stdin'
143 SHIPPED := $(CT_LIB_DIR)/kconfig/zconf.tab.c $(CT_LIB_DIR)/kconfig/lex.zconf.c $(CT_LIB_DIR)/kconfig/zconf.hash.c
145 $(obj)/conf $(obj)/mconf: $(obj)
150 HEADERS = $(CT_LIB_DIR)/kconfig/expr.h \
151 $(CT_LIB_DIR)/kconfig/lkc.h \
152 $(CT_LIB_DIR)/kconfig/lkc_proto.h
154 FILES = $(CT_LIB_DIR)/kconfig/confdata.c \
155 $(CT_LIB_DIR)/kconfig/expr.c \
156 $(CT_LIB_DIR)/kconfig/menu.c \
157 $(CT_LIB_DIR)/kconfig/symbol.c \
158 $(CT_LIB_DIR)/kconfig/util.c
160 $(obj)/mconf: $(SHIPPED) $(CT_LIB_DIR)/kconfig/mconf.c \
161 $(HEADERS) $(FILES) \
162 $(CT_LIB_DIR)/kconfig/kconfig.mk
163 @echo ' LD kconfig/mconf'
164 @$(HOST_CC) $(CFLAGS) -o $@ $(CT_LIB_DIR)/kconfig/{mconf.c,zconf.tab.c,lxdialog/*.c} \
165 $(shell $(CT_LIB_DIR)/kconfig/lxdialog/check-lxdialog.sh -ccflags) \
166 $(shell $(CT_LIB_DIR)/kconfig/lxdialog/check-lxdialog.sh -ldflags $(HOST_CC))
168 $(obj)/conf: $(SHIPPED) $(CT_LIB_DIR)/kconfig/conf.c \
169 $(HEADERS) $(FILES) \
170 $(CT_LIB_DIR)/kconfig/kconfig.mk
171 @echo ' LD kconfig/conf'
172 @$(HOST_CC) $(CFLAGS) -o $@ $(CT_LIB_DIR)/kconfig/{conf.c,zconf.tab.c}
175 @rm -f $(CT_TOP_DIR)/kconfig/{,m}conf
176 @rmdir --ignore-fail-on-non-empty $(CT_TOP_DIR)/kconfig 2>/dev/null || true
177 @rm -f $(CT_TOP_DIR)/config 2>/dev/null || true
178 @rm -rf $(CT_TOP_DIR)/config.gen