kconfig/kconfig.mk
author "Yann E. MORIN" <yann.morin.1998@free.fr>
Thu Dec 27 12:45:22 2012 +0100 (2012-12-27)
changeset 3152 b286c7993be5
parent 2999 4ccfca658d9b
child 3167 15f57d843296
permissions -rw-r--r--
scripts/addToolsVersion: properly handle .in vs. .in.2

While most components have their version in the .in file, some
have it in the .in.2 (eg. elf2flt).

Currently, to handle this case, we indiscriminately munge both files,
but this is wrong: in the elf2flt case, if we add a binutils version,
we do not want it to be added to elf2flt, and conversely.

So, for each tool, we need to explicitly know what file to munge.

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@3034
     8
configurators = menuconfig nconfig oldconfig defconfig olddefconfig
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@3034
    30
defconfig: .config
yann@3034
    31
	@$(ECHO) '  GEN   $@'
yann@3034
    32
	$(SILENT)$(CONF) --savedefconfig=$${CONFIG-defconfig} $(KCONFIG_TOP)
yann@3034
    33
yann@3034
    34
olddefconfig:
yann@3034
    35
	@$(ECHO) '  CONF  $@'
yann@3034
    36
	$(SILENT)$(CONF) --defconfig=$${CONFIG-defconfig} $(KCONFIG_TOP)
yann@3034
    37
yann@1803
    38
# Always be silent, the stdout an be >.config
yann@1803
    39
extractconfig:
yann@2999
    40
	@$(awk) 'BEGIN { dump=0; }                                                  \
yann@2999
    41
	         dump==1 && $$0~/^\[.....\][[:space:]]+(# |)CT_/ {                  \
yann@2999
    42
	             $$1="";                                                        \
yann@2999
    43
	             gsub("^[[:space:]]","");                                       \
yann@2999
    44
	             print;                                                         \
yann@2999
    45
	         }                                                                  \
yann@2999
    46
	         $$0~/Dumping user-supplied crosstool-NG configuration: done in/ {  \
yann@2999
    47
	             dump=0;                                                        \
yann@2999
    48
	         }                                                                  \
yann@2999
    49
	         $$0~/Dumping user-supplied crosstool-NG configuration$$/ {         \
yann@2999
    50
	             dump=1;                                                        \
yann@2999
    51
	         }'
yann@1803
    52
yann@926
    53
#-----------------------------------------------------------
yann@1
    54
# Help text used by make help
yann@926
    55
yann@176
    56
help-config::
yann@333
    57
	@echo  '  menuconfig         - Update current config using a menu based program'
yann@333
    58
	@echo  '  oldconfig          - Update current config using a provided .config as base'
yann@1803
    59
	@echo  '  extractconfig      - Extract to stdout the configuration items from a'
yann@1803
    60
	@echo  '                       build.log file piped to stdin'
yann@3034
    61
	@echo  '  defconfig          - Save current config as a mini-defconfig to $${CONFIG}'
yann@3034
    62
	@echo  '  olddefconfig       - Update config from a mini-defconfig $${CONFIG}'
yann@3034
    63
	@echo  '                       (default: $${CONFIG}=./defconfig)'