2009-01-18 15:40:02 +00:00
|
|
|
#!@@CT_make@@ -rf
|
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
|
|
|
|
|
|
|
# Paths and values set by ./configure
|
|
|
|
# Don't bother to change it other than with a new ./configure!
|
2007-07-01 19:04:20 +00:00
|
|
|
export CT_LIB_DIR:=@@CT_LIBDIR@@
|
|
|
|
export CT_DOC_DIR:=@@CT_DOCDIR@@
|
|
|
|
|
2007-07-02 19:40:54 +00:00
|
|
|
# This is crosstool-NG version string
|
2008-06-01 20:36:36 +00:00
|
|
|
export CT_VERSION:=@@CT_VERSION@@
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2009-01-26 18:36:02 +00:00
|
|
|
# Paths found by ./configure
|
|
|
|
include $(CT_LIB_DIR)/paths.mk
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
# 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):'
|
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
|
2012-02-13 20:07:55 +00:00
|
|
|
@echo 'Environment variables (see @@CT_DOCDIR@@/0 - Table of content.txt):'
|
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)/kconfig/kconfig.mk
|
2007-08-15 14:59:37 +00:00
|
|
|
include $(CT_LIB_DIR)/steps.mk
|
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::
|
|
|
|
@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
|
2016-12-14 06:18:50 +00:00
|
|
|
$(SILENT)$(bash) $(CT_LIB_DIR)/scripts/showConfig.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
|
2017-06-07 03:06:04 +00:00
|
|
|
$(SILENT)$(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
|
|
|
|
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*
|