kconfig/Makefile
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jun 17 16:24:23 2007 +0000 (2007-06-17)
changeset 176 59676cfb4ada
parent 163 ade268f78fdc
child 182 223c84ec2d90
permissions -rw-r--r--
Rework the help system. For now, this is mostly a no-op (it only re-organise the help entries), but later, that may come in handy when we want ct-ng to be installable).
     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 = ./kconfig
    10 PHONY += clean help oldconfig menuconfig config silentoldconfig \
    11 	randconfig allyesconfig allnoconfig allmodconfig defconfig
    12 
    13 # Darwin (MacOS-X) does not have proper libintl support
    14 ifeq ($(shell uname -s),Darwin)
    15 KBUILD_NO_NLS:=1
    16 endif
    17 
    18 ifneq ($(KBUILD_NO_NLS),)
    19 CFLAGS += -DKBUILD_NO_NLS
    20 endif
    21 
    22 # Build a list of all config files
    23 CONFIG_FILES = $(filter-out %debug.in,$(shell find $(CT_TOP_DIR)/config -type f -name '*.in'))
    24 DEBUG_CONFIG_FILES = $(shell find $(CT_TOP_DIR)/config/debug -type f -name '*.in')
    25 TOOLS_CONFIG_FILES = $(shell find $(CT_TOP_DIR)/config/tools -type f -name '*.in')
    26 
    27 GEN_CONFIG_FILES=$(CT_TOP_DIR)/config/debug.in	\
    28 				 $(CT_TOP_DIR)/config/tools.in
    29 
    30 $(CT_TOP_DIR)/config/debug.in: $(DEBUG_CONFIG_FILES)
    31 	@echo "# Debug facilities menu" >$@
    32 	@echo "# Generated file, do not edit!!!" >>$@
    33 	@echo "menu \"Debug facilities\"" >>$@
    34 	@for f in $(patsubst $(CT_TOP_DIR)/%,%,$(wildcard $(CT_TOP_DIR)/config/debug/*.in)); do \
    35 	     echo "source $${f}";                                                               \
    36 	 done >>$@
    37 	@echo "endmenu" >>$@
    38 
    39 $(CT_TOP_DIR)/config/tools.in: $(TOOLS_CONFIG_FILES)
    40 	@echo "# Tools facilities menu" >$@
    41 	@echo "# Generated file, do not edit!!!" >>$@
    42 	@echo "menu \"Tools facilities\"" >>$@
    43 	@for f in $(patsubst $(CT_TOP_DIR)/%,%,$(wildcard $(CT_TOP_DIR)/config/tools/*.in)); do \
    44 	     echo "source $${f}";                                                               \
    45 	 done >>$@
    46 	@echo "endmenu" >>$@
    47 
    48 menuconfig: $(obj)/mconf $(GEN_CONFIG_FILES)
    49 	@$< $(KCONFIG_TOP)
    50 
    51 config: $(obj)/conf $(GEN_CONFIG_FILES)
    52 	@$< $(KCONFIG_TOP)
    53 
    54 oldconfig: $(obj)/conf $(GEN_CONFIG_FILES)
    55 	@$< -s $(KCONFIG_TOP)
    56 
    57 defoldconfig:$(obj)/conf $(GEN_CONFIG_FILES)
    58 	@yes "" |$< -s $(KCONFIG_TOP) >/dev/null
    59 
    60 # Help text used by make help
    61 help-config::
    62 	@echo  '  config         - Update current config using a line-oriented program'
    63 	@echo  '  menuconfig     - Update current config using a menu based program'
    64 	@echo  '  oldconfig      - Update current config using a provided .config as base'
    65 
    66 # Cheesy build
    67 
    68 SHIPPED = kconfig/zconf.tab.c kconfig/lex.zconf.c kconfig/zconf.hash.c
    69 
    70 %.c: %.c_shipped
    71 	@ln -s $(notdir $<) $@
    72 
    73 kconfig/mconf: $(SHIPPED) kconfig/mconf.c
    74 	@$(HOST_CC) $(CFLAGS) -o $@ kconfig/{mconf.c,zconf.tab.c,lxdialog/*.c} \
    75 		-lcurses "-DCURSES_LOC=<ncurses.h>"
    76 
    77 kconfig/conf: $(SHIPPED) kconfig/conf.c
    78 	@$(HOST_CC) $(CFLAGS) -o $@ kconfig/{conf.c,zconf.tab.c}
    79 
    80 clean::
    81 	@rm -f $(wildcard kconfig/*zconf*.c) kconfig/{conf,mconf}
    82 	@rm -f $(GEN_CONFIG_FILES)