summaryrefslogtreecommitdiff
path: root/ct-ng.in
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2018-02-22 07:34:58 (GMT)
committerAlexey Neyman <stilor@att.net>2018-04-07 19:03:17 (GMT)
commitdbe3877285549d1cdc549826673cdf8f07cf154c (patch)
tree0f0c188389c9dd60da7307be452a5faf59562e35 /ct-ng.in
parentd9d4d090265b56dc158b9ffa7a875d0a68f9c57f (diff)
Install ct-ng
Also, move kconfig.mk into the main driver - we'd want kconfig to be a sub-package so there's no sense in writing the installation framework for the ct-ng-specific fragment in an otherwise independent directory. Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'ct-ng.in')
-rw-r--r--ct-ng.in74
1 files changed, 67 insertions, 7 deletions
diff --git a/ct-ng.in b/ct-ng.in
index a8ad09d..7e0368d 100644
--- a/ct-ng.in
+++ b/ct-ng.in
@@ -1,4 +1,4 @@
-#!@@CT_make@@ -rf
+#!@MAKE@ -rf
# Makefile for crosstool-NG.
# Copyright 2006 Yann E. MORIN <yann.morin.1998@free.fr>
@@ -16,11 +16,11 @@ export CT_TOP_DIR:=$(shell pwd)
# Paths and values set by ./configure
# Don't bother to change it other than with a new ./configure!
-export CT_LIB_DIR:=@@CT_LIBDIR@@
-export CT_DOC_DIR:=@@CT_DOCDIR@@
+export CT_LIB_DIR:=@libdir@
+export CT_DOC_DIR:=@docdir@
# This is crosstool-NG version string
-export CT_VERSION:=@@CT_VERSION@@
+export CT_VERSION:=@PACKAGE_VERSION@
# Paths found by ./configure
include $(CT_LIB_DIR)/paths.mk
@@ -62,6 +62,59 @@ all: help
PHONY += all
FORCE:
+# Configuration rules. Currently, saveSample.sh uses some of the variables
+# below - they should be passed explicitly.
+
+# Top file of crosstool-NG configuration
+export KCONFIG_TOP = $(CT_LIB_DIR)/config/config.in
+
+# 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
+
+# Used by conf/mconf/nconf to find the .in files
+# TBD needed? We do supply the defconfig name explicitly below
+export srctree=$(CT_LIB_DIR)
+
+.PHONY: menuconfig nconfig oldconfig savedefconfig defconfig
+
+menuconfig:
+ @$(CT_ECHO) " CONF $@"
+ $(SILENT)$(MCONF) $(KCONFIG_TOP)
+
+nconfig:
+ @$(CT_ECHO) " CONF $@"
+ $(SILENT)$(NCONF) $(KCONFIG_TOP)
+
+oldconfig: .config
+ @$(CT_ECHO) " CONF $@"
+ $(SILENT)$(sed) -i -r -f $(CT_LIB_DIR)/scripts/upgrade.sed $<
+ $(SILENT)$(CONF) --silent$@ $(KCONFIG_TOP)
+
+savedefconfig: .config
+ @$(CT_ECHO) ' GEN $@'
+ $(SILENT)$(CONF) --savedefconfig=$${DEFCONFIG-defconfig} $(KCONFIG_TOP)
+
+defconfig:
+ @$(CT_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 system
help:: help-head help-config help-samples help-build help-clean help-distrib help-env help-tail
@@ -90,8 +143,8 @@ help-distrib::
help-env::
@echo
- @if [ -r "@@CT_DOCDIR@@/manual/4_Building.md" ]; then \
- echo 'Environment variables (see @@CT_DOCDIR@@/0 - Table of content.txt):'; \
+ @if [ -r "@docdir@/manual/4_Building.md" ]; then \
+ echo 'Environment variables (see @docdir@/0 - Table of content.txt):'; \
else \
echo 'Environment variables (see http://crosstool-ng.github.io/docs/build/)'; \
fi
@@ -111,12 +164,19 @@ help-clean::
@echo ' clean - Remove generated files'
@echo ' distclean - Remove generated files, configuration and build directories'
-include $(CT_LIB_DIR)/kconfig/kconfig.mk
include $(CT_LIB_DIR)/steps.mk
include $(CT_LIB_DIR)/samples/samples.mk
include $(CT_LIB_DIR)/scripts/scripts.mk
help-config::
+ @echo ' menuconfig - Update current config using a menu based program'
+ @echo ' nconfig - 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)'
@echo ' show-tuple - Print the tuple of the currently configured toolchain'
help-distrib::