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 | |
| 10 | all all_with_gdb: |
Stefan Reinauer | 22009a3 | 2016-01-29 17:39:07 -0800 | [diff] [blame] | 11 | $(MAKE) build-i386 build-x64 build-arm build-mips \ |
| 12 | build-riscv build-aarch64 build-power8 build-nds32le \ |
Stefan Reinauer | f466ea9 | 2016-03-06 02:18:47 -0800 | [diff] [blame] | 13 | build_clang build_iasl build_make |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 14 | |
| 15 | all_without_gdb: |
Stefan Reinauer | 22009a3 | 2016-01-29 17:39:07 -0800 | [diff] [blame] | 16 | $(MAKE) SKIP_GDB=1 build-i386 build-x64 build-arm build-mips \ |
| 17 | build-riscv build-aarch64 build-power8 build-nds32le \ |
Stefan Reinauer | f466ea9 | 2016-03-06 02:18:47 -0800 | [diff] [blame] | 18 | build_clang build_iasl build_make |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 19 | |
Stefan Reinauer | 22009a3 | 2016-01-29 17:39:07 -0800 | [diff] [blame] | 20 | build_tools: build_gcc build_gdb |
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 | ########################################################### |
| 23 | ### targets to do buildgcc builds |
| 24 | |
| 25 | build_gcc: |
Martin Roth | 8fe6818 | 2015-10-27 15:03:46 -0600 | [diff] [blame] | 26 | 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] | 27 | $(if $(BUILD_LANGUAGES),-l $(BUILD_LANGUAGES)) -d $(DEST) |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 28 | |
| 29 | build_gdb: |
Martin Roth | 8fe6818 | 2015-10-27 15:03:46 -0600 | [diff] [blame] | 30 | ifeq ($(SKIP_GDB),) |
Stefan Reinauer | 163506a | 2016-02-27 12:29:58 -0800 | [diff] [blame] | 31 | bash ./buildgcc -p $(BUILD_PLATFORM) -P gdb $(if $(CPUS),-j $(CPUS)) $(if $(KEEP_SOURCES),-t) \ |
| 32 | $(BUILDGCC_OPTIONS) -d $(DEST) |
Martin Roth | 8fe6818 | 2015-10-27 15:03:46 -0600 | [diff] [blame] | 33 | endif |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 34 | |
| 35 | build_iasl: |
Stefan Reinauer | 163506a | 2016-02-27 12:29:58 -0800 | [diff] [blame] | 36 | 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] | 37 | |
| 38 | build_clang: |
Martin Roth | 8fe6818 | 2015-10-27 15:03:46 -0600 | [diff] [blame] | 39 | ifeq ($(SKIP_CLANG),) |
Stefan Reinauer | 163506a | 2016-02-27 12:29:58 -0800 | [diff] [blame] | 40 | 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] | 41 | endif |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 42 | |
Stefan Reinauer | f466ea9 | 2016-03-06 02:18:47 -0800 | [diff] [blame] | 43 | build_make: |
| 44 | bash ./buildgcc -P make $(if $(CPUS),-j $(CPUS)) $(if $(KEEP_SOURCES),-t) $(BUILDGCC_OPTIONS) -d $(DEST) |
| 45 | |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 46 | ########################################################### |
Edward O'Callaghan | 3a72278 | 2013-11-02 03:40:39 +1100 | [diff] [blame] | 47 | build-i386: |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 48 | @$(MAKE) build_tools BUILD_PLATFORM=i386-elf |
Edward O'Callaghan | 3a72278 | 2013-11-02 03:40:39 +1100 | [diff] [blame] | 49 | |
Stefan Reinauer | 24f9cb9 | 2015-03-13 22:50:22 +0100 | [diff] [blame] | 50 | build-x64: |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 51 | @$(MAKE) build_tools BUILD_PLATFORM=x86_64-elf |
Stefan Reinauer | 24f9cb9 | 2015-03-13 22:50:22 +0100 | [diff] [blame] | 52 | |
Stefan Reinauer | 2cc2ff6 | 2016-01-29 17:39:07 -0800 | [diff] [blame] | 53 | build-arm: |
| 54 | @$(MAKE) build_tools BUILD_PLATFORM=arm-eabi |
Cristian Magherusan-Stanciu | 0b933d4 | 2011-05-16 01:35:03 +0000 | [diff] [blame] | 55 | |
Patrick Georgi | 3bff5d9 | 2014-11-19 18:36:37 +0100 | [diff] [blame] | 56 | build-aarch64: |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 57 | @$(MAKE) build_tools BUILD_PLATFORM=aarch64-elf |
Patrick Georgi | 3bff5d9 | 2014-11-19 18:36:37 +0100 | [diff] [blame] | 58 | |
Paul Burton | 6529c33 | 2014-05-27 15:18:42 +0100 | [diff] [blame] | 59 | build-mips: |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 60 | @$(MAKE) build_tools BUILD_PLATFORM=mipsel-elf |
Paul Burton | 6529c33 | 2014-05-27 15:18:42 +0100 | [diff] [blame] | 61 | |
Alexander Couzens | a49c0cc | 2015-03-10 20:24:34 +0100 | [diff] [blame] | 62 | build-riscv: |
Stefan Reinauer | c77e041 | 2016-03-01 22:28:20 -0800 | [diff] [blame] | 63 | # GDB is currently not supported on RISC-V |
| 64 | @$(MAKE) build_gcc BUILD_PLATFORM=riscv-elf |
Patrick Georgi | f0bbc95 | 2015-03-07 10:57:25 +0100 | [diff] [blame] | 65 | |
Timothy Pearson | a9f6235 | 2015-12-30 18:59:00 -0600 | [diff] [blame] | 66 | build-power8: |
Martin Roth | a45a0b7 | 2016-03-23 09:00:11 -0600 | [diff] [blame] | 67 | @$(MAKE) build_tools BUILD_PLATFORM=powerpc64-linux-gnu |
Timothy Pearson | a9f6235 | 2015-12-30 18:59:00 -0600 | [diff] [blame] | 68 | |
Stefan Reinauer | 8adbcc2 | 2016-01-29 17:39:07 -0800 | [diff] [blame] | 69 | build-nds32le: |
| 70 | @$(MAKE) build_tools BUILD_PLATFORM=nds32le-elf |
| 71 | |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 72 | clean_tempfiles: |
Martin Roth | 32c9651 | 2015-06-21 13:05:03 -0600 | [diff] [blame] | 73 | rm -rf build-* |
| 74 | rm -rf binutils-* gcc-* gmp-* libelf-* mpc-* mpfr-* |
| 75 | rm -rf llvm-* clang-tools-* cfe-* compiler-rt-* |
| 76 | rm -rf acpica-* |
| 77 | rm -rf gdb-* |
zbao | ff3f15c | 2015-08-26 22:00:31 -0400 | [diff] [blame] | 78 | rm -f getopt |
Cristian Magherusan-Stanciu | 0b933d4 | 2011-05-16 01:35:03 +0000 | [diff] [blame] | 79 | |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 80 | clean: clean_tempfiles |
| 81 | rm -rf xgcc |
| 82 | |
Martin Roth | 32c9651 | 2015-06-21 13:05:03 -0600 | [diff] [blame] | 83 | distclean: clean |
| 84 | rm -rf tarballs |
| 85 | |
Stefan Reinauer | 8adbcc2 | 2016-01-29 17:39:07 -0800 | [diff] [blame] | 86 | .PHONY: build_gcc build_iasl build_gdb build_clang all all_with_gdb \ |
| 87 | all_without_gdb build_tools build-i386 build-x64 build-arm \ |
| 88 | build-aarch64 build-mips build-riscv build-power8 build-nds32le \ |
Martin Roth | 8fe6818 | 2015-10-27 15:03:46 -0600 | [diff] [blame] | 89 | clean distclean clean_tempfiles |