kconfig/kconfig.mk
author "Yann E. MORIN" <yann.morin.1998@free.fr>
Mon May 07 00:27:05 2012 +0200 (2012-05-07)
changeset 2981 80151a249b85
parent 2835 0a2fa748727e
child 2999 4ccfca658d9b
permissions -rw-r--r--
samples: use savedefconfig when saving samples

When saving a sample, use savedefconfig instead of copying
the full .config file.

This reduces the saved .config, and reduces clutter when it
is later upgraded.

Also use defconfig when retrieving a sample.

Reported-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
     1 # ===========================================================================
     2 # crosstool-NG configuration targets
     3 # These targets are used from top-level makefile
     4 
     5 #-----------------------------------------------------------
     6 # The configurators rules
     7 
     8 configurators = menuconfig nconfig oldconfig
     9 PHONY += $(configurators)
    10 
    11 $(configurators): config_files
    12 
    13 # We need CONF for savedefconfig in scripts/saveSample.sh
    14 export CONF  := $(CT_LIB_DIR)/kconfig/conf
    15 MCONF := $(CT_LIB_DIR)/kconfig/mconf
    16 NCONF := $(CT_LIB_DIR)/kconfig/nconf
    17 
    18 menuconfig:
    19 	@$(ECHO) "  CONF  $(KCONFIG_TOP)"
    20 	$(SILENT)$(MCONF) $(KCONFIG_TOP)
    21 
    22 nconfig:
    23 	@$(ECHO) "  CONF  $(KCONFIG_TOP)"
    24 	$(SILENT)$(NCONF) $(KCONFIG_TOP)
    25 
    26 oldconfig: .config
    27 	@$(ECHO) "  CONF  $(KCONFIG_TOP)"
    28 	$(SILENT)$(CONF) --silent$@ $(KCONFIG_TOP)
    29 
    30 # Always be silent, the stdout an be >.config
    31 extractconfig:
    32 	@awk 'BEGIN { dump=0; }                                                 \
    33 	      dump==1 && $$0~/^\[.....\][[:space:]]+(# |)CT_/ {                 \
    34 	          $$1="";                                                       \
    35 	          gsub("^[[:space:]]","");                                      \
    36 	          print;                                                        \
    37 	      }                                                                 \
    38 	      $$0~/Dumping user-supplied crosstool-NG configuration: done in/ { \
    39 	          dump=0;                                                       \
    40 	      }                                                                 \
    41 	      $$0~/Dumping user-supplied crosstool-NG configuration$$/ {        \
    42 	          dump=1;                                                       \
    43 	      }'
    44 
    45 #-----------------------------------------------------------
    46 # Help text used by make help
    47 
    48 help-config::
    49 	@echo  '  menuconfig         - Update current config using a menu based program'
    50 	@echo  '  oldconfig          - Update current config using a provided .config as base'
    51 	@echo  '  extractconfig      - Extract to stdout the configuration items from a'
    52 	@echo  '                       build.log file piped to stdin'