kconfig/Makefile
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue May 01 16:49:15 2007 +0000 (2007-05-01)
changeset 56 07a6a48962b7
parent 19 d80e6dedcc13
child 63 89b41dbffe8d
permissions -rw-r--r--
Merge patches sent by Robert P. J. Day <rpjday@mindspring.com>.
Warning: the buildroot folks purposedly removed the skip-comment patch but didn't really said why. Keeping it for the sake of having it in svn just in case (removing it will be easier thant not having it at all).
     1 # ===========================================================================
     2 # crosstool-ng configuration targets
     3 # These targets are used from top-level makefile
     4 
     5 KCONFIG_TOP = config/config.in
     6 obj = ./kconfig
     7 PHONY += clean help oldconfig menuconfig config silentoldconfig \
     8 	randconfig allyesconfig allnoconfig allmodconfig defconfig
     9 
    10 # Darwin (MacOS-X) does not have proper libintl support
    11 ifeq ($(shell uname -s),Darwin)
    12 KBUILD_NO_NLS:=1
    13 endif
    14 
    15 ifneq ($(KBUILD_NO_NLS),)
    16 CFLAGS += -DKBUILD_NO_NLS
    17 endif
    18 
    19 menuconfig: $(obj)/mconf
    20 	@$< $(KCONFIG_TOP)
    21 
    22 config: $(obj)/conf
    23 	@$< $(KCONFIG_TOP)
    24 
    25 oldconfig: $(obj)/conf
    26 	@$< -s $(KCONFIG_TOP)
    27 
    28 # Build a list of all available samples
    29 SAMPLES = $(patsubst $(CT_TOP_DIR)/samples/%,%,$(filter-out %Makefile,$(wildcard $(CT_TOP_DIR)/samples/*)))
    30 .PHONY: $(SAMPLES)
    31 $(SAMPLES):
    32 	@cp "$(CT_TOP_DIR)/samples/$(@)/crosstool.config" "$(CT_TOP_DIR)/.config"
    33 	@$(MAKE) oldconfig
    34 
    35 # Help text used by make help
    36 help::
    37 	@echo  'General purpose configuration targets:'
    38 	@echo  '  config         - Update current config using a line-oriented program'
    39 	@echo  '  menuconfig     - Update current config using a menu based program'
    40 	@echo  '  oldconfig      - Update current config using a provided .config as base'
    41 	@echo
    42 	@echo  'Preconfigured targets:'
    43 	@for s in $(SAMPLES); do   \
    44 	    echo  "  $${s}"; \
    45 	 done
    46 	@echo  ''
    47 
    48 # Cheesy build
    49 
    50 SHIPPED = kconfig/zconf.tab.c kconfig/lex.zconf.c kconfig/zconf.hash.c
    51 
    52 %.c: %.c_shipped
    53 	@ln -s $(notdir $<) $@
    54 
    55 kconfig/mconf: $(SHIPPED) kconfig/mconf.c
    56 	@$(HOST_CC) $(CFLAGS) -o $@ kconfig/{mconf.c,zconf.tab.c,lxdialog/*.c} \
    57 		-lcurses "-DCURSES_LOC=<ncurses.h>"
    58 
    59 kconfig/conf: $(SHIPPED) kconfig/conf.c
    60 	@$(HOST_CC) $(CFLAGS) -o $@ kconfig/{conf.c,zconf.tab.c}
    61 
    62 clean::
    63 	@rm -f $(wildcard kconfig/*zconf*.c) kconfig/{conf,mconf}