blob: 8a4f3c53a2d206ddec4ac5b06422c7b737576a04 [file] [log] [blame]
Patrick Georgi7333a112020-05-08 20:48:04 +02001## SPDX-License-Identifier: GPL-2.0-only
Stefan Reinauerd5779c12016-01-29 17:48:47 -08002
Julius Wernerf96d9052019-08-16 15:35:39 -07003TOOLCHAIN_ARCHES := i386 x64 arm aarch64 riscv ppc64 nds32le
Patrick Georgi6c0ccfb2016-01-30 09:14:45 +01004
Stefan Reinauerd5779c12016-01-29 17:48:47 -08005help_toolchain help::
Martin Roth3b32af92022-11-27 12:55:31 -07006 @echo
Stefan Reinauerd5779c12016-01-29 17:48:47 -08007 @echo '*** Toolchain targets ***'
8 @echo ' crossgcc - Build coreboot cross-compilers for all platforms'
Stefan Reinauerd5779c12016-01-29 17:48:47 -08009 @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'
Martin Rothd70f5fa2019-05-26 17:24:19 -060012 @echo ' nasm - Build coreboot nasm'
Stefan Reinauerd5779c12016-01-29 17:48:47 -080013 @echo ' test-toolchain - Reports if toolchain components are out of date'
14 @echo ' crossgcc-ARCH - Build cross-compiler for specific architecture'
Patrick Georgi6c0ccfb2016-01-30 09:14:45 +010015 @echo ' ARCH can be "$(subst $(spc),"$(comma) ",$(TOOLCHAIN_ARCHES))"'
Stefan Reinauerd5779c12016-01-29 17:48:47 -080016 @echo ' Use "make [target] CPUS=#" to build toolchain using multiple cores'
Patrick Georgid971e762018-11-24 23:14:45 +010017 @echo ' Use "make [target] DEST=some/path" to install toolchain there'
Felix Singer16a444c2023-01-10 03:35:04 +010018 @echo ' Use "make [target] BUILDGCC_OPTIONS="-m" to get packages from coreboot mirror"'
Stefan Reinauerd5779c12016-01-29 17:48:47 -080019 @echo
20
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
24crossgcc: clean-for-update
Patrick Georgif32eed12021-10-16 10:50:00 +020025 $(MAKE) -C util/crossgcc all SKIP_CLANG=1
Stefan Reinauerd5779c12016-01-29 17:48:47 -080026
27.PHONY: crossgcc crossgcc-i386 crossgcc-x64 crossgcc-arm crossgcc-aarch64 \
Julius Wernerf96d9052019-08-16 15:35:39 -070028 crossgcc-riscv crossgcc-power8 crossgcc-clean iasl \
Patrick Georgif32eed12021-10-16 10:50:00 +020029 clang jenkins-build-toolchain nasm
Stefan Reinauerd5779c12016-01-29 17:48:47 -080030
Patrick Georgi6c0ccfb2016-01-30 09:14:45 +010031$(foreach arch,$(TOOLCHAIN_ARCHES),crossgcc-$(arch)): clean-for-update
Patrick Georgif32eed12021-10-16 10:50:00 +020032 $(MAKE) -C util/crossgcc $(patsubst crossgcc-%,build-%,$@) build_iasl
Stefan Reinauerd5779c12016-01-29 17:48:47 -080033
34iasl: clean-for-update
35 $(MAKE) -C util/crossgcc build_iasl
36
37clang: clean-for-update
38 $(MAKE) -C util/crossgcc build_clang
39
Martin Rothd70f5fa2019-05-26 17:24:19 -060040nasm: clean-for-update
41 $(MAKE) -C util/crossgcc build_nasm
42
Stefan Reinauerd5779c12016-01-29 17:48:47 -080043crossgcc-clean: clean-for-update
44 $(MAKE) -C util/crossgcc clean
45
46test-toolchain:
47ifeq ($(COMPILER_OUT_OF_DATE),1)
48 echo "The coreboot toolchain is not the current version."
49 $(error )
50else
51 echo "The coreboot toolchain is the current version."
52endif # ifeq ($(COMPILER_OUT_OF_DATE),1)
Martin Roth21148802016-03-08 09:27:45 -070053
54# This target controls what the jenkins builder tests
Martin Rothab8f7d32016-12-07 10:45:55 -070055jenkins-build-toolchain: BUILDGCC_OPTIONS ?= -y --nocolor
Martin Roth21148802016-03-08 09:27:45 -070056jenkins-build-toolchain:
Martin Rothe7a50622020-03-15 09:43:31 -060057 $(MAKE) crossgcc clang KEEP_SOURCES=1 BUILDGCC_OPTIONS='$(BUILDGCC_OPTIONS)'
Martin Rotha5395802016-04-02 11:10:08 -060058 PATH=$(if $(DEST),$(DEST)/bin,$(top)/util/crossgcc/xgcc/bin):$$PATH; $(MAKE) what-jenkins-does
Martin Rotha5395802016-04-02 11:10:08 -060059 PATH=$(if $(DEST),$(DEST)/bin,$(top)/util/crossgcc/xgcc/bin):$$PATH; $(MAKE) test-toolchain