crosstool-ng/kconfig/kconfig.mk
Jason T. Masker 10e1579799 scripts/crosstool-NG.sh.in: patch regex to work with BSD grep
BSD grep does not interpret a null alteration. It complains about an
empty sub-expression, e.g.:

$ grep --version && grep -E '^(# |)CT_' .config
grep (BSD grep) 2.5.1-FreeBSD
grep: empty (sub)expression

This patch replaces the null alteration with a zero or once quantifier
which works with both BSD & GNU grep.

$ grep --version && grep -E '^(# )?CT_' .config
grep (BSD grep) 2.5.1-FreeBSD
CT_CONFIGURE_has_xz=y
CT_CONFIGURE_has_svn=y
...
$ ggrep --version && ggrep -E '^(# )?CT_' .config
ggrep (GNU grep) 2.20
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and others, see
<http://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.
CT_CONFIGURE_has_xz=y
CT_CONFIGURE_has_svn=y
...

Signed-off-by: Jason T. Masker <jason@masker.net>
Tested-by: Andreas Bießmann <andreas@biessmann.de>
Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2014-12-05 03:12:57 -08:00

64 lines
2.6 KiB
Makefile

# ===========================================================================
# crosstool-NG configuration targets
# These targets are used from top-level makefile
#-----------------------------------------------------------
# The configurators rules
configurators = menuconfig nconfig oldconfig savedefconfig defconfig
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)
savedefconfig: .config
@$(ECHO) ' GEN $@'
$(SILENT)$(CONF) --savedefconfig=$${DEFCONFIG-defconfig} $(KCONFIG_TOP)
defconfig:
@$(ECHO) ' CONF $@'
$(SILENT)$(CONF) --defconfig=$${DEFCONFIG-defconfig} $(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'
@echo ' savedefconfig - Save current config as a mini-defconfig to $${DEFCONFIG}'
@echo ' defconfig - Update config from a mini-defconfig $${DEFCONFIG}'
@echo ' (default: $${DEFCONFIG}=./defconfig)'