kconfig/Makefile
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Mar 11 16:14:06 2007 +0000 (2007-03-11)
changeset 18 cc2869cc3121
parent 11 1e91bf61f215
child 19 d80e6dedcc13
permissions -rw-r--r--
Allan Clark <allanc@chickenandporn.com> provided a way to build on host lacking a proper libintl (such as MacOS-X).
Thank you Allan!
     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 ifneq ($(KBUILD_NO_NLS),)
    11 CFLAGS += -DKBUILD_NO_NLS
    12 endif
    13 
    14 menuconfig: $(obj)/mconf
    15 	@$< $(KCONFIG_TOP)
    16 
    17 config: $(obj)/conf
    18 	@$< $(KCONFIG_TOP)
    19 
    20 oldconfig: $(obj)/conf
    21 	@$< -s $(KCONFIG_TOP)
    22 
    23 # Build a list of all available samples
    24 SAMPLES = $(patsubst $(CT_TOP_DIR)/samples/%,%,$(filter-out %Makefile,$(wildcard $(CT_TOP_DIR)/samples/*)))
    25 SAMPLES_CONFIG = $(patsubst %,%_config,$(SAMPLES))
    26 .PHONY: $(SAMPLES_CONFIG)
    27 $(SAMPLES_CONFIG):
    28 	@cp "$(CT_TOP_DIR)/samples/$(patsubst %_config,%,$@)/crosstool.config" "$(CT_TOP_DIR)/.config"
    29 	@$(MAKE) oldconfig
    30 
    31 # Help text used by make help
    32 help::
    33 	@echo  'General purpose configuration targets:'
    34 	@echo  '  config	  - Update current config using a line-oriented program'
    35 	@echo  '  menuconfig	  - Update current config using a menu based program'
    36 	@echo  '  oldconfig	  - Update current config using a provided .config as base'
    37 	@echo
    38 	@echo  'Preconfigured configuration targets:'
    39 	@for s in $(SAMPLES_CONFIG); do   \
    40 	    echo  "  $${s}"; \
    41 	 done
    42 	@echo  ''
    43 
    44 # Cheesy build
    45 
    46 SHIPPED = kconfig/zconf.tab.c kconfig/lex.zconf.c kconfig/zconf.hash.c
    47 
    48 %.c: %.c_shipped
    49 	@ln -s $(notdir $<) $@
    50 
    51 kconfig/mconf: $(SHIPPED) kconfig/mconf.c
    52 	@$(HOST_CC) $(CFLAGS) -o $@ kconfig/{mconf.c,zconf.tab.c,lxdialog/*.c} \
    53 		-lcurses "-DCURSES_LOC=<ncurses.h>"
    54 
    55 kconfig/conf: $(SHIPPED) kconfig/conf.c
    56 	@$(HOST_CC) $(CFLAGS) -o $@ kconfig/{conf.c,zconf.tab.c}
    57 
    58 clean::
    59 	@rm -f $(wildcard kconfig/*zconf*.c) kconfig/{conf,mconf}