blob: 0f272083886fc8979a5a0b6905ca4f7b2764748c [file] [log] [blame]
Stefan Reinauerd5779c12016-01-29 17:48:47 -08001##
2## This file is part of the coreboot project.
3##
4## Copyright (C) 2016 Google Inc.
5##
6## This program is free software; you can redistribute it and/or modify
7## it under the terms of the GNU General Public License as published by
8## the Free Software Foundation; version 2 of the License.
9##
10## This program is distributed in the hope that it will be useful,
11## but WITHOUT ANY WARRANTY; without even the implied warranty of
12## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13## GNU General Public License for more details.
14##
15
Stefan Reinauer0ca5f332016-02-02 17:51:39 -080016TOOLCHAIN_ARCHES := i386 x64 arm aarch64 mips riscv power8 nds32le
Patrick Georgi6c0ccfb2016-01-30 09:14:45 +010017
Stefan Reinauerd5779c12016-01-29 17:48:47 -080018help_toolchain help::
19 @echo '*** Toolchain targets ***'
20 @echo ' crossgcc - Build coreboot cross-compilers for all platforms'
21 @echo ' crosstools - Build coreboot cross-compiler and GDB for all platforms'
22 @echo ' crossgcc-clean - Remove all built coreboot cross-compilers'
23 @echo ' iasl - Build coreboot IASL compiler (built by all cross targets)'
24 @echo ' clang - Build coreboot clang compiler'
25 @echo ' test-toolchain - Reports if toolchain components are out of date'
26 @echo ' crossgcc-ARCH - Build cross-compiler for specific architecture'
27 @echo ' crosstools-ARCH - Build cross-compiler with GDB for specific architecture'
Patrick Georgi6c0ccfb2016-01-30 09:14:45 +010028 @echo ' ARCH can be "$(subst $(spc),"$(comma) ",$(TOOLCHAIN_ARCHES))"'
Stefan Reinauerd5779c12016-01-29 17:48:47 -080029 @echo ' Use "make [target] CPUS=#" to build toolchain using multiple cores'
30 @echo
31
32# For the toolchain builds, use CPUS=x to use multiple processors to build
33# use BUILDGCC_OPTIONS= to set any crossgcc command line options
34# Example: BUILDGCC_OPTIONS='-t' will keep temporary files after build
35crossgcc: clean-for-update
36 $(MAKE) -C util/crossgcc all_without_gdb SKIP_CLANG=1
37
38.PHONY: crossgcc crossgcc-i386 crossgcc-x64 crossgcc-arm crossgcc-aarch64 \
39 crossgcc-mips crossgcc-riscv crossgcc-power8 crossgcc-clean iasl \
40 clang crosstools-i386 crosstools-x64 crosstools-arm \
41 crosstools-aarch64 crosstools-mips crosstools-riscv crosstools-power8
42
Patrick Georgi6c0ccfb2016-01-30 09:14:45 +010043$(foreach arch,$(TOOLCHAIN_ARCHES),crossgcc-$(arch)): clean-for-update
Patrick Georgi3df92622016-02-02 19:33:00 +010044 $(MAKE) -C util/crossgcc $(patsubst crossgcc-%,build-%,$@) build_iasl SKIP_GDB=1
Stefan Reinauerd5779c12016-01-29 17:48:47 -080045
46crosstools: clean-for-update
47 $(MAKE) -C util/crossgcc all_with_gdb SKIP_CLANG=1
48
49iasl: clean-for-update
50 $(MAKE) -C util/crossgcc build_iasl
51
52clang: clean-for-update
53 $(MAKE) -C util/crossgcc build_clang
54
Patrick Georgi6c0ccfb2016-01-30 09:14:45 +010055$(foreach arch,$(TOOLCHAIN_ARCHES),crosstools-$(arch)): clean-for-update
Patrick Georgi3df92622016-02-02 19:33:00 +010056 $(MAKE) -C util/crossgcc $(patsubst crosstools-%,build-%,$@) build_iasl
Stefan Reinauerd5779c12016-01-29 17:48:47 -080057
58crossgcc-clean: clean-for-update
59 $(MAKE) -C util/crossgcc clean
60
61test-toolchain:
62ifeq ($(COMPILER_OUT_OF_DATE),1)
63 echo "The coreboot toolchain is not the current version."
64 $(error )
65else
66 echo "The coreboot toolchain is the current version."
67endif # ifeq ($(COMPILER_OUT_OF_DATE),1)