diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2008-10-10 14:30:44 +0000 |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2008-10-10 14:30:44 +0000 |
commit | 82c9d1aceb9b59f06f9f16496184ec16133447be (patch) | |
tree | 905f05736a366f07f9cdd191e528732dbb7a3645 /kconfig | |
parent | 1e41bff4aaa8765c8cc63bd3e51a6e82b7275156 (diff) | |
download | crosstool-ng-82c9d1aceb9b59f06f9f16496184ec16133447be.tar.gz crosstool-ng-82c9d1aceb9b59f06f9f16496184ec16133447be.tar.bz2 crosstool-ng-82c9d1aceb9b59f06f9f16496184ec16133447be.zip |
Simplify the Tools and Debug facilities menu entries:
- each config file no longer have to define their own 'menuconfig foo - if FOO - endif' gym
- each build script no longer has to say wether they are enabled
- generation of the 'menuconfig' entries for the Tools and Debug facilities now uses the same code
Some re-ordering of the code to be consistent with the steps ordering (tools, then debug).
/trunk/kconfig/kconfig.mk | 66 43 23 0 +++++++++++++++++++++++-------------
/trunk/scripts/build/debug.sh | 14 9 5 0 +++++---
/trunk/scripts/build/tools/000-template.sh | 7 0 7 0 ----
/trunk/scripts/build/tools/100-libelf.sh | 3 0 3 0 --
/trunk/scripts/build/tools/200-sstrip.sh | 2 0 2 0 -
/trunk/scripts/build/debug/000-template.sh | 7 0 7 0 ----
/trunk/scripts/build/debug/100-dmalloc.sh | 3 0 3 0 --
/trunk/scripts/build/debug/400-ltrace.sh | 3 0 3 0 --
/trunk/scripts/build/debug/300-gdb.sh | 3 0 3 0 --
/trunk/scripts/build/debug/500-strace.sh | 3 0 3 0 --
/trunk/scripts/build/debug/200-duma.sh | 3 0 3 0 --
/trunk/scripts/build/tools.sh | 14 9 5 0 +++++---
/trunk/scripts/crosstool.sh | 2 1 1 0
/trunk/config/debug/ltrace.in | 14 3 11 0 ++------
/trunk/config/debug/dmalloc.in | 9 1 8 0 +----
/trunk/config/debug/gdb.in | 9 1 8 0 +----
/trunk/config/debug/strace.in | 10 1 9 0 -----
/trunk/config/debug/duma.in | 10 1 9 0 -----
/trunk/config/tools/libelf.in | 12 2 10 0 +------
/trunk/config/tools/sstrip.in | 10 1 9 0 -----
/trunk/config/config.in | 4 2 2 0 +-
21 files changed, 74 insertions(+), 134 deletions(-)
Diffstat (limited to 'kconfig')
-rw-r--r-- | kconfig/kconfig.mk | 66 |
1 files changed, 43 insertions, 23 deletions
diff --git a/kconfig/kconfig.mk b/kconfig/kconfig.mk index 50398c29..701b4358 100644 --- a/kconfig/kconfig.mk +++ b/kconfig/kconfig.mk @@ -22,19 +22,21 @@ endif ARCH_CONFIG_FILES = $(wildcard $(CT_LIB_DIR)/config/arch/*.in) KERNEL_CONFIG_FILES = $(wildcard $(CT_LIB_DIR)/config/kernel/*.in) DEBUG_CONFIG_FILES = $(wildcard $(CT_LIB_DIR)/config/debug/*.in) -TOOLS_CONFIG_FILES = $(wildcard $(CT_LIB_DIR)/config/tools/*.in) +TOOL_CONFIG_FILES = $(wildcard $(CT_LIB_DIR)/config/tools/*.in) STATIC_CONFIG_FILES = $(shell find $(CT_LIB_DIR)/config -type f -name '*.in') -GEN_CONFIG_FILES=$(CT_TOP_DIR)/config.gen/arch.in \ - $(CT_TOP_DIR)/config.gen/kernel.in \ - $(CT_TOP_DIR)/config.gen/debug.in \ - $(CT_TOP_DIR)/config.gen/tools.in +GEN_CONFIG_FILES=$(CT_TOP_DIR)/config.gen/arch.in \ + $(CT_TOP_DIR)/config.gen/kernel.in \ + $(CT_TOP_DIR)/config.gen/tools.in \ + $(CT_TOP_DIR)/config.gen/debug.in CONFIG_FILES=$(STATIC_CONFIG_FILES) $(GEN_CONFIG_FILES) # Build list of items ARCHS = $(patsubst $(CT_LIB_DIR)/config/arch/%.in,%,$(ARCH_CONFIG_FILES)) KERNELS = $(patsubst $(CT_LIB_DIR)/config/kernel/%.in,%,$(KERNEL_CONFIG_FILES)) +DEBUGS = $(patsubst $(CT_LIB_DIR)/config/debug/%.in,%,$(DEBUG_CONFIG_FILES)) +TOOLS = $(patsubst $(CT_LIB_DIR)/config/tools/%.in,%,$(TOOL_CONFIG_FILES)) $(GEN_CONFIG_FILES): $(CT_TOP_DIR)/config.gen \ $(CT_LIB_DIR)/kconfig/kconfig.mk @@ -84,27 +86,45 @@ $(CT_TOP_DIR)/config.gen/arch.in: $(ARCH_CONFIG_FILES) $(CT_TOP_DIR)/config.gen/kernel.in: $(KERNEL_CONFIG_FILES) $(call build_gen_choice_in,$(patsubst $(CT_TOP_DIR)/%,%,$@),Kernel,KERNEL,config/kernel,$(KERNELS)) -$(CT_TOP_DIR)/config.gen/debug.in: $(DEBUG_CONFIG_FILES) - @echo ' IN config.gen/debug.in' - @(echo "# Debug facilities menu"; \ +# Function build_gen_menu_in: +# $1 : destination file +# $2 : name of entries family (eg. Tools, Debug...) +# $3 : prefix for the menu entries (eg. TOOL, DEBUG) +# $4 : base directory containing config files +# $5 : list of config entries (eg. for tools: "libelf sstrip"..., and for +# debug: "dmalloc duma gdb"...) +# Example to build the tools generated config file: +# $(call build_gen_menu_in,config.gen/tools.in,Tools,TOOL,config/tools,$(TOOLS)) +define build_gen_menu_in + @echo ' IN $(1)' + @(echo "# $(2) facilities menu"; \ echo "# Generated file, do not edit!!!"; \ - echo "menu \"Debug facilities\""; \ - for f in $(patsubst $(CT_LIB_DIR)/%,%,$(DEBUG_CONFIG_FILES)); do \ - echo "source $${f}"; \ + echo ""; \ + for entry in $(5); do \ + file="$(4)/$${entry}.in"; \ + _entry=$$(echo "$${entry}" |sed -r -s -e 's/[-.+]/_/g;'); \ + echo "menuconfig $(3)_$${_entry}"; \ + echo " bool"; \ + printf " prompt \"$${entry}"; \ + if grep -E '^# +EXPERIMENTAL$$' $${file} >/dev/null 2>&1; then \ + echo " (EXPERIMENTAL)\""; \ + echo " depends on EXPERIMENTAL"; \ + else \ + echo "\""; \ + fi; \ + echo "if $(3)_$${_entry}"; \ + echo "source $${file}"; \ + echo "endif"; \ + echo ""; \ done; \ - echo "endmenu"; \ - ) >$@ + ) >$(1) +endef -$(CT_TOP_DIR)/config.gen/tools.in: $(TOOLS_CONFIG_FILES) - @echo ' IN config.gen/tools.in' - @(echo "# Tools facilities menu"; \ - echo "# Generated file, do not edit!!!"; \ - echo "menu \"Tools facilities\""; \ - for f in $(patsubst $(CT_LIB_DIR)/%,%,$(TOOLS_CONFIG_FILES)); do \ - echo "source $${f}"; \ - done; \ - echo "endmenu"; \ - ) >$@ +$(CT_TOP_DIR)/config.gen/tools.in: $(TOOL_CONFIG_FILES) + $(call build_gen_menu_in,$(patsubst $(CT_TOP_DIR)/%,%,$@),Tools,TOOL,config/tools,$(TOOLS)) + +$(CT_TOP_DIR)/config.gen/debug.in: $(DEBUG_CONFIG_FILES) + $(call build_gen_menu_in,$(patsubst $(CT_TOP_DIR)/%,%,$@),Debug,DEBUG,config/debug,$(DEBUGS)) config menuconfig oldconfig defoldconfig: $(KCONFIG_TOP) |