2007-07-01 19:04:20 +00:00
|
|
|
#!@@CT_MAKE@@ -f
|
|
|
|
# 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-22 17:44:27 +00:00
|
|
|
MAKEFLAGS += --no-print-directory --no-builtin-rules
|
2007-07-01 19:04:20 +00:00
|
|
|
|
|
|
|
# Remember the name of the Makefile
|
|
|
|
CT_MAKEFILE := $(lastword $(MAKEFILE_LIST))
|
|
|
|
CT_NG := $(shell echo '$(CT_MAKEFILE)' |sed -r -e 's,($(subst :,|,$(PATH)))/,,;')
|
|
|
|
|
|
|
|
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-07-01 19:04:20 +00:00
|
|
|
export CT_VERSION=$(shell cat $(CT_LIB_DIR)/version)
|
|
|
|
|
|
|
|
export CT_STOP=$(STOP)
|
|
|
|
export CT_RESTART=$(RESTART)
|
|
|
|
|
|
|
|
.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-07-02 19:40:54 +00:00
|
|
|
@echo 'Build actions:'
|
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-07-02 19:40:54 +00:00
|
|
|
@echo ' build - Build the toolchain'
|
2007-07-09 20:55:32 +00:00
|
|
|
|
|
|
|
help-clean::
|
2007-07-01 19:04:20 +00:00
|
|
|
@echo ' clean - Remove generated files'
|
|
|
|
@echo ' distclean - Remove generated files, configuration and build directories'
|
|
|
|
|
2007-07-15 09:09:04 +00:00
|
|
|
include $(CT_LIB_DIR)/kconfig/kconfig.mk
|
|
|
|
include $(CT_LIB_DIR)/samples/samples.mk
|
|
|
|
include $(CT_LIB_DIR)/tools/tools.mk
|
|
|
|
include $(CT_LIB_DIR)/steps.mk
|
2007-07-01 19:04:20 +00:00
|
|
|
|
|
|
|
help-distrib::
|
|
|
|
@echo ' tarball - Build a tarball of the configured toolchain'
|
|
|
|
|
|
|
|
help-env::
|
|
|
|
@echo ' STOP - Stop the build just after this step'
|
|
|
|
@echo ' RESTART - Restart the build just before this step'
|
|
|
|
|
|
|
|
.config:
|
|
|
|
@echo 'You must run either one of "$(CT_NG) config" or "$(CT_NG) menuconfig" first'
|
|
|
|
@false
|
|
|
|
|
|
|
|
# Actual build
|
|
|
|
build:: .config
|
|
|
|
@$(CT_LIB_DIR)/scripts/crosstool.sh
|
|
|
|
|
|
|
|
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"
|