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
|
|
|
|
2008-01-16 21:41:53 +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),
|
|
|
|
# got used to bashisms, and are enclined to easiness... So force use of
|
|
|
|
# bash. (Note: this is ugly, but ./configure checks for it).
|
|
|
|
export SHELL=/bin/bash
|
|
|
|
|
2007-09-11 17:14:28 +00:00
|
|
|
# This is where ct-ng is.
|
|
|
|
# Don't bother to change it other than with a new ./configure!
|
|
|
|
CT_NG:=@@CT_BINDIR@@/ct-ng
|
2007-07-01 19:04:20 +00:00
|
|
|
|
|
|
|
export CT_TOP_DIR:=$(shell pwd)
|
|
|
|
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
|
|
|
|
2008-10-21 16:13:46 +00:00
|
|
|
# Don't go parallel
|
|
|
|
.NOTPARALLEL:
|
|
|
|
|
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
|
|
|
|
2008-12-16 18:12:34 +00:00
|
|
|
.FORCE: $(FORCE)
|
2007-07-01 19:04:20 +00:00
|
|
|
.PHONY: $(PHONY)
|
|
|
|
PHONY += all
|
2007-07-02 19:40:54 +00:00
|
|
|
all: help
|
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
|
|
|
|
@echo 'Environement variables (see @@CT_DOCDIR@@/overview.txt):'
|
|
|
|
|
|
|
|
help-tail::
|
|
|
|
@echo
|
2008-10-14 19:29:25 +00:00
|
|
|
@echo 'Use action "config" or "menuconfig" to configure crosstool-NG'
|
|
|
|
@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
|
|
|
|
|
|
|
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::
|
|
|
|
|
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:
|
2008-10-17 12:47:53 +00:00
|
|
|
@echo ' There is no existing .config file!'
|
2007-07-01 19:04:20 +00:00
|
|
|
@false
|
|
|
|
|
|
|
|
# Actual build
|
2007-09-11 17:14:28 +00:00
|
|
|
build: .config
|
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
|
|
|
$(SILENT)$(CT_LIB_DIR)/scripts/crosstool.sh
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2007-09-11 17:14:28 +00:00
|
|
|
build.%:
|
2008-10-29 10:31:15 +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*
|
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) " CLEAN targets"
|
|
|
|
$(SILENT)chmod -R u+w targets >/dev/null 2>&1 || true
|
|
|
|
$(SILENT)rm -rf targets
|