kconfig/Makefile
changeset 1 eeea35fbf182
child 2 687f86f2a01c
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/kconfig/Makefile	Sat Feb 24 11:00:05 2007 +0000
     1.3 @@ -0,0 +1,71 @@
     1.4 +# ===========================================================================
     1.5 +# crosstool-ng configuration targets
     1.6 +# These targets are used from top-level makefile
     1.7 +
     1.8 +KCONFIG_TOP = config/config.in
     1.9 +obj = ./kconfig
    1.10 +PHONY += clean help oldconfig menuconfig config silentoldconfig \
    1.11 +	randconfig allyesconfig allnoconfig allmodconfig defconfig
    1.12 +
    1.13 +menuconfig: $(obj)/mconf
    1.14 +	@$< $(KCONFIG_TOP)
    1.15 +
    1.16 +config: $(obj)/conf
    1.17 +	@$< $(KCONFIG_TOP)
    1.18 +
    1.19 +oldconfig: $(obj)/conf
    1.20 +	@$< -s $(KCONFIG_TOP)
    1.21 +
    1.22 +randconfig: $(obj)/conf
    1.23 +	@$< -r $(KCONFIG_TOP)
    1.24 +
    1.25 +allyesconfig: $(obj)/conf
    1.26 +	@$< -y $(KCONFIG_TOP)
    1.27 +
    1.28 +allnoconfig: $(obj)/conf
    1.29 +	@$< -n $(KCONFIG_TOP)
    1.30 +
    1.31 +defconfig: $(obj)/conf
    1.32 +	@$< -d $(KCONFIG_TOP)
    1.33 +
    1.34 +# Build a list of all available samples
    1.35 +SAMPLES = $(patsubst $(CT_TOP_DIR)/samples/%,%,$(filter-out %Makefile,$(wildcard $(CT_TOP_DIR)/samples/*)))
    1.36 +SAMPLES_CONFIG = $(patsubst %,%_config,$(SAMPLES))
    1.37 +.PHONY: $(SAMPLES_CONFIG)
    1.38 +$(SAMPLES_CONFIG):
    1.39 +	@cp "$(CT_TOP_DIR)/samples/$(patsubst %_config,%,$@)/crosstool.config" "$(CT_TOP_DIR)/.config"
    1.40 +	@$(MAKE) oldconfig
    1.41 +
    1.42 +# Help text used by make help
    1.43 +help::
    1.44 +	@echo  'General purpose configuration targets:'
    1.45 +	@echo  '  config	  - Update current config utilising a line-oriented program'
    1.46 +	@echo  '  menuconfig	  - Update current config utilising a menu based program'
    1.47 +	@echo  '  oldconfig	  - Update current config utilising a provided .config as base'
    1.48 +	@echo  '  randconfig	  - New config with random answer to all options'
    1.49 +	@echo  '  defconfig	  - New config with default answer to all options'
    1.50 +	@echo  '  allyesconfig	  - New config where all options are accepted with yes'
    1.51 +	@echo  '  allnoconfig	  - New config where all options are answered with no'
    1.52 +	@echo
    1.53 +	@echo  'Preconfigured configuration targets:'
    1.54 +	@for s in $(SAMPLES_CONFIG); do   \
    1.55 +	    echo  "  $${s}"; \
    1.56 +	 done
    1.57 +	@echo  ''
    1.58 +
    1.59 +# Cheesy build
    1.60 +
    1.61 +SHIPPED = kconfig/zconf.tab.c kconfig/lex.zconf.c kconfig/zconf.hash.c
    1.62 +
    1.63 +%.c: %.c_shipped
    1.64 +	@ln -s $(notdir $<) $@
    1.65 +
    1.66 +kconfig/mconf: $(SHIPPED) kconfig/mconf.c
    1.67 +	@$(HOST_CC) -o $@ kconfig/{mconf.c,zconf.tab.c,lxdialog/*.c} \
    1.68 +		-lcurses "-DCURSES_LOC=<ncurses.h>"
    1.69 +
    1.70 +kconfig/conf: $(SHIPPED) kconfig/conf.c
    1.71 +	@$(HOST_CC) -o $@ kconfig/{conf.c,zconf.tab.c}
    1.72 +
    1.73 +clean::
    1.74 +	@rm -f $(wildcard kconfig/*zconf*.c) kconfig/{conf,mconf}