Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 1 | # if no architecture is specified, set a default |
| 2 | BUILD_PLATFORM ?= i386-elf |
Stefan Reinauer | 9b1936d | 2016-03-01 12:55:47 -0800 | [diff] [blame] | 3 | DEST ?= $(CURDIR)/xgcc |
Cristian Magherusan-Stanciu | 0b933d4 | 2011-05-16 01:35:03 +0000 | [diff] [blame] | 4 | |
Martin Roth | 8fe6818 | 2015-10-27 15:03:46 -0600 | [diff] [blame] | 5 | # For the toolchain builds, use CPUS=x to use multiple processors to build |
| 6 | # use KEEP_SOURCES=1 to keep temporary files after the build |
| 7 | # use BUILDGCC_OPTIONS= to set any other crossgcc command line options |
| 8 | # Example: BUILDGCC_OPTIONS=-c to remove temporary files before build |
| 9 | |
Patrick Georgi | f32eed1 | 2021-10-16 10:50:00 +0200 | [diff] [blame] | 10 | all: |
Julius Werner | f96d905 | 2019-08-16 15:35:39 -0700 | [diff] [blame] | 11 | $(MAKE) build-i386 build-x64 build-arm \ |
Jonathan Neuschäfer | c22ad58 | 2018-11-30 00:06:50 +0100 | [diff] [blame] | 12 | build-riscv build-aarch64 build-ppc64 build-nds32le \ |
Elyes HAOUAS | 91fb139 | 2020-01-20 15:33:11 +0100 | [diff] [blame] | 13 | build_clang build_iasl build_nasm |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 14 | |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 15 | ########################################################### |
| 16 | ### targets to do buildgcc builds |
| 17 | |
| 18 | build_gcc: |
Martin Roth | 8fe6818 | 2015-10-27 15:03:46 -0600 | [diff] [blame] | 19 | bash ./buildgcc -p $(BUILD_PLATFORM) $(if $(CPUS),-j $(CPUS)) $(if $(KEEP_SOURCES),-t) $(BUILDGCC_OPTIONS) \ |
Stefan Reinauer | 163506a | 2016-02-27 12:29:58 -0800 | [diff] [blame] | 20 | $(if $(BUILD_LANGUAGES),-l $(BUILD_LANGUAGES)) -d $(DEST) |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 21 | |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 22 | build_iasl: |
Stefan Reinauer | 163506a | 2016-02-27 12:29:58 -0800 | [diff] [blame] | 23 | bash ./buildgcc -P iasl $(if $(CPUS),-j $(CPUS)) $(if $(KEEP_SOURCES),-t) $(BUILDGCC_OPTIONS) -d $(DEST) |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 24 | |
| 25 | build_clang: |
Martin Roth | 8fe6818 | 2015-10-27 15:03:46 -0600 | [diff] [blame] | 26 | ifeq ($(SKIP_CLANG),) |
Stefan Reinauer | 163506a | 2016-02-27 12:29:58 -0800 | [diff] [blame] | 27 | bash ./buildgcc -P clang $(if $(CPUS),-j $(CPUS)) $(if $(KEEP_SOURCES),-t) $(BUILDGCC_OPTIONS) -d $(DEST) |
Martin Roth | 8fe6818 | 2015-10-27 15:03:46 -0600 | [diff] [blame] | 28 | endif |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 29 | |
Martin Roth | d70f5fa | 2019-05-26 17:24:19 -0600 | [diff] [blame] | 30 | build_nasm: |
| 31 | bash ./buildgcc -P nasm $(if $(CPUS),-j $(CPUS)) $(if $(KEEP_SOURCES),-t) $(BUILDGCC_OPTIONS) -d $(DEST) |
| 32 | |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 33 | ########################################################### |
Edward O'Callaghan | 3a72278 | 2013-11-02 03:40:39 +1100 | [diff] [blame] | 34 | build-i386: |
Patrick Georgi | f32eed1 | 2021-10-16 10:50:00 +0200 | [diff] [blame] | 35 | @$(MAKE) build_gcc build_nasm BUILD_PLATFORM=i386-elf |
Edward O'Callaghan | 3a72278 | 2013-11-02 03:40:39 +1100 | [diff] [blame] | 36 | |
Stefan Reinauer | 24f9cb9 | 2015-03-13 22:50:22 +0100 | [diff] [blame] | 37 | build-x64: |
Patrick Georgi | f32eed1 | 2021-10-16 10:50:00 +0200 | [diff] [blame] | 38 | @$(MAKE) build_gcc build_nasm BUILD_PLATFORM=x86_64-elf |
Stefan Reinauer | 24f9cb9 | 2015-03-13 22:50:22 +0100 | [diff] [blame] | 39 | |
Stefan Reinauer | 2cc2ff6 | 2016-01-29 17:39:07 -0800 | [diff] [blame] | 40 | build-arm: |
Patrick Georgi | f32eed1 | 2021-10-16 10:50:00 +0200 | [diff] [blame] | 41 | @$(MAKE) build_gcc BUILD_PLATFORM=arm-eabi |
Cristian Magherusan-Stanciu | 0b933d4 | 2011-05-16 01:35:03 +0000 | [diff] [blame] | 42 | |
Patrick Georgi | 3bff5d9 | 2014-11-19 18:36:37 +0100 | [diff] [blame] | 43 | build-aarch64: |
Patrick Georgi | f32eed1 | 2021-10-16 10:50:00 +0200 | [diff] [blame] | 44 | @$(MAKE) build_gcc BUILD_PLATFORM=aarch64-elf |
Patrick Georgi | 3bff5d9 | 2014-11-19 18:36:37 +0100 | [diff] [blame] | 45 | |
Alexander Couzens | a49c0cc | 2015-03-10 20:24:34 +0100 | [diff] [blame] | 46 | build-riscv: |
Stefan Reinauer | c77e041 | 2016-03-01 22:28:20 -0800 | [diff] [blame] | 47 | @$(MAKE) build_gcc BUILD_PLATFORM=riscv-elf |
Patrick Georgi | f0bbc95 | 2015-03-07 10:57:25 +0100 | [diff] [blame] | 48 | |
Jonathan Neuschäfer | c22ad58 | 2018-11-30 00:06:50 +0100 | [diff] [blame] | 49 | build-ppc64: |
Patrick Georgi | f32eed1 | 2021-10-16 10:50:00 +0200 | [diff] [blame] | 50 | @$(MAKE) build_gcc BUILD_PLATFORM=powerpc64-linux-gnu |
Timothy Pearson | a9f6235 | 2015-12-30 18:59:00 -0600 | [diff] [blame] | 51 | |
Stefan Reinauer | 8adbcc2 | 2016-01-29 17:39:07 -0800 | [diff] [blame] | 52 | build-nds32le: |
Patrick Georgi | f32eed1 | 2021-10-16 10:50:00 +0200 | [diff] [blame] | 53 | @$(MAKE) build_gcc BUILD_PLATFORM=nds32le-elf |
Stefan Reinauer | 8adbcc2 | 2016-01-29 17:39:07 -0800 | [diff] [blame] | 54 | |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 55 | clean_tempfiles: |
Martin Roth | 32c9651 | 2015-06-21 13:05:03 -0600 | [diff] [blame] | 56 | rm -rf build-* |
Nico Huber | afda56e | 2017-12-07 17:50:53 +0100 | [diff] [blame] | 57 | rm -rf binutils-* gcc-* gmp-* mpc-* mpfr-* |
Martin Roth | 32c9651 | 2015-06-21 13:05:03 -0600 | [diff] [blame] | 58 | rm -rf llvm-* clang-tools-* cfe-* compiler-rt-* |
| 59 | rm -rf acpica-* |
zbao | ff3f15c | 2015-08-26 22:00:31 -0400 | [diff] [blame] | 60 | rm -f getopt |
Cristian Magherusan-Stanciu | 0b933d4 | 2011-05-16 01:35:03 +0000 | [diff] [blame] | 61 | |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 62 | clean: clean_tempfiles |
| 63 | rm -rf xgcc |
| 64 | |
Martin Roth | 32c9651 | 2015-06-21 13:05:03 -0600 | [diff] [blame] | 65 | distclean: clean |
| 66 | rm -rf tarballs |
| 67 | |
Elyes HAOUAS | 52607fd | 2021-11-17 18:59:51 +0100 | [diff] [blame] | 68 | .PHONY: all build_gcc build_iasl build_clang build_nasm \ |
Patrick Georgi | 6dad77d | 2021-11-01 16:24:35 +0000 | [diff] [blame] | 69 | clean distclean clean_tempfiles \ |
| 70 | build-i386 build-x64 build-arm build-aarch64 \ |
| 71 | build-riscv build-ppc64 build-nds32le |
| 72 | |
Alexander Couzens | f126b4b | 2017-08-27 21:08:50 +0200 | [diff] [blame] | 73 | .NOTPARALLEL: |