2007-02-24 11:00:05 +00:00
|
|
|
# ===========================================================================
|
2007-07-02 19:40:54 +00:00
|
|
|
# crosstool-NG configuration targets
|
2007-02-24 11:00:05 +00:00
|
|
|
# These targets are used from top-level makefile
|
|
|
|
|
2007-06-01 16:55:33 +00:00
|
|
|
# Derive the project version from, well, the project version:
|
|
|
|
export PROJECTVERSION=$(CT_VERSION)
|
|
|
|
|
2007-02-24 11:00:05 +00:00
|
|
|
KCONFIG_TOP = config/config.in
|
2007-07-01 19:04:20 +00:00
|
|
|
obj = $(CT_TOP_DIR)/kconfig
|
2007-07-17 21:44:33 +00:00
|
|
|
PHONY += clean help oldconfig menuconfig config defoldconfig extractconfig
|
2007-02-24 11:00:05 +00:00
|
|
|
|
2007-03-12 18:59:31 +00:00
|
|
|
# Darwin (MacOS-X) does not have proper libintl support
|
|
|
|
ifeq ($(shell uname -s),Darwin)
|
|
|
|
KBUILD_NO_NLS:=1
|
|
|
|
endif
|
|
|
|
|
2007-03-11 16:14:06 +00:00
|
|
|
ifneq ($(KBUILD_NO_NLS),)
|
|
|
|
CFLAGS += -DKBUILD_NO_NLS
|
|
|
|
endif
|
|
|
|
|
2007-05-17 22:10:48 +00:00
|
|
|
# Build a list of all config files
|
2007-07-01 19:04:20 +00:00
|
|
|
DEBUG_CONFIG_FILES = $(shell find $(CT_LIB_DIR)/config/debug -type f -name '*.in')
|
|
|
|
TOOLS_CONFIG_FILES = $(shell find $(CT_LIB_DIR)/config/tools -type f -name '*.in')
|
2007-05-17 22:10:48 +00:00
|
|
|
|
2007-07-01 19:04:20 +00:00
|
|
|
STATIC_CONFIG_FILES = $(shell find $(CT_LIB_DIR)/config -type f -name '*.in')
|
|
|
|
GEN_CONFIG_FILES=$(CT_TOP_DIR)/config.gen/debug.in \
|
|
|
|
$(CT_TOP_DIR)/config.gen/tools.in
|
2007-05-13 19:03:49 +00:00
|
|
|
|
2007-07-01 19:04:20 +00:00
|
|
|
CONFIG_FILES=$(STATIC_CONFIG_FILES) $(GEN_CONFIG_FILES)
|
|
|
|
|
|
|
|
$(GEN_CONFIG_FILES):: $(CT_TOP_DIR)/config.gen
|
|
|
|
|
|
|
|
$(CT_TOP_DIR)/config.gen:
|
|
|
|
@mkdir -p $(CT_TOP_DIR)/config.gen
|
|
|
|
|
|
|
|
$(CT_TOP_DIR)/config.gen/debug.in:: $(DEBUG_CONFIG_FILES)
|
2007-05-17 22:10:48 +00:00
|
|
|
@echo "# Debug facilities menu" >$@
|
|
|
|
@echo "# Generated file, do not edit!!!" >>$@
|
|
|
|
@echo "menu \"Debug facilities\"" >>$@
|
|
|
|
@for f in $(patsubst $(CT_TOP_DIR)/%,%,$(wildcard $(CT_TOP_DIR)/config/debug/*.in)); do \
|
|
|
|
echo "source $${f}"; \
|
|
|
|
done >>$@
|
|
|
|
@echo "endmenu" >>$@
|
|
|
|
|
2007-07-01 19:04:20 +00:00
|
|
|
$(CT_TOP_DIR)/config.gen/tools.in:: $(TOOLS_CONFIG_FILES)
|
2007-06-01 16:55:33 +00:00
|
|
|
@echo "# Tools facilities menu" >$@
|
|
|
|
@echo "# Generated file, do not edit!!!" >>$@
|
|
|
|
@echo "menu \"Tools facilities\"" >>$@
|
|
|
|
@for f in $(patsubst $(CT_TOP_DIR)/%,%,$(wildcard $(CT_TOP_DIR)/config/tools/*.in)); do \
|
|
|
|
echo "source $${f}"; \
|
|
|
|
done >>$@
|
|
|
|
@echo "endmenu" >>$@
|
|
|
|
|
2007-07-17 21:44:33 +00:00
|
|
|
config menuconfig oldconfig defoldconfig extractconfig:: $(KCONFIG_TOP)
|
2007-07-01 19:04:20 +00:00
|
|
|
|
|
|
|
$(KCONFIG_TOP):
|
2007-09-08 10:32:53 +00:00
|
|
|
@ln -sf $(CT_LIB_DIR)/config config
|
2007-07-01 19:04:20 +00:00
|
|
|
|
|
|
|
menuconfig:: $(obj)/mconf $(CONFIG_FILES)
|
2007-02-24 11:00:05 +00:00
|
|
|
@$< $(KCONFIG_TOP)
|
|
|
|
|
2007-07-01 19:04:20 +00:00
|
|
|
config:: $(obj)/conf $(CONFIG_FILES)
|
2007-02-24 11:00:05 +00:00
|
|
|
@$< $(KCONFIG_TOP)
|
|
|
|
|
2007-07-01 19:04:20 +00:00
|
|
|
oldconfig:: $(obj)/conf $(CONFIG_FILES)
|
2007-02-24 11:00:05 +00:00
|
|
|
@$< -s $(KCONFIG_TOP)
|
|
|
|
|
2007-07-01 19:04:20 +00:00
|
|
|
defoldconfig:: $(obj)/conf $(CONFIG_FILES)
|
2007-06-16 20:47:58 +00:00
|
|
|
@yes "" |$< -s $(KCONFIG_TOP) >/dev/null
|
2007-06-16 18:01:59 +00:00
|
|
|
|
2007-07-17 21:44:33 +00:00
|
|
|
extractconfig:: $(obj)/conf $(CONFIG_FILES)
|
|
|
|
@$(CT_LIB_DIR)/tools/extract-config.sh >.config
|
|
|
|
@$< -s $(KCONFIG_TOP)
|
|
|
|
|
2007-02-24 11:00:05 +00:00
|
|
|
# Help text used by make help
|
2007-06-17 16:24:23 +00:00
|
|
|
help-config::
|
2007-08-15 14:59:37 +00:00
|
|
|
@echo ' config - Update current config using a line-oriented program'
|
|
|
|
@echo ' menuconfig - Update current config using a menu based program'
|
|
|
|
@echo ' oldconfig - Update current config using a provided .config as base'
|
|
|
|
@echo ' extractconfig - Create a new config using options extracted from a'
|
|
|
|
@echo ' build log piped into stdin'
|
2007-02-24 11:00:05 +00:00
|
|
|
|
|
|
|
# Cheesy build
|
|
|
|
|
2007-07-22 17:44:27 +00:00
|
|
|
SHIPPED := $(CT_LIB_DIR)/kconfig/zconf.tab.c $(CT_LIB_DIR)/kconfig/lex.zconf.c $(CT_LIB_DIR)/kconfig/zconf.hash.c
|
2007-02-24 11:00:05 +00:00
|
|
|
|
|
|
|
%.c: %.c_shipped
|
|
|
|
@ln -s $(notdir $<) $@
|
|
|
|
|
2007-07-01 19:04:20 +00:00
|
|
|
$(obj)/conf $(obj)/mconf:: $(obj)
|
|
|
|
|
|
|
|
$(obj):
|
|
|
|
@mkdir -p $(obj)
|
|
|
|
|
|
|
|
$(obj)/mconf:: $(SHIPPED) $(CT_LIB_DIR)/kconfig/mconf.c
|
|
|
|
@$(HOST_CC) $(CFLAGS) -o $@ $(CT_LIB_DIR)/kconfig/{mconf.c,zconf.tab.c,lxdialog/*.c} \
|
2007-02-24 11:00:05 +00:00
|
|
|
-lcurses "-DCURSES_LOC=<ncurses.h>"
|
|
|
|
|
2007-07-01 19:04:20 +00:00
|
|
|
$(obj)/conf:: $(SHIPPED) $(CT_LIB_DIR)/kconfig/conf.c
|
|
|
|
@$(HOST_CC) $(CFLAGS) -o $@ $(CT_LIB_DIR)/kconfig/{conf.c,zconf.tab.c}
|
2007-02-24 11:00:05 +00:00
|
|
|
|
|
|
|
clean::
|
2007-07-01 19:04:20 +00:00
|
|
|
@rm -f $(CT_TOP_DIR)/kconfig/{,m}conf
|
2007-07-22 17:44:27 +00:00
|
|
|
@rm -f $(SHIPPED)
|
2007-07-15 08:37:22 +00:00
|
|
|
@rmdir --ignore-fail-on-non-empty $(CT_TOP_DIR)/kconfig 2>/dev/null || true
|
2007-07-22 17:44:27 +00:00
|
|
|
@rm -f $(CT_TOP_DIR)/config 2>/dev/null || true
|
2007-07-01 19:04:20 +00:00
|
|
|
@rm -rf $(CT_TOP_DIR)/config.gen
|