Makefile
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Thu May 10 21:33:35 2007 +0000 (2007-05-10)
changeset 85 ac2845835b13
parent 65 312fe9ff8370
child 87 adb773fccc6b
permissions -rw-r--r--
Update the way we handle directories supplied by the user:
- the tarball directory is considered as a local copy, and tarballs are copied to a working area,
- the sources and build directories (CT_SRC_DIR and CT_BUILD_DIR) are now computed, and no longer an option,
- the build dir has been renamed from 'build' to 'targets'.
That should ease preparing a tarball of the resulting target.
yann@1
     1
# Makefile for crosstool-NG.
yann@1
     2
# Copyright 2006 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
yann@1
     3
yann@65
     4
# Don't print directory as we descend into them
yann@65
     5
MAKEFLAGS += --no-print-directory
yann@65
     6
yann@1
     7
# The project version
yann@33
     8
export PROJECTVERSION=0.0.2-svn
yann@1
     9
yann@1
    10
# This should eventually be computed if compiling out-of-tree is implemented
yann@1
    11
export CT_TOP_DIR=$(shell pwd)
yann@1
    12
yann@1
    13
.PHONY: all
yann@85
    14
all: build
yann@1
    15
yann@1
    16
HOST_CC = gcc -funsigned-char
yann@1
    17
yann@1
    18
help::
yann@63
    19
	@echo  'Available make targets:'
yann@1
    20
	@echo
yann@1
    21
yann@1
    22
include $(CT_TOP_DIR)/kconfig/Makefile
yann@63
    23
include $(CT_TOP_DIR)/samples/Makefile
yann@1
    24
yann@1
    25
help::
yann@1
    26
	@echo  'Build targets:'
yann@19
    27
	@echo  '* build          - Build the toolchain'
yann@19
    28
	@echo  '  clean          - Remove generated files'
yann@31
    29
	@echo  '  distclean      - Remove generated files, configuration and build directories'
yann@1
    30
yann@1
    31
include $(CT_TOP_DIR)/tools/Makefile
yann@1
    32
yann@63
    33
help::
yann@63
    34
	@echo  'Execute "make" or "make all" to build all targets marked with [*]'
yann@63
    35
yann@44
    36
.config: $(shell find $(CT_TOP_DIR)/config -type f -name '*.in')
yann@1
    37
	@make menuconfig
yann@1
    38
	@# Because exiting menuconfig without saving is not an error to menuconfig
yann@1
    39
	@test -f .config
yann@1
    40
yann@1
    41
# Actual build
yann@85
    42
build: .config
yann@1
    43
	@$(CT_TOP_DIR)/scripts/crosstool.sh
yann@1
    44
yann@1
    45
.PHONY: distclean
yann@1
    46
distclean:: clean
yann@1
    47
	@rm -f .config* ..config.tmp
yann@85
    48
	@rm -rf "$(CT_TOP_DIR)/targets"