blob: a52fbf134fc4d6cadec511b86c01923142e7c470 [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::
6 @echo '*** Toolchain targets ***'
7 @echo ' crossgcc - Build coreboot cross-compilers for all platforms'
Stefan Reinauerd5779c12016-01-29 17:48:47 -08008 @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'
Martin Rothd70f5fa2019-05-26 17:24:19 -060011 @echo ' nasm - Build coreboot nasm'
Stefan Reinauerd5779c12016-01-29 17:48:47 -080012 @echo ' test-toolchain - Reports if toolchain components are out of date'
13 @echo ' crossgcc-ARCH - Build cross-compiler for specific architecture'
Patrick Georgi6c0ccfb2016-01-30 09:14:45 +010014 @echo ' ARCH can be "$(subst $(spc),"$(comma) ",$(TOOLCHAIN_ARCHES))"'
Stefan Reinauerd5779c12016-01-29 17:48:47 -080015 @echo ' Use "make [target] CPUS=#" to build toolchain using multiple cores'
Patrick Georgid971e762018-11-24 23:14:45 +010016 @echo ' Use "make [target] DEST=some/path" to install toolchain there'
Stefan Reinauerd5779c12016-01-29 17:48:47 -080017 @echo
18
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
22crossgcc: clean-for-update
Patrick Georgif32eed12021-10-16 10:50:00 +020023 $(MAKE) -C util/crossgcc all SKIP_CLANG=1
Stefan Reinauerd5779c12016-01-29 17:48:47 -080024
25.PHONY: crossgcc crossgcc-i386 crossgcc-x64 crossgcc-arm crossgcc-aarch64 \
Julius Wernerf96d9052019-08-16 15:35:39 -070026 crossgcc-riscv crossgcc-power8 crossgcc-clean iasl \
Patrick Georgif32eed12021-10-16 10:50:00 +020027 clang jenkins-build-toolchain nasm
Stefan Reinauerd5779c12016-01-29 17:48:47 -080028
Patrick Georgi6c0ccfb2016-01-30 09:14:45 +010029$(foreach arch,$(TOOLCHAIN_ARCHES),crossgcc-$(arch)): clean-for-update
Patrick Georgif32eed12021-10-16 10:50:00 +020030 $(MAKE) -C util/crossgcc $(patsubst crossgcc-%,build-%,$@) build_iasl
Stefan Reinauerd5779c12016-01-29 17:48:47 -080031
32iasl: clean-for-update
33 $(MAKE) -C util/crossgcc build_iasl
34
35clang: clean-for-update
36 $(MAKE) -C util/crossgcc build_clang
37
Martin Rothd70f5fa2019-05-26 17:24:19 -060038nasm: clean-for-update
39 $(MAKE) -C util/crossgcc build_nasm
40
Stefan Reinauerd5779c12016-01-29 17:48:47 -080041crossgcc-clean: clean-for-update
42 $(MAKE) -C util/crossgcc clean
43
44test-toolchain:
45ifeq ($(COMPILER_OUT_OF_DATE),1)
46 echo "The coreboot toolchain is not the current version."
47 $(error )
48else
49 echo "The coreboot toolchain is the current version."
50endif # ifeq ($(COMPILER_OUT_OF_DATE),1)
Martin Roth21148802016-03-08 09:27:45 -070051
52# This target controls what the jenkins builder tests
Martin Rothab8f7d32016-12-07 10:45:55 -070053jenkins-build-toolchain: BUILDGCC_OPTIONS ?= -y --nocolor
Martin Roth21148802016-03-08 09:27:45 -070054jenkins-build-toolchain:
Martin Rothe7a50622020-03-15 09:43:31 -060055 $(MAKE) crossgcc clang KEEP_SOURCES=1 BUILDGCC_OPTIONS='$(BUILDGCC_OPTIONS)'
Martin Rotha5395802016-04-02 11:10:08 -060056 PATH=$(if $(DEST),$(DEST)/bin,$(top)/util/crossgcc/xgcc/bin):$$PATH; $(MAKE) what-jenkins-does
Martin Rotha5395802016-04-02 11:10:08 -060057 PATH=$(if $(DEST),$(DEST)/bin,$(top)/util/crossgcc/xgcc/bin):$$PATH; $(MAKE) test-toolchain