kconfig/kconfig.mk
author Cody Schafer <dev@codyps.com>
Fri May 09 19:13:49 2014 -0700 (2014-05-09)
changeset 3312 4876ff97e039
parent 3167 15f57d843296
permissions -rw-r--r--
cc/gcc: allow CC_EXTRA_CONFIG_ARRAY on baremetal

The final bare-metal compiler is built using the core backend.
Currently the core uses the CC_CORE_EXTRA_CONFIG_ARRAY variable.

While this works as supposed to, this can leave the user puzzled
in the menuconfig, since all he can see is the core options, not
the final options.

Only show the core options if any of the core passes are needed,
and use the final options in the core-backend if we're issuing
the bare-metal compiler.

Signed-off-by: Cody P Schafer <dev@codyps.com>
[yann.morin.1998@free.fr: hide core options if no core pass needed;
use final option in core backend if issuing the bare-metal compiler]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Message-Id: <22181e546ba746202489.1399688067@localhost>
Patchwork-Id: 347586
     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 savedefconfig defconfig
     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 savedefconfig: .config
    31 	@$(ECHO) '  GEN   $@'
    32 	$(SILENT)$(CONF) --savedefconfig=$${DEFCONFIG-defconfig} $(KCONFIG_TOP)
    33 
    34 defconfig:
    35 	@$(ECHO) '  CONF  $@'
    36 	$(SILENT)$(CONF) --defconfig=$${DEFCONFIG-defconfig} $(KCONFIG_TOP)
    37 
    38 # Always be silent, the stdout an be >.config
    39 extractconfig:
    40 	@$(awk) 'BEGIN { dump=0; }                                                  \
    41 	         dump==1 && $$0~/^\[.....\][[:space:]]+(# |)CT_/ {                  \
    42 	             $$1="";                                                        \
    43 	             gsub("^[[:space:]]","");                                       \
    44 	             print;                                                         \
    45 	         }                                                                  \
    46 	         $$0~/Dumping user-supplied crosstool-NG configuration: done in/ {  \
    47 	             dump=0;                                                        \
    48 	         }                                                                  \
    49 	         $$0~/Dumping user-supplied crosstool-NG configuration$$/ {         \
    50 	             dump=1;                                                        \
    51 	         }'
    52 
    53 #-----------------------------------------------------------
    54 # Help text used by make help
    55 
    56 help-config::
    57 	@echo  '  menuconfig         - Update current config using a menu based program'
    58 	@echo  '  oldconfig          - Update current config using a provided .config as base'
    59 	@echo  '  extractconfig      - Extract to stdout the configuration items from a'
    60 	@echo  '                       build.log file piped to stdin'
    61 	@echo  '  savedefconfig      - Save current config as a mini-defconfig to $${DEFCONFIG}'
    62 	@echo  '  defconfig          - Update config from a mini-defconfig $${DEFCONFIG}'
    63 	@echo  '                       (default: $${DEFCONFIG}=./defconfig)'