summaryrefslogtreecommitdiff
path: root/kconfig/kconfig.mk
blob: cc6aa46f24869f4113db47ed571e8fed7758d69f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# ===========================================================================
# crosstool-NG configuration targets
# These targets are used from top-level makefile

#-----------------------------------------------------------
# The configurators rules

configurators = menuconfig nconfig oldconfig
PHONY += $(configurators)

$(configurators): config_files

# We need CONF for savedefconfig in scripts/saveSample.sh
export CONF  := $(CT_LIB_DIR)/kconfig/conf
MCONF := $(CT_LIB_DIR)/kconfig/mconf
NCONF := $(CT_LIB_DIR)/kconfig/nconf

menuconfig:
	@$(ECHO) "  CONF  $(KCONFIG_TOP)"
	$(SILENT)$(MCONF) $(KCONFIG_TOP)

nconfig:
	@$(ECHO) "  CONF  $(KCONFIG_TOP)"
	$(SILENT)$(NCONF) $(KCONFIG_TOP)

oldconfig: .config
	@$(ECHO) "  CONF  $(KCONFIG_TOP)"
	$(SILENT)$(CONF) --silent$@ $(KCONFIG_TOP)

# Always be silent, the stdout an be >.config
extractconfig:
	@awk 'BEGIN { dump=0; }                                                 \
	      dump==1 && $$0~/^\[.....\][[:space:]]+(# |)CT_/ {                 \
	          $$1="";                                                       \
	          gsub("^[[:space:]]","");                                      \
	          print;                                                        \
	      }                                                                 \
	      $$0~/Dumping user-supplied crosstool-NG configuration: done in/ { \
	          dump=0;                                                       \
	      }                                                                 \
	      $$0~/Dumping user-supplied crosstool-NG configuration$$/ {        \
	          dump=1;                                                       \
	      }'

#-----------------------------------------------------------
# Help text used by make help

help-config::
	@echo  '  menuconfig         - Update current config using a menu based program'
	@echo  '  oldconfig          - Update current config using a provided .config as base'
	@echo  '  extractconfig      - Extract to stdout the configuration items from a'
	@echo  '                       build.log file piped to stdin'