kconfig/kconfig.mk
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Thu Oct 09 19:17:49 2008 +0000 (2008-10-09)
changeset 914 0b164a321177
parent 903 9fb0f81b4416
child 916 68af6b83ff7e
permissions -rw-r--r--
Remove CT_BROKEN.
Only one component is actually BROKEN (libelf), make it depend on EXPERIMENTAL, but state BROKEN in the prompt.
ltrace (which depends on libelf) is now marked as EXPERIMENTAL, with the reference to the BROKEN libelf in the help entry.

/trunk/docs/overview.txt | 6 0 6 0 ------
/trunk/config/debug/ltrace.in | 7 4 3 0 ++++---
/trunk/config/global/ct-behave.in | 8 0 8 0 --------
/trunk/config/tools/libelf.in | 5 3 2 0 +++--
4 files changed, 7 insertions(+), 19 deletions(-)
     1 # ===========================================================================
     2 # crosstool-NG configuration targets
     3 # These targets are used from top-level makefile
     4 
     5 # Derive the project version from, well, the project version:
     6 export PROJECTVERSION=$(CT_VERSION)
     7 
     8 KCONFIG_TOP = config/config.in
     9 obj = $(CT_TOP_DIR)/kconfig
    10 PHONY += clean help oldconfig menuconfig config defoldconfig
    11 
    12 # Darwin (MacOS-X) does not have proper libintl support
    13 ifeq ($(shell uname -s),Darwin)
    14 KBUILD_NO_NLS:=1
    15 endif
    16 
    17 ifneq ($(KBUILD_NO_NLS),)
    18 CFLAGS += -DKBUILD_NO_NLS
    19 endif
    20 
    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 TOOLS_CONFIG_FILES  = $(wildcard $(CT_LIB_DIR)/config/tools/*.in)
    26 
    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
    32 
    33 CONFIG_FILES=$(STATIC_CONFIG_FILES) $(GEN_CONFIG_FILES)
    34 
    35 # Build list of items
    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 
    39 $(GEN_CONFIG_FILES): $(CT_TOP_DIR)/config.gen           \
    40                      $(CT_LIB_DIR)/kconfig/kconfig.mk
    41 
    42 $(CT_TOP_DIR)/config.gen: $(KCONFIG_TOP)
    43 	@mkdir -p $(CT_TOP_DIR)/config.gen
    44 
    45 # Function build_gen_choice_in:
    46 # $1 : destination file
    47 # $2 : name for the entries family (eg. Architecture, kernel...)
    48 # $3 : prefix for the choice entries (eg. ARCH, KERNEL...)
    49 # $4 : base directory containing config files
    50 # $5 : list of config entries (eg. for architectures: "alpha arm ia64"...,
    51 #      and for kernels: "bare-metal linux"...)
    52 # Example to build the kernels generated config file:
    53 # $(call build_gen_choice_in,config.gen/kernel.in,Kernel,KERNEL,config/kernel,$(KERNELS))
    54 define build_gen_choice_in
    55 	@echo '  IN   $(1)'
    56 	@(echo "# $(2) menu";                                                               \
    57 	  echo "# Generated file, do not edit!!!";                                          \
    58 	  echo "";                                                                          \
    59 	  for entry in $(5); do                                                             \
    60 	    file="$(4)/$${entry}.in";                                                       \
    61 	    _entry=$$(echo "$${entry}" |sed -r -s -e 's/[-.+]/_/g;');                       \
    62 	    echo "config $(3)_$${_entry}";                                                  \
    63 	    echo "    bool";                                                                \
    64 	    printf "    prompt \"$${entry}";                                                \
    65 	    if grep -E '^# +EXPERIMENTAL$$' $${file} >/dev/null 2>&1; then                  \
    66 	      echo " (EXPERIMENTAL)\"";                                                     \
    67 	      echo "    depends on EXPERIMENTAL";                                           \
    68 	    else                                                                            \
    69 	      echo "\"";                                                                    \
    70 	    fi;                                                                             \
    71 	    echo "if $(3)_$${_entry}";                                                      \
    72 	    echo "config $(3)";                                                             \
    73 	    echo "    default \"$${entry}\" if $(3)_$${_entry}";                            \
    74 	    echo "source $${file}";                                                         \
    75 	    echo "endif";                                                                   \
    76 	    echo "";                                                                        \
    77 	  done;                                                                             \
    78 	 ) >$(1)
    79 endef
    80 
    81 $(CT_TOP_DIR)/config.gen/arch.in: $(ARCH_CONFIG_FILES)
    82 	$(call build_gen_choice_in,$(patsubst $(CT_TOP_DIR)/%,%,$@),Architecture,ARCH,config/arch,$(ARCHS))
    83 
    84 $(CT_TOP_DIR)/config.gen/kernel.in: $(KERNEL_CONFIG_FILES)
    85 	$(call build_gen_choice_in,$(patsubst $(CT_TOP_DIR)/%,%,$@),Kernel,KERNEL,config/kernel,$(KERNELS))
    86 
    87 $(CT_TOP_DIR)/config.gen/debug.in: $(DEBUG_CONFIG_FILES)
    88 	@echo '  IN   config.gen/debug.in'
    89 	@(echo "# Debug facilities menu";                                   \
    90 	  echo "# Generated file, do not edit!!!";                          \
    91 	  echo "menu \"Debug facilities\"";                                 \
    92 	  for f in $(patsubst $(CT_LIB_DIR)/%,%,$(DEBUG_CONFIG_FILES)); do  \
    93 	     echo "source $${f}";                                           \
    94 	  done;                                                             \
    95 	  echo "endmenu";                                                   \
    96 	 ) >$@
    97 
    98 $(CT_TOP_DIR)/config.gen/tools.in: $(TOOLS_CONFIG_FILES)
    99 	@echo '  IN   config.gen/tools.in'
   100 	@(echo "# Tools facilities menu";                                   \
   101 	  echo "# Generated file, do not edit!!!";                          \
   102 	  echo "menu \"Tools facilities\"";                                 \
   103 	  for f in $(patsubst $(CT_LIB_DIR)/%,%,$(TOOLS_CONFIG_FILES)); do  \
   104 	     echo "source $${f}";                                           \
   105 	  done;                                                             \
   106 	  echo "endmenu";                                                   \
   107 	 ) >$@
   108 
   109 config menuconfig oldconfig defoldconfig: $(KCONFIG_TOP)
   110 
   111 $(KCONFIG_TOP):
   112 	@ln -sf $(CT_LIB_DIR)/config config
   113 
   114 menuconfig: $(CONFIG_FILES) $(obj)/mconf
   115 	@$(obj)/mconf $(KCONFIG_TOP)
   116 
   117 config: $(CONFIG_FILES) $(obj)/conf
   118 	@$(obj)/conf $(KCONFIG_TOP)
   119 
   120 oldconfig: $(CONFIG_FILES) $(obj)/conf
   121 	@$(obj)/conf -s $(KCONFIG_TOP)
   122 
   123 defoldconfig: $(CONFIG_FILES) $(obj)/conf
   124 	@yes "" |$(obj)/conf -s $(KCONFIG_TOP)
   125 
   126 # Help text used by make help
   127 help-config::
   128 	@echo  '  config             - Update current config using a line-oriented program'
   129 	@echo  '  menuconfig         - Update current config using a menu based program'
   130 	@echo  '  oldconfig          - Update current config using a provided .config as base'
   131 	@echo  '                       build log piped into stdin'
   132 
   133 # Cheesy build
   134 
   135 SHIPPED := $(CT_LIB_DIR)/kconfig/zconf.tab.c $(CT_LIB_DIR)/kconfig/lex.zconf.c $(CT_LIB_DIR)/kconfig/zconf.hash.c
   136 
   137 $(obj)/conf $(obj)/mconf: $(obj)
   138 
   139 $(obj):
   140 	@mkdir -p $(obj)
   141 
   142 HEADERS = $(CT_LIB_DIR)/kconfig/expr.h      \
   143           $(CT_LIB_DIR)/kconfig/lkc.h       \
   144           $(CT_LIB_DIR)/kconfig/lkc_proto.h
   145 
   146 FILES = $(CT_LIB_DIR)/kconfig/confdata.c    \
   147         $(CT_LIB_DIR)/kconfig/expr.c        \
   148         $(CT_LIB_DIR)/kconfig/menu.c        \
   149         $(CT_LIB_DIR)/kconfig/symbol.c      \
   150         $(CT_LIB_DIR)/kconfig/util.c
   151 
   152 $(obj)/mconf: $(SHIPPED) $(CT_LIB_DIR)/kconfig/mconf.c  \
   153               $(HEADERS) $(FILES)                       \
   154               $(CT_LIB_DIR)/kconfig/kconfig.mk
   155 	@echo '  LD   kconfig/mconf'
   156 	@$(HOST_CC) $(CFLAGS) -o $@ $(CT_LIB_DIR)/kconfig/{mconf.c,zconf.tab.c,lxdialog/*.c} \
   157 	     $(shell $(CT_LIB_DIR)/kconfig/lxdialog/check-lxdialog.sh -ccflags)              \
   158 	     $(shell $(CT_LIB_DIR)/kconfig/lxdialog/check-lxdialog.sh -ldflags $(HOST_CC))
   159 
   160 $(obj)/conf: $(SHIPPED) $(CT_LIB_DIR)/kconfig/conf.c    \
   161              $(HEADERS) $(FILES)                        \
   162              $(CT_LIB_DIR)/kconfig/kconfig.mk
   163 	@echo '  LD   kconfig/conf'
   164 	@$(HOST_CC) $(CFLAGS) -o $@ $(CT_LIB_DIR)/kconfig/{conf.c,zconf.tab.c}
   165 
   166 clean::
   167 	@rm -f $(CT_TOP_DIR)/kconfig/{,m}conf
   168 	@rmdir --ignore-fail-on-non-empty $(CT_TOP_DIR)/kconfig 2>/dev/null || true
   169 	@rm -f $(CT_TOP_DIR)/config 2>/dev/null || true
   170 	@rm -rf $(CT_TOP_DIR)/config.gen