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 ' crosstools - Build coreboot cross-compiler and GDB for all platforms'
9 @echo ' crossgcc-clean - Remove all built coreboot cross-compilers'
10 @echo ' iasl - Build coreboot IASL compiler (built by all cross targets)'
11 @echo ' clang - Build coreboot clang compiler'
12 @echo ' nasm - Build coreboot nasm'
13 @echo ' test-toolchain - Reports if toolchain components are out of date'
14 @echo ' crossgcc-ARCH - Build cross-compiler for specific architecture'
15 @echo ' crosstools-ARCH - Build cross-compiler with GDB for specific architecture'
16 @echo ' ARCH can be "$(subst $(spc),"$(comma) ",$(TOOLCHAIN_ARCHES))"'
17 @echo ' Use "make [target] CPUS=#" to build toolchain using multiple cores'
18 @echo ' Use "make [target] DEST=some/path" to install toolchain there'
21 # For the toolchain builds, use CPUS=x to use multiple processors to build
22 # use BUILDGCC_OPTIONS= to set any crossgcc command line options
23 # Example: BUILDGCC_OPTIONS='-t' will keep temporary files after build
24 crossgcc: clean-for-update
25 $(MAKE) -C util/crossgcc all_without_gdb SKIP_CLANG=1
27 .PHONY: crossgcc crossgcc-i386 crossgcc-x64 crossgcc-arm crossgcc-aarch64 \
28 crossgcc-riscv crossgcc-power8 crossgcc-clean iasl \
29 clang crosstools-i386 crosstools-x64 crosstools-arm \
30 crosstools-aarch64 crosstools-riscv crosstools-power8 \
31 jenkins-build-toolchain nasm
33 $(foreach arch,$(TOOLCHAIN_ARCHES),crossgcc-$(arch)): clean-for-update
34 $(MAKE) -C util/crossgcc $(patsubst crossgcc-%,build-%,$@) build_iasl SKIP_GDB=1
36 crosstools: clean-for-update
37 $(MAKE) -C util/crossgcc all_with_gdb SKIP_CLANG=1
39 iasl: clean-for-update
40 $(MAKE) -C util/crossgcc build_iasl
42 clang: clean-for-update
43 $(MAKE) -C util/crossgcc build_clang
45 nasm: clean-for-update
46 $(MAKE) -C util/crossgcc build_nasm
48 $(foreach arch,$(TOOLCHAIN_ARCHES),crosstools-$(arch)): clean-for-update
49 $(MAKE) -C util/crossgcc $(patsubst crosstools-%,build-%,$@) build_iasl
51 crossgcc-clean: clean-for-update
52 $(MAKE) -C util/crossgcc clean
55 ifeq ($(COMPILER_OUT_OF_DATE),1)
56 echo "The coreboot toolchain is not the current version."
59 echo "The coreboot toolchain is the current version."
60 endif # ifeq ($(COMPILER_OUT_OF_DATE),1)
62 # This target controls what the jenkins builder tests
63 jenkins-build-toolchain: BUILDGCC_OPTIONS ?= -y --nocolor
64 jenkins-build-toolchain:
65 $(MAKE) crossgcc clang KEEP_SOURCES=1 BUILDGCC_OPTIONS='$(BUILDGCC_OPTIONS)'
66 #TODO: Re-enable gdb build after the builders can build it again.
67 #$(MAKE) crosstools clang KEEP_SOURCES=1 BUILDGCC_OPTIONS='$(BUILDGCC_OPTIONS)'
69 PATH=$(if $(DEST),$(DEST)/bin,$(top)/util/crossgcc/xgcc/bin):$$PATH; $(MAKE) what-jenkins-does
71 PATH=$(if $(DEST),$(DEST)/bin,$(top)/util/crossgcc/xgcc/bin):$$PATH; $(MAKE) test-toolchain