kconfig/kconfig.mk
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue Jul 22 13:29:08 2008 +0000 (2008-07-22)
changeset 710 021546adce69
parent 628 87802cb25a0f
child 816 0a0a4779f35e
permissions -rw-r--r--
Allow selecting 'latest' snapshot, as well as 'specific' date snapshot for glibc.
Update uClibc config to commonalise some help.

/trunk/scripts/build/libc_glibc.sh | 22 20 2 0 ++++++++++++++++++++--
/trunk/config/libc/glibc.in | 12 12 0 0 ++++++++++++
/trunk/config/libc/uClibc.in | 12 4 8 0 ++++--------
/trunk/config/libc.in | 13 13 0 0 +++++++++++++
4 files changed, 49 insertions(+), 10 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 extractconfig
    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 ARCHS              = $(patsubst $(CT_LIB_DIR)/arch/%,%,$(wildcard $(CT_LIB_DIR)/arch/*))
    23 ARCH_CONFIG_FILE   = $(wildcard $(CT_LIB_DIR)/arch/*/*.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/debug.in	\
    30 				 $(CT_TOP_DIR)/config.gen/tools.in
    31 
    32 CONFIG_FILES=$(STATIC_CONFIG_FILES) $(GEN_CONFIG_FILES)
    33 
    34 $(GEN_CONFIG_FILES):: $(CT_TOP_DIR)/config.gen
    35 
    36 $(CT_TOP_DIR)/config.gen:
    37 	@mkdir -p $(CT_TOP_DIR)/config.gen
    38 
    39 $(CT_TOP_DIR)/config.gen/arch.in:: $(ARCH_CONFIG_FILES)
    40 	@(echo "# Architectures menu";                                              \
    41 	  echo "# Generated file, do not edit!!!";                                  \
    42 	  echo "";                                                                  \
    43 	  for arch in $(ARCHS); do                                                  \
    44 	    echo "config ARCH_$${arch}";                                            \
    45 	    echo "    bool";                                                        \
    46 	    printf "    prompt \"$${arch}";                                         \
    47 	    if [ -f $(CT_LIB_DIR)/arch/$${arch}/experimental ]; then                \
    48 	      echo " (EXPERIMENTAL)\"";                                             \
    49 	      echo "    depends on EXPERIMENTAL";                                   \
    50 	    else                                                                    \
    51 	      echo "\"";                                                            \
    52 	    fi;                                                                     \
    53 	    echo "if ARCH_$${arch}";                                                \
    54 	    echo "config ARCH";                                                     \
    55 	    echo "    default \"$${arch}\" if ARCH_$${arch}";                       \
    56 	    echo "source config/arch/$${arch}/config.in";                           \
    57 	    echo "endif";                                                           \
    58 	    echo "";                                                                \
    59 	  done;                                                                     \
    60 	) >$@
    61 
    62 $(CT_TOP_DIR)/config.gen/debug.in:: $(DEBUG_CONFIG_FILES)
    63 	@echo "# Debug facilities menu" >$@
    64 	@echo "# Generated file, do not edit!!!" >>$@
    65 	@echo "menu \"Debug facilities\"" >>$@
    66 	@for f in $(patsubst $(CT_TOP_DIR)/%,%,$(wildcard $(CT_TOP_DIR)/config/debug/*.in)); do \
    67 	     echo "source $${f}";                                                               \
    68 	 done >>$@
    69 	@echo "endmenu" >>$@
    70 
    71 $(CT_TOP_DIR)/config.gen/tools.in:: $(TOOLS_CONFIG_FILES)
    72 	@echo "# Tools facilities menu" >$@
    73 	@echo "# Generated file, do not edit!!!" >>$@
    74 	@echo "menu \"Tools facilities\"" >>$@
    75 	@for f in $(patsubst $(CT_TOP_DIR)/%,%,$(wildcard $(CT_TOP_DIR)/config/tools/*.in)); do \
    76 	     echo "source $${f}";                                                               \
    77 	 done >>$@
    78 	@echo "endmenu" >>$@
    79 
    80 config menuconfig oldconfig defoldconfig extractconfig:: $(KCONFIG_TOP)
    81 
    82 $(KCONFIG_TOP):
    83 	@ln -sf $(CT_LIB_DIR)/config config
    84 
    85 menuconfig:: $(obj)/mconf $(CONFIG_FILES)
    86 	@$< $(KCONFIG_TOP)
    87 
    88 config:: $(obj)/conf $(CONFIG_FILES)
    89 	@$< $(KCONFIG_TOP)
    90 
    91 oldconfig:: $(obj)/conf $(CONFIG_FILES)
    92 	@$< -s $(KCONFIG_TOP)
    93 
    94 defoldconfig:: $(obj)/conf $(CONFIG_FILES)
    95 	@yes "" |$< -s $(KCONFIG_TOP) >/dev/null
    96 
    97 extractconfig:: $(obj)/conf $(CONFIG_FILES)
    98 	@$(CT_LIB_DIR)/tools/extract-config.sh >.config
    99 	@$< -s $(KCONFIG_TOP)
   100 
   101 # Help text used by make help
   102 help-config::
   103 	@echo  '  config             - Update current config using a line-oriented program'
   104 	@echo  '  menuconfig         - Update current config using a menu based program'
   105 	@echo  '  oldconfig          - Update current config using a provided .config as base'
   106 	@echo  '  extractconfig      - Create a new config using options extracted from a'
   107 	@echo  '                       build log piped into stdin'
   108 
   109 # Cheesy build
   110 
   111 SHIPPED := $(CT_LIB_DIR)/kconfig/zconf.tab.c $(CT_LIB_DIR)/kconfig/lex.zconf.c $(CT_LIB_DIR)/kconfig/zconf.hash.c
   112 
   113 %.c: %.c_shipped
   114 	@ln -s $(notdir $<) $@
   115 
   116 $(obj)/conf $(obj)/mconf:: $(obj)
   117 
   118 $(obj):
   119 	@mkdir -p $(obj)
   120 
   121 $(obj)/mconf:: $(SHIPPED) $(CT_LIB_DIR)/kconfig/mconf.c
   122 	@$(HOST_CC) $(CFLAGS) -o $@ $(CT_LIB_DIR)/kconfig/{mconf.c,zconf.tab.c,lxdialog/*.c} \
   123 	     $(shell $(CT_LIB_DIR)/kconfig/lxdialog/check-lxdialog.sh -ccflags)              \
   124 	     $(shell $(CT_LIB_DIR)/kconfig/lxdialog/check-lxdialog.sh -ldflags $(HOST_CC))
   125 
   126 $(obj)/conf:: $(SHIPPED) $(CT_LIB_DIR)/kconfig/conf.c
   127 	@$(HOST_CC) $(CFLAGS) -o $@ $(CT_LIB_DIR)/kconfig/{conf.c,zconf.tab.c}
   128 
   129 clean::
   130 	@rm -f $(CT_TOP_DIR)/kconfig/{,m}conf
   131 	@rm -f $(SHIPPED)
   132 	@rmdir --ignore-fail-on-non-empty $(CT_TOP_DIR)/kconfig 2>/dev/null || true
   133 	@rm -f $(CT_TOP_DIR)/config 2>/dev/null || true
   134 	@rm -rf $(CT_TOP_DIR)/config.gen