kconfig/Makefile
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Feb 24 11:00:05 2007 +0000 (2007-02-24)
changeset 1 eeea35fbf182
child 2 687f86f2a01c
permissions -rw-r--r--
Add the full crosstool-NG sources to the new repository of its own.
You might just say: 'Yeah! crosstool-NG's got its own repo!".
Unfortunately, that's because the previous repo got damaged beyond repair and I had no backup.
That means I'm putting backups in place in the afternoon.
That also means we've lost history... :-(
     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 menuconfig: $(obj)/mconf
    11 	@$< $(KCONFIG_TOP)
    12 
    13 config: $(obj)/conf
    14 	@$< $(KCONFIG_TOP)
    15 
    16 oldconfig: $(obj)/conf
    17 	@$< -s $(KCONFIG_TOP)
    18 
    19 randconfig: $(obj)/conf
    20 	@$< -r $(KCONFIG_TOP)
    21 
    22 allyesconfig: $(obj)/conf
    23 	@$< -y $(KCONFIG_TOP)
    24 
    25 allnoconfig: $(obj)/conf
    26 	@$< -n $(KCONFIG_TOP)
    27 
    28 defconfig: $(obj)/conf
    29 	@$< -d $(KCONFIG_TOP)
    30 
    31 # Build a list of all available samples
    32 SAMPLES = $(patsubst $(CT_TOP_DIR)/samples/%,%,$(filter-out %Makefile,$(wildcard $(CT_TOP_DIR)/samples/*)))
    33 SAMPLES_CONFIG = $(patsubst %,%_config,$(SAMPLES))
    34 .PHONY: $(SAMPLES_CONFIG)
    35 $(SAMPLES_CONFIG):
    36 	@cp "$(CT_TOP_DIR)/samples/$(patsubst %_config,%,$@)/crosstool.config" "$(CT_TOP_DIR)/.config"
    37 	@$(MAKE) oldconfig
    38 
    39 # Help text used by make help
    40 help::
    41 	@echo  'General purpose configuration targets:'
    42 	@echo  '  config	  - Update current config utilising a line-oriented program'
    43 	@echo  '  menuconfig	  - Update current config utilising a menu based program'
    44 	@echo  '  oldconfig	  - Update current config utilising a provided .config as base'
    45 	@echo  '  randconfig	  - New config with random answer to all options'
    46 	@echo  '  defconfig	  - New config with default answer to all options'
    47 	@echo  '  allyesconfig	  - New config where all options are accepted with yes'
    48 	@echo  '  allnoconfig	  - New config where all options are answered with no'
    49 	@echo
    50 	@echo  'Preconfigured configuration targets:'
    51 	@for s in $(SAMPLES_CONFIG); do   \
    52 	    echo  "  $${s}"; \
    53 	 done
    54 	@echo  ''
    55 
    56 # Cheesy build
    57 
    58 SHIPPED = kconfig/zconf.tab.c kconfig/lex.zconf.c kconfig/zconf.hash.c
    59 
    60 %.c: %.c_shipped
    61 	@ln -s $(notdir $<) $@
    62 
    63 kconfig/mconf: $(SHIPPED) kconfig/mconf.c
    64 	@$(HOST_CC) -o $@ kconfig/{mconf.c,zconf.tab.c,lxdialog/*.c} \
    65 		-lcurses "-DCURSES_LOC=<ncurses.h>"
    66 
    67 kconfig/conf: $(SHIPPED) kconfig/conf.c
    68 	@$(HOST_CC) -o $@ kconfig/{conf.c,zconf.tab.c}
    69 
    70 clean::
    71 	@rm -f $(wildcard kconfig/*zconf*.c) kconfig/{conf,mconf}