Stefan Reinauer | d5779c1 | 2016-01-29 17:48:47 -0800 | [diff] [blame] | 1 | ## |
| 2 | ## This file is part of the coreboot project. |
| 3 | ## |
| 4 | ## Copyright (C) 2016 Google Inc. |
| 5 | ## |
| 6 | ## This program is free software; you can redistribute it and/or modify |
| 7 | ## it under the terms of the GNU General Public License as published by |
| 8 | ## the Free Software Foundation; version 2 of the License. |
| 9 | ## |
| 10 | ## This program is distributed in the hope that it will be useful, |
| 11 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | ## GNU General Public License for more details. |
| 14 | ## |
| 15 | |
Stefan Reinauer | 0ca5f33 | 2016-02-02 17:51:39 -0800 | [diff] [blame] | 16 | TOOLCHAIN_ARCHES := i386 x64 arm aarch64 mips riscv power8 nds32le |
Patrick Georgi | 6c0ccfb | 2016-01-30 09:14:45 +0100 | [diff] [blame] | 17 | |
Stefan Reinauer | d5779c1 | 2016-01-29 17:48:47 -0800 | [diff] [blame] | 18 | help_toolchain help:: |
| 19 | @echo '*** Toolchain targets ***' |
| 20 | @echo ' crossgcc - Build coreboot cross-compilers for all platforms' |
| 21 | @echo ' crosstools - Build coreboot cross-compiler and GDB for all platforms' |
| 22 | @echo ' crossgcc-clean - Remove all built coreboot cross-compilers' |
| 23 | @echo ' iasl - Build coreboot IASL compiler (built by all cross targets)' |
| 24 | @echo ' clang - Build coreboot clang compiler' |
Martin Roth | 109a7db | 2016-08-11 18:16:59 -0600 | [diff] [blame] | 25 | @echo ' gnumake - Build coreboot make' |
Stefan Reinauer | d5779c1 | 2016-01-29 17:48:47 -0800 | [diff] [blame] | 26 | @echo ' test-toolchain - Reports if toolchain components are out of date' |
| 27 | @echo ' crossgcc-ARCH - Build cross-compiler for specific architecture' |
| 28 | @echo ' crosstools-ARCH - Build cross-compiler with GDB for specific architecture' |
Patrick Georgi | 6c0ccfb | 2016-01-30 09:14:45 +0100 | [diff] [blame] | 29 | @echo ' ARCH can be "$(subst $(spc),"$(comma) ",$(TOOLCHAIN_ARCHES))"' |
Stefan Reinauer | d5779c1 | 2016-01-29 17:48:47 -0800 | [diff] [blame] | 30 | @echo ' Use "make [target] CPUS=#" to build toolchain using multiple cores' |
| 31 | @echo |
| 32 | |
| 33 | # For the toolchain builds, use CPUS=x to use multiple processors to build |
| 34 | # use BUILDGCC_OPTIONS= to set any crossgcc command line options |
| 35 | # Example: BUILDGCC_OPTIONS='-t' will keep temporary files after build |
| 36 | crossgcc: clean-for-update |
| 37 | $(MAKE) -C util/crossgcc all_without_gdb SKIP_CLANG=1 |
| 38 | |
| 39 | .PHONY: crossgcc crossgcc-i386 crossgcc-x64 crossgcc-arm crossgcc-aarch64 \ |
| 40 | crossgcc-mips crossgcc-riscv crossgcc-power8 crossgcc-clean iasl \ |
| 41 | clang crosstools-i386 crosstools-x64 crosstools-arm \ |
Martin Roth | 2114880 | 2016-03-08 09:27:45 -0700 | [diff] [blame] | 42 | crosstools-aarch64 crosstools-mips crosstools-riscv crosstools-power8 \ |
Martin Roth | 109a7db | 2016-08-11 18:16:59 -0600 | [diff] [blame] | 43 | jenkins-build-toolchain gnumake |
Stefan Reinauer | d5779c1 | 2016-01-29 17:48:47 -0800 | [diff] [blame] | 44 | |
Patrick Georgi | 6c0ccfb | 2016-01-30 09:14:45 +0100 | [diff] [blame] | 45 | $(foreach arch,$(TOOLCHAIN_ARCHES),crossgcc-$(arch)): clean-for-update |
Patrick Georgi | 3df9262 | 2016-02-02 19:33:00 +0100 | [diff] [blame] | 46 | $(MAKE) -C util/crossgcc $(patsubst crossgcc-%,build-%,$@) build_iasl SKIP_GDB=1 |
Stefan Reinauer | d5779c1 | 2016-01-29 17:48:47 -0800 | [diff] [blame] | 47 | |
| 48 | crosstools: clean-for-update |
| 49 | $(MAKE) -C util/crossgcc all_with_gdb SKIP_CLANG=1 |
| 50 | |
| 51 | iasl: clean-for-update |
| 52 | $(MAKE) -C util/crossgcc build_iasl |
| 53 | |
| 54 | clang: clean-for-update |
| 55 | $(MAKE) -C util/crossgcc build_clang |
| 56 | |
Martin Roth | 109a7db | 2016-08-11 18:16:59 -0600 | [diff] [blame] | 57 | gnumake: clean-for-update |
| 58 | $(MAKE) -C util/crossgcc build_make |
| 59 | |
Patrick Georgi | 6c0ccfb | 2016-01-30 09:14:45 +0100 | [diff] [blame] | 60 | $(foreach arch,$(TOOLCHAIN_ARCHES),crosstools-$(arch)): clean-for-update |
Patrick Georgi | 3df9262 | 2016-02-02 19:33:00 +0100 | [diff] [blame] | 61 | $(MAKE) -C util/crossgcc $(patsubst crosstools-%,build-%,$@) build_iasl |
Stefan Reinauer | d5779c1 | 2016-01-29 17:48:47 -0800 | [diff] [blame] | 62 | |
| 63 | crossgcc-clean: clean-for-update |
| 64 | $(MAKE) -C util/crossgcc clean |
| 65 | |
| 66 | test-toolchain: |
| 67 | ifeq ($(COMPILER_OUT_OF_DATE),1) |
| 68 | echo "The coreboot toolchain is not the current version." |
| 69 | $(error ) |
| 70 | else |
| 71 | echo "The coreboot toolchain is the current version." |
| 72 | endif # ifeq ($(COMPILER_OUT_OF_DATE),1) |
Martin Roth | 2114880 | 2016-03-08 09:27:45 -0700 | [diff] [blame] | 73 | |
| 74 | # This target controls what the jenkins builder tests |
Martin Roth | ab8f7d3 | 2016-12-07 10:45:55 -0700 | [diff] [blame] | 75 | jenkins-build-toolchain: BUILDGCC_OPTIONS ?= -y --nocolor |
Martin Roth | 2114880 | 2016-03-08 09:27:45 -0700 | [diff] [blame] | 76 | jenkins-build-toolchain: |
Martin Roth | ab8f7d3 | 2016-12-07 10:45:55 -0700 | [diff] [blame] | 77 | $(MAKE) crosstools clang KEEP_SOURCES=1 BUILDGCC_OPTIONS='$(BUILDGCC_OPTIONS)' |
Martin Roth | 4c3b156 | 2016-03-22 13:05:42 -0600 | [diff] [blame] | 78 | rm -f .xcompile |
Martin Roth | a539580 | 2016-04-02 11:10:08 -0600 | [diff] [blame] | 79 | PATH=$(if $(DEST),$(DEST)/bin,$(top)/util/crossgcc/xgcc/bin):$$PATH; $(MAKE) what-jenkins-does |
| 80 | -cat .xcompile |
| 81 | PATH=$(if $(DEST),$(DEST)/bin,$(top)/util/crossgcc/xgcc/bin):$$PATH; $(MAKE) test-toolchain |