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