kconfig/Makefile
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Fri Jun 01 16:55:33 2007 +0000 (2007-06-01)
changeset 148 567f1673d59d
parent 97 63a30dd47eb8
child 159 6daa8b5df1b4
permissions -rw-r--r--
Introduce the notion of tols facilities (none so far, sstrip coming right away...).
     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 .PHONY: generated_config_files
    28 generated_config_files: $(CT_TOP_DIR)/config/debug.in	\
    29 						$(CT_TOP_DIR)/config/tools.in
    30 
    31 $(CT_TOP_DIR)/config/debug.in: $(DEBUG_CONFIG_FILES)
    32 	@echo "# Debug facilities menu" >$@
    33 	@echo "# Generated file, do not edit!!!" >>$@
    34 	@echo "menu \"Debug facilities\"" >>$@
    35 	@for f in $(patsubst $(CT_TOP_DIR)/%,%,$(wildcard $(CT_TOP_DIR)/config/debug/*.in)); do \
    36 	     echo "source $${f}";                                                               \
    37 	 done >>$@
    38 	@echo "endmenu" >>$@
    39 
    40 $(CT_TOP_DIR)/config/tools.in: $(TOOLS_CONFIG_FILES)
    41 	@echo "# Tools facilities menu" >$@
    42 	@echo "# Generated file, do not edit!!!" >>$@
    43 	@echo "menu \"Tools facilities\"" >>$@
    44 	@for f in $(patsubst $(CT_TOP_DIR)/%,%,$(wildcard $(CT_TOP_DIR)/config/tools/*.in)); do \
    45 	     echo "source $${f}";                                                               \
    46 	 done >>$@
    47 	@echo "endmenu" >>$@
    48 
    49 menuconfig: $(obj)/mconf generated_config_files
    50 	@$< $(KCONFIG_TOP)
    51 
    52 config: $(obj)/conf generated_config_files
    53 	@$< $(KCONFIG_TOP)
    54 
    55 oldconfig: $(obj)/conf generated_config_files
    56 	@$< -s $(KCONFIG_TOP)
    57 
    58 # Help text used by make help
    59 help::
    60 	@echo  'General purpose configuration targets:'
    61 	@echo  '  config         - Update current config using a line-oriented program'
    62 	@echo  '  menuconfig     - Update current config using a menu based program'
    63 	@echo  '  oldconfig      - Update current config using a provided .config as base'
    64 	@# saveconfig is listed here for homogeneity, but implemented in samples/Makefile
    65 	@echo  '  saveconfig     - Save current config as a preconfigured target'
    66 	@echo  ''
    67 
    68 # Cheesy build
    69 
    70 SHIPPED = kconfig/zconf.tab.c kconfig/lex.zconf.c kconfig/zconf.hash.c
    71 
    72 %.c: %.c_shipped
    73 	@ln -s $(notdir $<) $@
    74 
    75 kconfig/mconf: $(SHIPPED) kconfig/mconf.c
    76 	@$(HOST_CC) $(CFLAGS) -o $@ kconfig/{mconf.c,zconf.tab.c,lxdialog/*.c} \
    77 		-lcurses "-DCURSES_LOC=<ncurses.h>"
    78 
    79 kconfig/conf: $(SHIPPED) kconfig/conf.c
    80 	@$(HOST_CC) $(CFLAGS) -o $@ kconfig/{conf.c,zconf.tab.c}
    81 
    82 clean::
    83 	@rm -f $(wildcard kconfig/*zconf*.c) kconfig/{conf,mconf}
    84 	@rm -f "$(CT_TOP_DIR)/config/debug.in" "$(CT_TOP_DIR)/config/tools.in"