kconfig/kconfig.mk
author "Yann E. MORIN" <yann.morin.1998@free.fr>
Mon Jul 23 22:02:23 2012 +0200 (2012-07-23)
changeset 3012 95173b196a88
parent 2981 80151a249b85
child 3034 11c23aa9c9f9
permissions -rw-r--r--
scripts+samples: fix listings the samples

Since we use defconfigs to save the samples, listing all the
samples can no longer be done by passing all the sample names
at one to the script; we need to pass them one-by-one after
we expand the sample's defconfig ibnto a complete .config.

Reported-by: Bryan Hundven <bryanhundven@gmail.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@2999
    32
	@$(awk) 'BEGIN { dump=0; }                                                  \
yann@2999
    33
	         dump==1 && $$0~/^\[.....\][[:space:]]+(# |)CT_/ {                  \
yann@2999
    34
	             $$1="";                                                        \
yann@2999
    35
	             gsub("^[[:space:]]","");                                       \
yann@2999
    36
	             print;                                                         \
yann@2999
    37
	         }                                                                  \
yann@2999
    38
	         $$0~/Dumping user-supplied crosstool-NG configuration: done in/ {  \
yann@2999
    39
	             dump=0;                                                        \
yann@2999
    40
	         }                                                                  \
yann@2999
    41
	         $$0~/Dumping user-supplied crosstool-NG configuration$$/ {         \
yann@2999
    42
	             dump=1;                                                        \
yann@2999
    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'