kconfig/kconfig.mk
author "Yann E. MORIN" <yann.morin.1998@free.fr>
Mon May 07 21:37:59 2012 +0200 (2012-05-07)
changeset 2982 1e35d2fa54d7
parent 2835 0a2fa748727e
child 2999 4ccfca658d9b
permissions -rw-r--r--
samples: rework show-tuple

Now that we are using defconfig files, the samples do not contain
the full configuration, so we can not simply parse them to show
their content.

Instead, we must fake recalling a sample, and parse the generated
.config file.

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'