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:: |
| 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' |
Martin Roth | 109a7db | 2016-08-11 18:16:59 -0600 | [diff] [blame] | 12 | @echo ' gnumake - Build coreboot make' |
Martin Roth | d70f5fa | 2019-05-26 17:24:19 -0600 | [diff] [blame] | 13 | @echo ' nasm - Build coreboot nasm' |
Stefan Reinauer | d5779c1 | 2016-01-29 17:48:47 -0800 | [diff] [blame] | 14 | @echo ' test-toolchain - Reports if toolchain components are out of date' |
| 15 | @echo ' crossgcc-ARCH - Build cross-compiler for specific architecture' |
| 16 | @echo ' crosstools-ARCH - Build cross-compiler with GDB for specific architecture' |
Patrick Georgi | 6c0ccfb | 2016-01-30 09:14:45 +0100 | [diff] [blame] | 17 | @echo ' ARCH can be "$(subst $(spc),"$(comma) ",$(TOOLCHAIN_ARCHES))"' |
Stefan Reinauer | d5779c1 | 2016-01-29 17:48:47 -0800 | [diff] [blame] | 18 | @echo ' Use "make [target] CPUS=#" to build toolchain using multiple cores' |
Patrick Georgi | d971e76 | 2018-11-24 23:14:45 +0100 | [diff] [blame] | 19 | @echo ' Use "make [target] DEST=some/path" to install toolchain there' |
Stefan Reinauer | d5779c1 | 2016-01-29 17:48:47 -0800 | [diff] [blame] | 20 | @echo |
| 21 | |
| 22 | # For the toolchain builds, use CPUS=x to use multiple processors to build |
| 23 | # use BUILDGCC_OPTIONS= to set any crossgcc command line options |
| 24 | # Example: BUILDGCC_OPTIONS='-t' will keep temporary files after build |
| 25 | crossgcc: clean-for-update |
| 26 | $(MAKE) -C util/crossgcc all_without_gdb SKIP_CLANG=1 |
| 27 | |
| 28 | .PHONY: crossgcc crossgcc-i386 crossgcc-x64 crossgcc-arm crossgcc-aarch64 \ |
Julius Werner | f96d905 | 2019-08-16 15:35:39 -0700 | [diff] [blame] | 29 | crossgcc-riscv crossgcc-power8 crossgcc-clean iasl \ |
Stefan Reinauer | d5779c1 | 2016-01-29 17:48:47 -0800 | [diff] [blame] | 30 | clang crosstools-i386 crosstools-x64 crosstools-arm \ |
Julius Werner | f96d905 | 2019-08-16 15:35:39 -0700 | [diff] [blame] | 31 | crosstools-aarch64 crosstools-riscv crosstools-power8 \ |
Martin Roth | d70f5fa | 2019-05-26 17:24:19 -0600 | [diff] [blame] | 32 | jenkins-build-toolchain gnumake nasm |
Stefan Reinauer | d5779c1 | 2016-01-29 17:48:47 -0800 | [diff] [blame] | 33 | |
Patrick Georgi | 6c0ccfb | 2016-01-30 09:14:45 +0100 | [diff] [blame] | 34 | $(foreach arch,$(TOOLCHAIN_ARCHES),crossgcc-$(arch)): clean-for-update |
Patrick Georgi | 3df9262 | 2016-02-02 19:33:00 +0100 | [diff] [blame] | 35 | $(MAKE) -C util/crossgcc $(patsubst crossgcc-%,build-%,$@) build_iasl SKIP_GDB=1 |
Stefan Reinauer | d5779c1 | 2016-01-29 17:48:47 -0800 | [diff] [blame] | 36 | |
| 37 | crosstools: clean-for-update |
| 38 | $(MAKE) -C util/crossgcc all_with_gdb SKIP_CLANG=1 |
| 39 | |
| 40 | iasl: clean-for-update |
| 41 | $(MAKE) -C util/crossgcc build_iasl |
| 42 | |
| 43 | clang: clean-for-update |
| 44 | $(MAKE) -C util/crossgcc build_clang |
| 45 | |
Martin Roth | 109a7db | 2016-08-11 18:16:59 -0600 | [diff] [blame] | 46 | gnumake: clean-for-update |
| 47 | $(MAKE) -C util/crossgcc build_make |
| 48 | |
Martin Roth | d70f5fa | 2019-05-26 17:24:19 -0600 | [diff] [blame] | 49 | nasm: clean-for-update |
| 50 | $(MAKE) -C util/crossgcc build_nasm |
| 51 | |
Patrick Georgi | 6c0ccfb | 2016-01-30 09:14:45 +0100 | [diff] [blame] | 52 | $(foreach arch,$(TOOLCHAIN_ARCHES),crosstools-$(arch)): clean-for-update |
Patrick Georgi | 3df9262 | 2016-02-02 19:33:00 +0100 | [diff] [blame] | 53 | $(MAKE) -C util/crossgcc $(patsubst crosstools-%,build-%,$@) build_iasl |
Stefan Reinauer | d5779c1 | 2016-01-29 17:48:47 -0800 | [diff] [blame] | 54 | |
| 55 | crossgcc-clean: clean-for-update |
| 56 | $(MAKE) -C util/crossgcc clean |
| 57 | |
| 58 | test-toolchain: |
| 59 | ifeq ($(COMPILER_OUT_OF_DATE),1) |
| 60 | echo "The coreboot toolchain is not the current version." |
| 61 | $(error ) |
| 62 | else |
| 63 | echo "The coreboot toolchain is the current version." |
| 64 | endif # ifeq ($(COMPILER_OUT_OF_DATE),1) |
Martin Roth | 2114880 | 2016-03-08 09:27:45 -0700 | [diff] [blame] | 65 | |
| 66 | # This target controls what the jenkins builder tests |
Martin Roth | ab8f7d3 | 2016-12-07 10:45:55 -0700 | [diff] [blame] | 67 | jenkins-build-toolchain: BUILDGCC_OPTIONS ?= -y --nocolor |
Martin Roth | 2114880 | 2016-03-08 09:27:45 -0700 | [diff] [blame] | 68 | jenkins-build-toolchain: |
Martin Roth | e7a5062 | 2020-03-15 09:43:31 -0600 | [diff] [blame] | 69 | $(MAKE) crossgcc clang KEEP_SOURCES=1 BUILDGCC_OPTIONS='$(BUILDGCC_OPTIONS)' |
| 70 | #TODO: Re-enable gdb build after the builders can build it again. |
| 71 | #$(MAKE) crosstools clang KEEP_SOURCES=1 BUILDGCC_OPTIONS='$(BUILDGCC_OPTIONS)' |
Martin Roth | 4c3b156 | 2016-03-22 13:05:42 -0600 | [diff] [blame] | 72 | rm -f .xcompile |
Martin Roth | a539580 | 2016-04-02 11:10:08 -0600 | [diff] [blame] | 73 | PATH=$(if $(DEST),$(DEST)/bin,$(top)/util/crossgcc/xgcc/bin):$$PATH; $(MAKE) what-jenkins-does |
| 74 | -cat .xcompile |
| 75 | PATH=$(if $(DEST),$(DEST)/bin,$(top)/util/crossgcc/xgcc/bin):$$PATH; $(MAKE) test-toolchain |