Skip to content

Commit

Permalink
Install ct-ng
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
stilor committed Apr 7, 2018
1 parent d9d4d09 commit dbe3877
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 76 deletions.
14 changes: 14 additions & 0 deletions Makefile.am
Expand Up @@ -2,3 +2,17 @@
## vim: set noet :

SUBDIRS = kconfig

bin_SCRIPTS = ct-ng
CLEANFILES = $(bin_SCRIPTS)
EXTRA_DIST = ct-ng.in bootstrap

do_subst = ( @SED@ \
-e 's,[@]bindir[@],$(bindir),g' \
-e 's,[@]libdir[@],$(libdir),g' \
-e 's,[@]docdir[@],$(docdir),g' \
-e 's,[@]mandir[@],$(mandir),g' \
| $(SHELL) config.status --file=- )

ct-ng: ct-ng.in
$(AM_V_GEN)$(do_subst) < $< >$@-t && chmod a-w,a+x $@-t && mv $@-t $@
74 changes: 67 additions & 7 deletions 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>

Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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::
Expand Down
4 changes: 3 additions & 1 deletion kconfig/Makefile.am
@@ -1,7 +1,9 @@
## vim: set noet :

## TBD install into lib/crosstool-ng/kconfig?
## TBD turn off program renaming for these? Or account for it in ct-ng script?
transform = s,x,x,

## TBD install into lib/crosstool-ng/kconfig? or move to libexec which seems more suitable
pkglibexec_PROGRAMS = conf nconf mconf

AM_LFLAGS = -L -Pzconf
Expand Down
68 changes: 0 additions & 68 deletions kconfig/kconfig.mk

This file was deleted.

0 comments on commit dbe3877

Please sign in to comment.