2018-02-22 07:34:58 +00:00
|
|
|
#!@MAKE@ -rf
|
2019-01-28 03:04:15 +00:00
|
|
|
# vim: set filetype=make noet :
|
2007-07-01 19:04:20 +00:00
|
|
|
# Makefile for crosstool-NG.
|
2012-03-06 20:36:10 +00:00
|
|
|
# Copyright 2006 Yann E. MORIN <yann.morin.1998@free.fr>
|
2007-07-01 19:04:20 +00:00
|
|
|
|
|
|
|
# Don't print directory as we descend into them
|
2008-01-16 21:41:53 +00:00
|
|
|
# Don't use built-in rules, we know what we're doing
|
2007-07-23 09:46:05 +00:00
|
|
|
MAKEFLAGS += --no-print-directory --no-builtin-rules
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2009-01-26 18:36:02 +00:00
|
|
|
# Don't go parallel
|
|
|
|
.NOTPARALLEL:
|
2008-01-16 21:41:53 +00:00
|
|
|
|
2009-01-19 21:57:55 +00:00
|
|
|
# This is where ct-ng is:
|
2016-12-14 06:20:52 +00:00
|
|
|
export CT_NG:=$(abspath $(lastword $(MAKEFILE_LIST)))
|
2009-01-19 21:57:55 +00:00
|
|
|
# and this is where we're working in:
|
2007-07-01 19:04:20 +00:00
|
|
|
export CT_TOP_DIR:=$(shell pwd)
|
2009-01-19 21:57:55 +00:00
|
|
|
|
2018-03-18 21:41:30 +00:00
|
|
|
ifeq (@enable_local@,yes)
|
|
|
|
# automake does not allow to set pkgxxxdir, they are always derived from
|
|
|
|
# a respective xxxdir. So, for enable-local case, set them directly here.
|
2018-11-10 22:57:17 +00:00
|
|
|
export CT_LIB_DIR:=$(patsubst %/,%,$(dir $(CT_NG)))
|
2018-11-03 21:19:33 +00:00
|
|
|
export CT_LIBEXEC_DIR:=$(CT_LIB_DIR)/kconfig
|
|
|
|
export CT_DOC_DIR:=$(CT_LIB_DIR)/docs
|
2018-11-12 09:15:58 +00:00
|
|
|
export CT_LICENSE_DIR
|
2018-03-18 21:41:30 +00:00
|
|
|
else
|
2018-03-19 06:40:28 +00:00
|
|
|
# Paths and values set by ./configure
|
|
|
|
# Don't bother to change it other than with a new ./configure!
|
2018-03-18 04:43:24 +00:00
|
|
|
export CT_LIB_DIR:=@pkgdatadir@
|
|
|
|
export CT_LIBEXEC_DIR:=@pkglibexecdir@
|
2018-02-22 07:34:58 +00:00
|
|
|
export CT_DOC_DIR:=@docdir@
|
2018-03-19 06:40:28 +00:00
|
|
|
endif
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2007-07-02 19:40:54 +00:00
|
|
|
# This is crosstool-NG version string
|
2018-02-22 07:34:58 +00:00
|
|
|
export CT_VERSION:=@PACKAGE_VERSION@
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2019-01-21 00:42:12 +00:00
|
|
|
# Export with an empty value: this masks the version detection variable in
|
|
|
|
# user-visible configurators, and suppresses a warning from kconfig.
|
|
|
|
export CT_VCHECK=
|
|
|
|
|
2019-01-28 03:04:15 +00:00
|
|
|
# Current version of the configuration file. Defined here, because we also
|
|
|
|
# need to pass it to the upgrade script - which may receive an input that
|
|
|
|
# was not preprocessed by kconfig, and hence have no string for "up-to-date"
|
|
|
|
# version.
|
2019-01-30 08:09:30 +00:00
|
|
|
export CT_CONFIG_VERSION_CURRENT=2
|
2019-01-28 03:04:15 +00:00
|
|
|
|
2018-02-22 08:25:36 +00:00
|
|
|
# Download agents used by scripts.mk
|
|
|
|
CT_WGET := @wget@
|
|
|
|
CT_CURL := @curl@
|
|
|
|
|
2009-01-26 18:36:02 +00:00
|
|
|
# Paths found by ./configure
|
2018-03-18 00:41:36 +00:00
|
|
|
export install = @INSTALL@
|
|
|
|
export bash = @BASH_SHELL@
|
|
|
|
export awk = @AWK@
|
|
|
|
export grep = @GREP@
|
|
|
|
export make = @MAKE@
|
|
|
|
export sed = @SED@
|
|
|
|
export libtool = @LIBTOOL@
|
|
|
|
export libtoolize = @LIBTOOLIZE@
|
|
|
|
export objcopy = @OBJCOPY@
|
|
|
|
export objdump = @OBJDUMP@
|
|
|
|
export readelf = @READELF@
|
|
|
|
export patch = @PATCH@
|
2009-01-26 18:36:02 +00:00
|
|
|
|
|
|
|
# Some distributions (eg. Ubuntu) thought it wise to point /bin/sh to
|
|
|
|
# a truly POSIX-conforming shell, ash in this case. This is not so good
|
|
|
|
# as we, smart (haha!) developers (as smart we ourselves think we are),
|
2017-02-12 21:51:42 +00:00
|
|
|
# got used to bashisms, and are inclined to easiness... So force use of
|
2009-01-26 18:36:02 +00:00
|
|
|
# bash.
|
|
|
|
export SHELL=$(bash)
|
2008-10-21 16:13:46 +00:00
|
|
|
|
2017-02-12 21:51:42 +00:00
|
|
|
# Make the restart/stop steps available to scripts/crostool-NG.sh
|
2007-08-15 15:39:44 +00:00
|
|
|
export CT_STOP:=$(STOP)
|
|
|
|
export CT_RESTART:=$(RESTART)
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2008-10-21 16:56:32 +00:00
|
|
|
SILENT=@
|
2015-10-30 02:34:24 +00:00
|
|
|
CT_ECHO=echo
|
2008-10-21 16:56:32 +00:00
|
|
|
ifeq ($(strip $(origin V)),command line)
|
Cheesy kconfig stuff:
- silent/quiet/verbose build:
- ct-ng by default only prints quit messages, such as "CC xxx",
- if using V=0, nothing is printed,
- if using V=1, the full command lines are printed,
- other values are indeterminate,
- should help in debugging the kconfig stuff;
- complete kconfig/{,m}conf generation:
- fully dynamic dependencies on source files,
- compilation of .c into .o, then linking (instead of direct linking),
- VPATH usage when not --local;
Typo + a coment moved.
/trunk/kconfig/kconfig.mk | 140 87 53 0 +++++++++++++++++++++++++++++++++--------------------
/trunk/tools/tools.mk | 12 6 6 0 ++--
/trunk/steps.mk | 6 3 3 0 +-
/trunk/samples/samples.mk | 30 15 15 0 +++++-----
/trunk/ct-ng.in | 40 28 12 0 +++++++++++----
5 files changed, 139 insertions(+), 89 deletions(-)
2008-10-15 21:29:56 +00:00
|
|
|
ifeq ($(strip $(V)),0)
|
|
|
|
SILENT=@
|
2015-10-30 02:34:24 +00:00
|
|
|
CT_ECHO=:
|
Cheesy kconfig stuff:
- silent/quiet/verbose build:
- ct-ng by default only prints quit messages, such as "CC xxx",
- if using V=0, nothing is printed,
- if using V=1, the full command lines are printed,
- other values are indeterminate,
- should help in debugging the kconfig stuff;
- complete kconfig/{,m}conf generation:
- fully dynamic dependencies on source files,
- compilation of .c into .o, then linking (instead of direct linking),
- VPATH usage when not --local;
Typo + a coment moved.
/trunk/kconfig/kconfig.mk | 140 87 53 0 +++++++++++++++++++++++++++++++++--------------------
/trunk/tools/tools.mk | 12 6 6 0 ++--
/trunk/steps.mk | 6 3 3 0 +-
/trunk/samples/samples.mk | 30 15 15 0 +++++-----
/trunk/ct-ng.in | 40 28 12 0 +++++++++++----
5 files changed, 139 insertions(+), 89 deletions(-)
2008-10-15 21:29:56 +00:00
|
|
|
else
|
|
|
|
ifeq ($(strip $(V)),1)
|
|
|
|
SILENT=
|
2015-10-30 02:34:24 +00:00
|
|
|
CT_ECHO=:
|
2008-10-21 16:13:46 +00:00
|
|
|
else
|
|
|
|
ifeq ($(strip $(V)),2)
|
|
|
|
SILENT=
|
2015-10-30 02:34:24 +00:00
|
|
|
CT_ECHO=echo
|
2008-10-21 16:56:32 +00:00
|
|
|
endif # V == 2
|
|
|
|
endif # V== 1
|
|
|
|
endif # V == 0
|
|
|
|
endif # origin V
|
2015-10-30 02:34:24 +00:00
|
|
|
export V SILENT CT_ECHO
|
Cheesy kconfig stuff:
- silent/quiet/verbose build:
- ct-ng by default only prints quit messages, such as "CC xxx",
- if using V=0, nothing is printed,
- if using V=1, the full command lines are printed,
- other values are indeterminate,
- should help in debugging the kconfig stuff;
- complete kconfig/{,m}conf generation:
- fully dynamic dependencies on source files,
- compilation of .c into .o, then linking (instead of direct linking),
- VPATH usage when not --local;
Typo + a coment moved.
/trunk/kconfig/kconfig.mk | 140 87 53 0 +++++++++++++++++++++++++++++++++--------------------
/trunk/tools/tools.mk | 12 6 6 0 ++--
/trunk/steps.mk | 6 3 3 0 +-
/trunk/samples/samples.mk | 30 15 15 0 +++++-----
/trunk/ct-ng.in | 40 28 12 0 +++++++++++----
5 files changed, 139 insertions(+), 89 deletions(-)
2008-10-15 21:29:56 +00:00
|
|
|
|
2009-10-30 18:49:51 +00:00
|
|
|
all: help
|
|
|
|
|
2007-07-01 19:04:20 +00:00
|
|
|
.PHONY: $(PHONY)
|
|
|
|
PHONY += all
|
2009-10-30 18:49:51 +00:00
|
|
|
FORCE:
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2018-02-22 07:34:58 +00:00
|
|
|
# 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
|
|
|
|
|
2019-01-21 00:42:12 +00:00
|
|
|
CONF := $(CT_LIBEXEC_DIR)/conf
|
|
|
|
CONF-menuconfig := $(CT_LIBEXEC_DIR)/mconf
|
|
|
|
CONF-nconfig := $(CT_LIBEXEC_DIR)/nconf
|
2018-02-22 07:34:58 +00:00
|
|
|
|
|
|
|
# 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)
|
|
|
|
|
2019-01-28 03:04:15 +00:00
|
|
|
.PHONY: menuconfig nconfig oldconfig olddefconfig savedefconfig defconfig check-config extractconfig
|
|
|
|
.PHONY: upgradeconfig
|
2018-02-22 07:34:58 +00:00
|
|
|
|
2018-11-02 06:19:12 +00:00
|
|
|
check-config:
|
|
|
|
@[ ! -e .config -o -f .config ] || { echo ".config is not a regular file:"; ls -dl .config; exit 1; } >&2
|
|
|
|
|
2019-01-21 00:42:12 +00:00
|
|
|
menuconfig nconfig: check-config
|
2018-02-22 07:34:58 +00:00
|
|
|
@$(CT_ECHO) " CONF $@"
|
2019-01-21 00:42:12 +00:00
|
|
|
$(SILENT)if [ ! -f .config ] || CT_VCHECK=strict $(bash) $(CT_LIB_DIR)/scripts/version-check.sh .config; then \
|
|
|
|
$(CONF-$@) $(KCONFIG_TOP); \
|
|
|
|
else \
|
|
|
|
CT_VCHECK=warning $(CONF-$@) $(KCONFIG_TOP); \
|
|
|
|
fi
|
2018-02-22 07:34:58 +00:00
|
|
|
|
2018-11-02 06:19:12 +00:00
|
|
|
oldconfig: .config check-config
|
2018-02-22 07:34:58 +00:00
|
|
|
@$(CT_ECHO) " CONF $@"
|
2019-01-21 00:42:12 +00:00
|
|
|
@$(bash) $(CT_LIB_DIR)/scripts/version-check.sh .config
|
2018-02-22 07:34:58 +00:00
|
|
|
$(SILENT)$(CONF) --silent$@ $(KCONFIG_TOP)
|
|
|
|
|
2019-01-28 03:04:15 +00:00
|
|
|
olddefconfig: .config check-config
|
|
|
|
@$(CT_ECHO) " CONF $@"
|
|
|
|
@$(bash) $(CT_LIB_DIR)/scripts/version-check.sh .config
|
|
|
|
$(SILENT)$(CONF) --$@ $(KCONFIG_TOP)
|
|
|
|
|
2018-11-02 06:19:12 +00:00
|
|
|
savedefconfig: .config check-config
|
2018-02-22 07:34:58 +00:00
|
|
|
@$(CT_ECHO) ' GEN $@'
|
2019-01-21 00:42:12 +00:00
|
|
|
$(SILENT)CT_VCHECK=save $(CONF) --savedefconfig=$${DEFCONFIG-defconfig} $(KCONFIG_TOP)
|
2018-02-22 07:34:58 +00:00
|
|
|
|
2018-11-02 06:19:12 +00:00
|
|
|
defconfig: check-config
|
2018-02-22 07:34:58 +00:00
|
|
|
@$(CT_ECHO) ' CONF $@'
|
2019-01-21 00:42:12 +00:00
|
|
|
$(SILENT)CT_VCHECK=save $(CONF) --defconfig=$${DEFCONFIG-defconfig} $(KCONFIG_TOP)
|
2018-02-22 07:34:58 +00:00
|
|
|
|
2019-01-28 03:04:15 +00:00
|
|
|
upgradeconfig: .config check-config
|
2019-02-09 23:55:16 +00:00
|
|
|
$(SILENT)cp .config .config.before-upgrade
|
2019-01-28 03:04:15 +00:00
|
|
|
$(SILENT)CT_UPGRADECONFIG=yes $(bash) $(CT_LIB_DIR)/scripts/version-check.sh .config
|
2019-02-09 23:55:16 +00:00
|
|
|
@$(CT_ECHO) "Saving .config as .config.before-olddefconfig before running 'ct-ng olddefconfig'"
|
|
|
|
$(SILENT)cp .config .config.before-olddefconfig
|
2019-01-28 03:04:15 +00:00
|
|
|
$(SILENT)$(CONF) --olddefconfig $(KCONFIG_TOP)
|
|
|
|
@$(CT_ECHO) "Done. You may now run 'ct-ng menuconfig' to edit the configuration."
|
|
|
|
|
2018-02-22 07:34:58 +00:00
|
|
|
# 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; \
|
|
|
|
}'
|
|
|
|
|
2007-07-01 19:04:20 +00:00
|
|
|
# Help system
|
2007-07-09 20:55:32 +00:00
|
|
|
help:: help-head help-config help-samples help-build help-clean help-distrib help-env help-tail
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2008-06-01 21:12:00 +00:00
|
|
|
help-head:: version
|
|
|
|
@echo 'See below for a list of available actions, listed by category:'
|
2007-07-01 19:04:20 +00:00
|
|
|
|
|
|
|
help-config::
|
|
|
|
@echo
|
2007-07-02 19:40:54 +00:00
|
|
|
@echo 'Configuration actions:'
|
2007-07-01 19:04:20 +00:00
|
|
|
|
|
|
|
help-samples::
|
|
|
|
@echo
|
2008-10-31 18:29:15 +00:00
|
|
|
@echo 'Preconfigured toolchains (#: force number of // jobs):'
|
2007-07-01 19:04:20 +00:00
|
|
|
|
|
|
|
help-build::
|
|
|
|
@echo
|
2007-08-15 14:59:37 +00:00
|
|
|
@echo 'Build actions (#: force number of // jobs):'
|
2018-03-17 22:16:56 +00:00
|
|
|
@echo ' list-steps - List all build steps'
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2007-07-09 20:55:32 +00:00
|
|
|
help-clean::
|
|
|
|
@echo
|
|
|
|
@echo 'Clean actions:'
|
|
|
|
|
2007-07-01 19:04:20 +00:00
|
|
|
help-distrib::
|
|
|
|
@echo
|
2007-07-02 19:40:54 +00:00
|
|
|
@echo 'Distribution actions:'
|
2007-07-01 19:04:20 +00:00
|
|
|
|
|
|
|
help-env::
|
|
|
|
@echo
|
2018-02-22 07:34:58 +00:00
|
|
|
@if [ -r "@docdir@/manual/4_Building.md" ]; then \
|
|
|
|
echo 'Environment variables (see @docdir@/0 - Table of content.txt):'; \
|
2017-10-05 07:09:22 +00:00
|
|
|
else \
|
|
|
|
echo 'Environment variables (see http://crosstool-ng.github.io/docs/build/)'; \
|
|
|
|
fi
|
2018-03-17 22:16:56 +00:00
|
|
|
@echo ' STOP=step - Stop the build just after this step (list with list-steps)'
|
|
|
|
@echo ' RESTART=step - Restart the build just before this step (list with list-steps)'
|
2007-07-01 19:04:20 +00:00
|
|
|
|
|
|
|
help-tail::
|
|
|
|
@echo
|
2010-08-14 14:37:11 +00:00
|
|
|
@echo 'Use action "menuconfig" to configure your toolchain'
|
2008-10-14 19:29:25 +00:00
|
|
|
@echo 'Use action "build" to build your toolchain'
|
|
|
|
@echo 'Use action "version" to see the version'
|
2011-08-17 21:05:01 +00:00
|
|
|
@echo 'See "man 1 $(notdir $(CT_NG))" for some help as well'
|
2007-07-01 19:04:20 +00:00
|
|
|
|
|
|
|
help-build::
|
2015-10-30 08:04:39 +00:00
|
|
|
@echo ' source - Download sources for currently configured toolchain'
|
2008-10-31 18:29:15 +00:00
|
|
|
@echo ' build[.#] - Build the currently configured toolchain'
|
2007-07-09 20:55:32 +00:00
|
|
|
|
|
|
|
help-clean::
|
2007-08-15 14:59:37 +00:00
|
|
|
@echo ' clean - Remove generated files'
|
|
|
|
@echo ' distclean - Remove generated files, configuration and build directories'
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2007-07-15 09:09:04 +00:00
|
|
|
include $(CT_LIB_DIR)/samples/samples.mk
|
2008-12-16 18:12:34 +00:00
|
|
|
include $(CT_LIB_DIR)/scripts/scripts.mk
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2009-05-13 18:10:47 +00:00
|
|
|
help-config::
|
2018-02-22 07:34:58 +00:00
|
|
|
@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'
|
2019-01-28 03:04:15 +00:00
|
|
|
@echo ' upgradeconfig - Upgrade config file to current crosstool-NG'
|
2018-02-22 07:34:58 +00:00
|
|
|
@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)'
|
2009-05-13 18:10:47 +00:00
|
|
|
@echo ' show-tuple - Print the tuple of the currently configured toolchain'
|
|
|
|
|
2007-07-01 19:04:20 +00:00
|
|
|
help-distrib::
|
|
|
|
|
|
|
|
help-env::
|
2015-10-30 02:34:24 +00:00
|
|
|
@echo ' V=0|1|2|<unset> - <unset> show only human-readable messages (default)'
|
|
|
|
@echo ' 0 => do not show commands or human-readable message'
|
2010-04-01 22:18:26 +00:00
|
|
|
@echo ' 1 => show only the commands being executed'
|
|
|
|
@echo ' 2 => show both'
|
2007-07-01 19:04:20 +00:00
|
|
|
|
Cheesy kconfig stuff:
- silent/quiet/verbose build:
- ct-ng by default only prints quit messages, such as "CC xxx",
- if using V=0, nothing is printed,
- if using V=1, the full command lines are printed,
- other values are indeterminate,
- should help in debugging the kconfig stuff;
- complete kconfig/{,m}conf generation:
- fully dynamic dependencies on source files,
- compilation of .c into .o, then linking (instead of direct linking),
- VPATH usage when not --local;
Typo + a coment moved.
/trunk/kconfig/kconfig.mk | 140 87 53 0 +++++++++++++++++++++++++++++++++--------------------
/trunk/tools/tools.mk | 12 6 6 0 ++--
/trunk/steps.mk | 6 3 3 0 +-
/trunk/samples/samples.mk | 30 15 15 0 +++++-----
/trunk/ct-ng.in | 40 28 12 0 +++++++++++----
5 files changed, 139 insertions(+), 89 deletions(-)
2008-10-15 21:29:56 +00:00
|
|
|
# End help system
|
|
|
|
|
2007-07-01 19:04:20 +00:00
|
|
|
.config:
|
2009-05-13 18:10:47 +00:00
|
|
|
@echo "There is no existing .config file!"
|
|
|
|
@echo "You need to either run 'menuconfig',"
|
|
|
|
@echo "or configure an existing sample."
|
2007-07-01 19:04:20 +00:00
|
|
|
@false
|
|
|
|
|
2016-12-14 02:07:21 +00:00
|
|
|
show-tuple: .config
|
2017-11-19 08:23:55 +00:00
|
|
|
$(SILENT)$(bash) $(CT_LIB_DIR)/scripts/show-tuple.sh '$${CT_TARGET}'
|
2009-05-13 18:10:47 +00:00
|
|
|
|
2007-07-01 19:04:20 +00:00
|
|
|
# Actual build
|
2016-12-14 02:07:21 +00:00
|
|
|
source: .config
|
2017-06-07 03:06:04 +00:00
|
|
|
$(SILENT)CT_SOURCE=y $(bash) $(CT_LIB_DIR)/scripts/crosstool-NG.sh
|
2015-10-30 08:04:39 +00:00
|
|
|
|
2016-12-14 02:07:21 +00:00
|
|
|
build: .config
|
2018-05-15 23:51:59 +00:00
|
|
|
$(SILENT)BUILD_NCPUS=`@CPU_COUNT@ 2>/dev/null || echo 0` \
|
2018-02-22 08:25:36 +00:00
|
|
|
$(bash) $(CT_LIB_DIR)/scripts/crosstool-NG.sh
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2007-09-11 17:14:28 +00:00
|
|
|
build.%:
|
2015-10-30 17:32:16 +00:00
|
|
|
$(SILENT)$(MAKE) -rf $(CT_NG) build CT_JOBS=$*
|
2007-08-15 14:59:37 +00:00
|
|
|
|
2018-03-17 22:16:56 +00:00
|
|
|
# The _for_build steps are noop for native and cross,
|
|
|
|
# but are actual steps for canadian and cross-native.
|
|
|
|
# Please keep the last line with a '\' and keep the following empty line:
|
|
|
|
# it helps when diffing and merging.
|
|
|
|
CT_STEPS := \
|
|
|
|
companion_tools_for_build \
|
|
|
|
companion_libs_for_build \
|
|
|
|
binutils_for_build \
|
|
|
|
companion_tools_for_host \
|
|
|
|
companion_libs_for_host \
|
|
|
|
binutils_for_host \
|
|
|
|
cc_core_pass_1 \
|
|
|
|
kernel_headers \
|
|
|
|
libc_start_files \
|
|
|
|
cc_core_pass_2 \
|
2018-11-24 06:14:07 +00:00
|
|
|
libc_main \
|
2018-03-17 22:16:56 +00:00
|
|
|
cc_for_build \
|
|
|
|
cc_for_host \
|
|
|
|
libc_post_cc \
|
|
|
|
companion_libs_for_target \
|
|
|
|
binutils_for_target \
|
|
|
|
debug \
|
|
|
|
test_suite \
|
|
|
|
finish \
|
|
|
|
|
|
|
|
# Keep an empty line above this comment, so the last
|
|
|
|
# back-slash terminated line works as expected.
|
|
|
|
|
|
|
|
# Make the list available to sub-processes (scripts/crosstool-NG.sh needs it)
|
|
|
|
export CT_STEPS
|
|
|
|
|
|
|
|
# Print the steps list
|
|
|
|
PHONY += list-steps
|
|
|
|
list-steps:
|
|
|
|
@echo 'Available build steps, in order:'
|
|
|
|
@for step in $(CT_STEPS); do \
|
|
|
|
echo " - $${step}"; \
|
|
|
|
done
|
|
|
|
@echo 'Use "<step>" as action to execute only that step.'
|
|
|
|
@echo 'Use "+<step>" as action to execute up to that step.'
|
|
|
|
@echo 'Use "<step>+" as action to execute from that step onward.'
|
|
|
|
|
|
|
|
# ----------------------------------------------------------
|
|
|
|
# This part deals with executing steps
|
|
|
|
|
|
|
|
$(CT_STEPS):
|
|
|
|
$(SILENT)$(MAKE) -rf $(CT_NG) V=$(V) RESTART=$@ STOP=$@ build
|
|
|
|
|
|
|
|
$(patsubst %,+%,$(CT_STEPS)):
|
|
|
|
$(SILENT)$(MAKE) -rf $(CT_NG) V=$(V) STOP=$(patsubst +%,%,$@) build
|
|
|
|
|
|
|
|
$(patsubst %,%+,$(CT_STEPS)):
|
|
|
|
$(SILENT)$(MAKE) -rf $(CT_NG) V=$(V) RESTART=$(patsubst %+,%,$@) build
|
|
|
|
|
2007-07-16 16:34:36 +00:00
|
|
|
PHONY += version
|
|
|
|
version:
|
2007-07-17 07:18:04 +00:00
|
|
|
@echo 'This is crosstool-NG version $(CT_VERSION)'
|
2008-07-16 22:23:46 +00:00
|
|
|
@echo
|
2012-03-06 20:36:10 +00:00
|
|
|
@echo 'Copyright (C) 2008 Yann E. MORIN <yann.morin.1998@free.fr>'
|
2008-07-16 22:23:46 +00:00
|
|
|
@echo 'This is free software; see the source for copying conditions.'
|
|
|
|
@echo 'There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A'
|
|
|
|
@echo 'PARTICULAR PURPOSE.'
|
2008-10-14 19:19:20 +00:00
|
|
|
@echo
|
2007-07-16 16:34:36 +00:00
|
|
|
|
2007-07-01 19:04:20 +00:00
|
|
|
PHONY += clean
|
|
|
|
clean::
|
2015-10-30 02:34:24 +00:00
|
|
|
@$(CT_ECHO) " CLEAN log"
|
2014-06-28 19:01:33 +00:00
|
|
|
$(SILENT)rm -f build.log
|
2015-10-30 02:34:24 +00:00
|
|
|
@$(CT_ECHO) " CLEAN build dir"
|
2014-06-28 19:01:33 +00:00
|
|
|
$(SILENT)[ ! -d targets ] || chmod -R u+w targets
|
|
|
|
$(SILENT)[ ! -d .build ] || chmod -R u+w .build
|
2015-10-29 23:57:07 +00:00
|
|
|
$(SILENT)rm -rf targets .build .build-all
|
2007-07-01 19:04:20 +00:00
|
|
|
|
|
|
|
PHONY += distclean
|
|
|
|
distclean:: clean
|
2015-10-30 02:34:24 +00:00
|
|
|
@$(CT_ECHO) " CLEAN .config"
|
2008-10-21 16:13:46 +00:00
|
|
|
$(SILENT)rm -f .config .config.* ..config*
|