1 ## SPDX-License-Identifier: GPL-2.0-only
3 TOOLCHAIN_ARCHES := i386 x64 arm aarch64 riscv ppc64 nds32le
6 @echo '*** Toolchain targets ***'
7 @echo ' crossgcc - Build coreboot cross-compilers for all platforms'
8 @echo ' crossgcc-clean - Remove all built coreboot cross-compilers'
9 @echo ' iasl - Build coreboot IASL compiler (built by all cross targets)'
10 @echo ' clang - Build coreboot clang compiler'
11 @echo ' nasm - Build coreboot nasm'
12 @echo ' test-toolchain - Reports if toolchain components are out of date'
13 @echo ' crossgcc-ARCH - Build cross-compiler for specific architecture'
14 @echo ' ARCH can be "$(subst $(spc),"$(comma) ",$(TOOLCHAIN_ARCHES))"'
15 @echo ' Use "make [target] CPUS=#" to build toolchain using multiple cores'
16 @echo ' Use "make [target] DEST=some/path" to install toolchain there'
19 # For the toolchain builds, use CPUS=x to use multiple processors to build
20 # use BUILDGCC_OPTIONS= to set any crossgcc command line options
21 # Example: BUILDGCC_OPTIONS='-t' will keep temporary files after build
22 crossgcc: clean-for-update
23 $(MAKE) -C util/crossgcc all SKIP_CLANG=1
25 .PHONY: crossgcc crossgcc-i386 crossgcc-x64 crossgcc-arm crossgcc-aarch64 \
26 crossgcc-riscv crossgcc-power8 crossgcc-clean iasl \
27 clang jenkins-build-toolchain nasm
29 $(foreach arch,$(TOOLCHAIN_ARCHES),crossgcc-$(arch)): clean-for-update
30 $(MAKE) -C util/crossgcc $(patsubst crossgcc-%,build-%,$@) build_iasl
32 iasl: clean-for-update
33 $(MAKE) -C util/crossgcc build_iasl
35 clang: clean-for-update
36 $(MAKE) -C util/crossgcc build_clang
38 nasm: clean-for-update
39 $(MAKE) -C util/crossgcc build_nasm
41 crossgcc-clean: clean-for-update
42 $(MAKE) -C util/crossgcc clean
45 ifeq ($(COMPILER_OUT_OF_DATE),1)
46 echo "The coreboot toolchain is not the current version."
49 echo "The coreboot toolchain is the current version."
50 endif # ifeq ($(COMPILER_OUT_OF_DATE),1)
52 # This target controls what the jenkins builder tests
53 jenkins-build-toolchain: BUILDGCC_OPTIONS ?= -y --nocolor
54 jenkins-build-toolchain:
55 $(MAKE) crossgcc clang KEEP_SOURCES=1 BUILDGCC_OPTIONS='$(BUILDGCC_OPTIONS)'
56 PATH=$(if $(DEST),$(DEST)/bin,$(top)/util/crossgcc/xgcc/bin):$$PATH; $(MAKE) what-jenkins-does
57 PATH=$(if $(DEST),$(DEST)/bin,$(top)/util/crossgcc/xgcc/bin):$$PATH; $(MAKE) test-toolchain