2007-07-23 09:46:05 +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
|
2007-07-23 09:46:05 +00:00
|
|
|
MAKEFLAGS += --no-print-directory --no-builtin-rules
|
2007-07-01 19:04:20 +00:00
|
|
|
|
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
|
2007-08-15 15:39:44 +00:00
|
|
|
export CT_VERSION:=$(shell cat $(CT_LIB_DIR)/.version)
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2007-08-15 15:39:44 +00:00
|
|
|
export CT_STOP:=$(STOP)
|
|
|
|
export CT_RESTART:=$(RESTART)
|
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
|
|
|
|
2007-07-22 16:36:20 +00:00
|
|
|
HOST_CC := gcc -funsigned-char
|
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
|
|
|
|
|
|
|
help-head::
|
2007-07-02 19:40:54 +00:00
|
|
|
@echo 'Available actions:'
|
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
|
2007-07-09 20:55:32 +00:00
|
|
|
@echo 'Preconfigured toolchains:'
|
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
|
2007-07-02 19:40:54 +00:00
|
|
|
@echo 'Execute "$(CT_NG) config" or "$(CT_NG) menuconfig" to configure crosstool-NG'
|
|
|
|
@echo 'Execute "$(CT_NG) build" to build your toolchain'
|
2007-07-16 16:34:36 +00:00
|
|
|
@echo 'Execute "$(CT_NG) 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
|
|
|
|
|
|
|
# End help system
|
|
|
|
|
|
|
|
help-build::
|
2007-08-15 14:59:37 +00:00
|
|
|
@echo ' build[.#] - Build the 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
|
|
|
|
include $(CT_LIB_DIR)/tools/tools.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::
|
2007-08-15 14:59:37 +00:00
|
|
|
@echo ' STOP - Stop the build just after this step'
|
|
|
|
@echo ' RESTART - Restart the build just before this step'
|
2007-07-01 19:04:20 +00:00
|
|
|
|
|
|
|
.config:
|
|
|
|
@echo 'You must run either one of "$(CT_NG) config" or "$(CT_NG) menuconfig" first'
|
|
|
|
@false
|
|
|
|
|
|
|
|
# Actual build
|
2007-09-11 17:14:28 +00:00
|
|
|
build: .config
|
2007-07-01 19:04:20 +00:00
|
|
|
@$(CT_LIB_DIR)/scripts/crosstool.sh
|
|
|
|
|
2007-09-11 17:14:28 +00:00
|
|
|
build.%:
|
2007-08-15 14:59:37 +00:00
|
|
|
@$(CT_NG) $(shell echo "$(@)" |sed -r -e 's|^([^.]+)\.([[:digit:]]+)$$|\1 CT_JOBS=\2|;')
|
|
|
|
|
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:
|
2007-07-16 16:34:36 +00:00
|
|
|
@echo 'Tarbal 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)'
|
2007-07-16 16:34:36 +00:00
|
|
|
|
2007-07-01 19:04:20 +00:00
|
|
|
PHONY += clean
|
|
|
|
clean::
|
|
|
|
@rm -f $(CT_TOP_DIR)/.config.*
|
|
|
|
|
|
|
|
PHONY += distclean
|
|
|
|
distclean:: clean
|
|
|
|
@rm -f $(CT_TOP_DIR)/.config* $(CT_TOP_DIR)/..config.tmp
|
|
|
|
@rm -f $(CT_TOP_DIR)/log.*
|
|
|
|
@[ ! -d "$(CT_TOP_DIR)/targets" ] || chmod -R u+w "$(CT_TOP_DIR)/targets"
|
|
|
|
@rm -rf "$(CT_TOP_DIR)/targets"
|