Patrick Georgi | 7333a11 | 2020-05-08 20:48:04 +0200 | [diff] [blame] | 1 | ## SPDX-License-Identifier: GPL-2.0-only |
Stefan Reinauer | d5779c1 | 2016-01-29 17:48:47 -0800 | [diff] [blame] | 2 | |
Julius Werner | f96d905 | 2019-08-16 15:35:39 -0700 | [diff] [blame] | 3 | TOOLCHAIN_ARCHES := i386 x64 arm aarch64 riscv ppc64 nds32le |
Patrick Georgi | 6c0ccfb | 2016-01-30 09:14:45 +0100 | [diff] [blame] | 4 | |
Stefan Reinauer | d5779c1 | 2016-01-29 17:48:47 -0800 | [diff] [blame] | 5 | help_toolchain help:: |
Martin Roth | 3b32af9 | 2022-11-27 12:55:31 -0700 | [diff] [blame] | 6 | @echo |
Stefan Reinauer | d5779c1 | 2016-01-29 17:48:47 -0800 | [diff] [blame] | 7 | @echo '*** Toolchain targets ***' |
| 8 | @echo ' crossgcc - Build coreboot cross-compilers for all platforms' |
Stefan Reinauer | d5779c1 | 2016-01-29 17:48:47 -0800 | [diff] [blame] | 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' |
Martin Roth | d70f5fa | 2019-05-26 17:24:19 -0600 | [diff] [blame] | 12 | @echo ' nasm - Build coreboot nasm' |
Stefan Reinauer | d5779c1 | 2016-01-29 17:48:47 -0800 | [diff] [blame] | 13 | @echo ' test-toolchain - Reports if toolchain components are out of date' |
| 14 | @echo ' crossgcc-ARCH - Build cross-compiler for specific architecture' |
Patrick Georgi | 6c0ccfb | 2016-01-30 09:14:45 +0100 | [diff] [blame] | 15 | @echo ' ARCH can be "$(subst $(spc),"$(comma) ",$(TOOLCHAIN_ARCHES))"' |
Stefan Reinauer | d5779c1 | 2016-01-29 17:48:47 -0800 | [diff] [blame] | 16 | @echo ' Use "make [target] CPUS=#" to build toolchain using multiple cores' |
Patrick Georgi | d971e76 | 2018-11-24 23:14:45 +0100 | [diff] [blame] | 17 | @echo ' Use "make [target] DEST=some/path" to install toolchain there' |
Felix Singer | 16a444c | 2023-01-10 03:35:04 +0100 | [diff] [blame] | 18 | @echo ' Use "make [target] BUILDGCC_OPTIONS="-m" to get packages from coreboot mirror"' |
Stefan Reinauer | d5779c1 | 2016-01-29 17:48:47 -0800 | [diff] [blame] | 19 | @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 |
| 24 | crossgcc: clean-for-update |
Patrick Georgi | f32eed1 | 2021-10-16 10:50:00 +0200 | [diff] [blame] | 25 | $(MAKE) -C util/crossgcc all SKIP_CLANG=1 |
Stefan Reinauer | d5779c1 | 2016-01-29 17:48:47 -0800 | [diff] [blame] | 26 | |
| 27 | .PHONY: crossgcc crossgcc-i386 crossgcc-x64 crossgcc-arm crossgcc-aarch64 \ |
Julius Werner | f96d905 | 2019-08-16 15:35:39 -0700 | [diff] [blame] | 28 | crossgcc-riscv crossgcc-power8 crossgcc-clean iasl \ |
Patrick Georgi | f32eed1 | 2021-10-16 10:50:00 +0200 | [diff] [blame] | 29 | clang jenkins-build-toolchain nasm |
Stefan Reinauer | d5779c1 | 2016-01-29 17:48:47 -0800 | [diff] [blame] | 30 | |
Patrick Georgi | 6c0ccfb | 2016-01-30 09:14:45 +0100 | [diff] [blame] | 31 | $(foreach arch,$(TOOLCHAIN_ARCHES),crossgcc-$(arch)): clean-for-update |
Patrick Georgi | f32eed1 | 2021-10-16 10:50:00 +0200 | [diff] [blame] | 32 | $(MAKE) -C util/crossgcc $(patsubst crossgcc-%,build-%,$@) build_iasl |
Stefan Reinauer | d5779c1 | 2016-01-29 17:48:47 -0800 | [diff] [blame] | 33 | |
| 34 | iasl: clean-for-update |
| 35 | $(MAKE) -C util/crossgcc build_iasl |
| 36 | |
| 37 | clang: clean-for-update |
| 38 | $(MAKE) -C util/crossgcc build_clang |
| 39 | |
Martin Roth | d70f5fa | 2019-05-26 17:24:19 -0600 | [diff] [blame] | 40 | nasm: clean-for-update |
| 41 | $(MAKE) -C util/crossgcc build_nasm |
| 42 | |
Stefan Reinauer | d5779c1 | 2016-01-29 17:48:47 -0800 | [diff] [blame] | 43 | crossgcc-clean: clean-for-update |
| 44 | $(MAKE) -C util/crossgcc clean |
| 45 | |
| 46 | test-toolchain: |
| 47 | ifeq ($(COMPILER_OUT_OF_DATE),1) |
| 48 | echo "The coreboot toolchain is not the current version." |
| 49 | $(error ) |
| 50 | else |
| 51 | echo "The coreboot toolchain is the current version." |
| 52 | endif # ifeq ($(COMPILER_OUT_OF_DATE),1) |
Martin Roth | 2114880 | 2016-03-08 09:27:45 -0700 | [diff] [blame] | 53 | |
| 54 | # This target controls what the jenkins builder tests |
Martin Roth | ab8f7d3 | 2016-12-07 10:45:55 -0700 | [diff] [blame] | 55 | jenkins-build-toolchain: BUILDGCC_OPTIONS ?= -y --nocolor |
Martin Roth | 2114880 | 2016-03-08 09:27:45 -0700 | [diff] [blame] | 56 | jenkins-build-toolchain: |
Martin Roth | e7a5062 | 2020-03-15 09:43:31 -0600 | [diff] [blame] | 57 | $(MAKE) crossgcc clang KEEP_SOURCES=1 BUILDGCC_OPTIONS='$(BUILDGCC_OPTIONS)' |
Martin Roth | a539580 | 2016-04-02 11:10:08 -0600 | [diff] [blame] | 58 | PATH=$(if $(DEST),$(DEST)/bin,$(top)/util/crossgcc/xgcc/bin):$$PATH; $(MAKE) what-jenkins-does |
Martin Roth | a539580 | 2016-04-02 11:10:08 -0600 | [diff] [blame] | 59 | PATH=$(if $(DEST),$(DEST)/bin,$(top)/util/crossgcc/xgcc/bin):$$PATH; $(MAKE) test-toolchain |