Makefile
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jun 17 12:57:46 2007 +0000 (2007-06-17)
changeset 171 dfc760ec0060
parent 168 45811aef4097
child 172 7214624eb7b4
permissions -rw-r--r--
Speak of regtest in "make help".
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@88
     7
export CT_TOP_DIR=$(shell pwd)
yann@1
     8
yann@88
     9
# This is crosstool-ng version string
yann@88
    10
export CT_VERSION=$(shell cat $(CT_TOP_DIR)/version)
yann@1
    11
yann@135
    12
export CT_STOP=$(STOP)
yann@121
    13
export CT_RESTART=$(RESTART)
yann@121
    14
yann@1
    15
.PHONY: all
yann@85
    16
all: build
yann@1
    17
yann@1
    18
HOST_CC = gcc -funsigned-char
yann@1
    19
yann@1
    20
help::
yann@63
    21
	@echo  'Available make targets:'
yann@1
    22
	@echo
yann@1
    23
yann@1
    24
include $(CT_TOP_DIR)/kconfig/Makefile
yann@63
    25
include $(CT_TOP_DIR)/samples/Makefile
yann@1
    26
yann@1
    27
help::
yann@1
    28
	@echo  'Build targets:'
yann@19
    29
	@echo  '* build          - Build the toolchain'
yann@171
    30
	@echo  '  regtest        - Regtest-build all samples'
yann@19
    31
	@echo  '  clean          - Remove generated files'
yann@31
    32
	@echo  '  distclean      - Remove generated files, configuration and build directories'
yann@1
    33
yann@1
    34
include $(CT_TOP_DIR)/tools/Makefile
yann@136
    35
include $(CT_TOP_DIR)/Makefile.steps
yann@1
    36
yann@63
    37
help::
yann@129
    38
	@echo  'Distribution targets:'
yann@129
    39
	@echo  '  tarball        - Build a tarball of the configured toolchain'
yann@136
    40
	@echo  ''
yann@168
    41
	@echo  'Environement variables (see docs/overview.txt):'
yann@136
    42
	@echo  '  STOP           - Stop the build just after this step'
yann@136
    43
	@echo  '  RESTART        - Restart the build just before this step'
yann@147
    44
	@echo  ''
yann@63
    45
	@echo  'Execute "make" or "make all" to build all targets marked with [*]'
yann@63
    46
yann@158
    47
.config:
yann@158
    48
	@echo "You must run either one of \"make config\" or \"make menuconfig\" first"
yann@1
    49
yann@1
    50
# Actual build
yann@85
    51
build: .config
yann@1
    52
	@$(CT_TOP_DIR)/scripts/crosstool.sh
yann@1
    53
yann@87
    54
.PHONY: tarball
yann@87
    55
tarball:
yann@87
    56
	@$(CT_TOP_DIR)/scripts/tarball.sh
yann@87
    57
yann@1
    58
.PHONY: distclean
yann@1
    59
distclean:: clean
yann@1
    60
	@rm -f .config* ..config.tmp
yann@136
    61
	@rm -f log.*
yann@158
    62
	@[ ! -d "$(CT_TOP_DIR)/targets" ] || chmod -R u+w "$(CT_TOP_DIR)/targets"
yann@85
    63
	@rm -rf "$(CT_TOP_DIR)/targets"