2009-01-18 15:40:02 +00:00
|
|
|
#!@@CT_make@@ -rf
|
2007-07-01 19:04:20 +00:00
|
|
|
# Makefile for crosstool-NG.
|
|
|
|
# Copyright 2006 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
|
|
|
|
|
|
|
|
# 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:
|
|
|
|
export CT_NG:=$(lastword $(MAKEFILE_LIST))
|
|
|
|
# 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),
|
|
|
|
# got used to bashisms, and are enclined to easiness... So force use of
|
|
|
|
# bash.
|
|
|
|
export SHELL=$(bash)
|
2008-10-21 16:13:46 +00:00
|
|
|
|
2009-12-29 20:16:51 +00:00
|
|
|
# GREP_OPTIONS=--color=always will break the generated .in files
|
|
|
|
# We do not need any GREP_OPTIONS anyway, so set it to empty.
|
|
|
|
export GREP_OPTIONS=
|
|
|
|
|
2009-01-26 18:36:02 +00:00
|
|
|
# Make the restart/stop steps availabe 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=@
|
|
|
|
ECHO=echo
|
|
|
|
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=@
|
|
|
|
ECHO=:
|
|
|
|
else
|
|
|
|
ifeq ($(strip $(V)),1)
|
|
|
|
SILENT=
|
|
|
|
ECHO=:
|
2008-10-21 16:13:46 +00:00
|
|
|
else
|
|
|
|
ifeq ($(strip $(V)),2)
|
|
|
|
SILENT=
|
|
|
|
ECHO=echo
|
2008-10-21 16:56:32 +00:00
|
|
|
endif # V == 2
|
|
|
|
endif # V== 1
|
|
|
|
endif # V == 0
|
|
|
|
endif # origin V
|
2008-10-28 21:47:12 +00:00
|
|
|
export V SILENT 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
|
2010-08-14 14:37:11 +00:00
|
|
|
@echo 'Environement 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'
|
2007-07-01 21:21:11 +00:00
|
|
|
@echo 'See "man 1 ct-ng" for some help as well'
|
2007-07-01 19:04:20 +00:00
|
|
|
|
|
|
|
help-build::
|
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
|
|
|
|
2008-10-18 18:37:28 +00:00
|
|
|
include $(CT_LIB_DIR)/config/config.mk
|
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::
|
2007-08-15 14:59:37 +00:00
|
|
|
@echo ' tarball - Build a tarball of the configured toolchain'
|
2007-07-01 19:04:20 +00:00
|
|
|
|
|
|
|
help-env::
|
2010-04-01 22:18:26 +00:00
|
|
|
@echo ' V=0|1|2 - 0 => show only human-readable messages (default)'
|
|
|
|
@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
|
|
|
|
|
2009-05-13 18:10:47 +00:00
|
|
|
show-tuple: .config
|
|
|
|
$(SILENT)$(bash) $(CT_LIB_DIR)/scripts/showTuple.sh
|
|
|
|
|
2007-07-01 19:04:20 +00:00
|
|
|
# Actual build
|
2007-09-11 17:14:28 +00:00
|
|
|
build: .config
|
2009-01-18 17:45:10 +00:00
|
|
|
$(SILENT)$(CT_LIB_DIR)/scripts/crosstool-NG.sh
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2007-09-11 17:14:28 +00:00
|
|
|
build.%:
|
2009-01-26 18:36:02 +00:00
|
|
|
$(SILENT)$(MAKE) -rf $(CT_NG) $(shell echo "$(@)" |$(sed) -r -e 's|^([^.]+)\.([[:digit:]]+)$$|\1 CT_JOBS=\2|;')
|
2007-08-15 14:59:37 +00:00
|
|
|
|
2007-07-01 19:04:20 +00:00
|
|
|
PHONY += tarball
|
2007-07-07 21:10:30 +00:00
|
|
|
#tarball:
|
|
|
|
# @$(CT_LIB_DIR)/scripts/tarball.sh
|
2007-07-01 19:04:20 +00:00
|
|
|
tarball:
|
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
|
|
|
@echo 'Tarball creation disabled for now... Sorry.'
|
2007-07-07 21:10:30 +00:00
|
|
|
@true
|
2007-07-01 19:04:20 +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
|
|
|
|
@echo 'Copyright (C) 2008 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>'
|
|
|
|
@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::
|
2008-10-21 16:13:46 +00:00
|
|
|
@$(ECHO) " CLEAN log"
|
|
|
|
$(SILENT)rm -f log.* .config.* ..config*
|
2007-07-01 19:04:20 +00:00
|
|
|
|
|
|
|
PHONY += distclean
|
|
|
|
distclean:: clean
|
2008-10-21 16:13:46 +00:00
|
|
|
@$(ECHO) " CLEAN .config"
|
|
|
|
$(SILENT)rm -f .config .config.* ..config*
|
2010-10-05 21:59:16 +00:00
|
|
|
@$(ECHO) " CLEAN build dir"
|
2010-10-06 20:54:48 +00:00
|
|
|
$(SILENT)[ ! -d targets ] || chmod -R u+w targets
|
|
|
|
$(SILENT)[ ! -d .build ] || chmod -R u+w .build
|
2010-10-05 21:59:16 +00:00
|
|
|
$(SILENT)rm -rf targets .build
|