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 |
Cristian Magherusan-Stanciu | 0b933d4 | 2011-05-16 01:35:03 +0000 | [diff] [blame] | 3 | |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 4 | all: |
| 5 | $(MAKE) BUILDGCC_OPTIONS=-t build-i386 build-x64 build-armv7a build-mips build-riscv build-aarch64 \ |
| 6 | build_clang |
| 7 | $(MAKE) clean_tempfiles |
| 8 | |
| 9 | all_without_gdb: |
| 10 | $(MAKE) BUILDGCC_OPTIONS=-t build-i386-without-gdb build-x64-without-gdb build-armv7a-without-gdb \ |
| 11 | build-mips-without-gdb build-riscv-without-gdb build-aarch64-without-gdb build_clang |
| 12 | $(MAKE) clean_tempfiles |
| 13 | |
| 14 | build_tools: build_gcc build_iasl build_gdb |
| 15 | |
| 16 | build_tools_without_gdb: build_gcc build_iasl |
| 17 | |
| 18 | ########################################################### |
| 19 | ### targets to do buildgcc builds |
| 20 | |
| 21 | build_gcc: |
Martin Roth | 11bee40 | 2015-10-27 14:17:11 -0600 | [diff] [blame^] | 22 | bash ./buildgcc -p $(BUILD_PLATFORM) $(if $(CPUS),-j $(CPUS)) $(BUILDGCC_OPTIONS) \ |
Nico Huber | bb313bf | 2015-09-08 12:30:27 +0200 | [diff] [blame] | 23 | $(if $(BUILD_LANGUAGES),-l $(BUILD_LANGUAGES)) |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 24 | |
| 25 | build_gdb: |
Martin Roth | 11bee40 | 2015-10-27 14:17:11 -0600 | [diff] [blame^] | 26 | bash ./buildgcc -p $(BUILD_PLATFORM) -P gdb $(if $(CPUS),-j $(CPUS)) $(BUILDGCC_OPTIONS) |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 27 | |
| 28 | build_iasl: |
Martin Roth | 11bee40 | 2015-10-27 14:17:11 -0600 | [diff] [blame^] | 29 | bash ./buildgcc -P iasl $(if $(CPUS),-j $(CPUS)) $(BUILDGCC_OPTIONS) |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 30 | |
| 31 | build_clang: |
Martin Roth | 11bee40 | 2015-10-27 14:17:11 -0600 | [diff] [blame^] | 32 | bash ./buildgcc -P clang $(if $(CPUS),-j $(CPUS)) $(BUILDGCC_OPTIONS) |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 33 | |
| 34 | ########################################################### |
| 35 | ### Build with GDB ### |
Edward O'Callaghan | 3a72278 | 2013-11-02 03:40:39 +1100 | [diff] [blame] | 36 | build-i386: |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 37 | @$(MAKE) build_tools BUILD_PLATFORM=i386-elf |
Edward O'Callaghan | 3a72278 | 2013-11-02 03:40:39 +1100 | [diff] [blame] | 38 | |
Stefan Reinauer | 24f9cb9 | 2015-03-13 22:50:22 +0100 | [diff] [blame] | 39 | build-x64: |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 40 | @$(MAKE) build_tools BUILD_PLATFORM=x86_64-elf |
Stefan Reinauer | 24f9cb9 | 2015-03-13 22:50:22 +0100 | [diff] [blame] | 41 | |
Edward O'Callaghan | 3a72278 | 2013-11-02 03:40:39 +1100 | [diff] [blame] | 42 | build-armv7a: |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 43 | @$(MAKE) build_tools BUILD_PLATFORM=armv7a-eabi |
Cristian Magherusan-Stanciu | 0b933d4 | 2011-05-16 01:35:03 +0000 | [diff] [blame] | 44 | |
Patrick Georgi | 3bff5d9 | 2014-11-19 18:36:37 +0100 | [diff] [blame] | 45 | build-aarch64: |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 46 | @$(MAKE) build_tools BUILD_PLATFORM=aarch64-elf |
Patrick Georgi | 3bff5d9 | 2014-11-19 18:36:37 +0100 | [diff] [blame] | 47 | |
Paul Burton | 6529c33 | 2014-05-27 15:18:42 +0100 | [diff] [blame] | 48 | build-mips: |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 49 | @$(MAKE) build_tools BUILD_PLATFORM=mipsel-elf |
Paul Burton | 6529c33 | 2014-05-27 15:18:42 +0100 | [diff] [blame] | 50 | |
Alexander Couzens | a49c0cc | 2015-03-10 20:24:34 +0100 | [diff] [blame] | 51 | build-riscv: |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 52 | @$(MAKE) build_tools BUILD_PLATFORM=riscv-elf |
Patrick Georgi | f0bbc95 | 2015-03-07 10:57:25 +0100 | [diff] [blame] | 53 | |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 54 | ########################################################### |
| 55 | ### Build without GDB |
Edward O'Callaghan | 3a72278 | 2013-11-02 03:40:39 +1100 | [diff] [blame] | 56 | build-i386-without-gdb: |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 57 | @$(MAKE) build_tools_without_gdb BUILD_PLATFORM=i386-elf |
Edward O'Callaghan | 3a72278 | 2013-11-02 03:40:39 +1100 | [diff] [blame] | 58 | |
Stefan Reinauer | 24f9cb9 | 2015-03-13 22:50:22 +0100 | [diff] [blame] | 59 | build-x64-without-gdb: |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 60 | @$(MAKE) build_tools_without_gdb BUILD_PLATFORM=x86_64-elf |
Stefan Reinauer | 24f9cb9 | 2015-03-13 22:50:22 +0100 | [diff] [blame] | 61 | |
Edward O'Callaghan | 3a72278 | 2013-11-02 03:40:39 +1100 | [diff] [blame] | 62 | build-armv7a-without-gdb: |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 63 | @$(MAKE) build_tools_without_gdb BUILD_PLATFORM=armv7a-eabi |
Peter Stuge | cc5dd98 | 2011-06-09 05:04:20 +0200 | [diff] [blame] | 64 | |
Patrick Georgi | 3bff5d9 | 2014-11-19 18:36:37 +0100 | [diff] [blame] | 65 | build-aarch64-without-gdb: |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 66 | @$(MAKE) build_tools_without_gdb BUILD_PLATFORM=aarch64-elf |
Patrick Georgi | 3bff5d9 | 2014-11-19 18:36:37 +0100 | [diff] [blame] | 67 | |
Paul Burton | 6529c33 | 2014-05-27 15:18:42 +0100 | [diff] [blame] | 68 | build-mips-without-gdb: |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 69 | @$(MAKE) build_tools_without_gdb BUILD_PLATFORM=mipsel-elf |
Paul Burton | 6529c33 | 2014-05-27 15:18:42 +0100 | [diff] [blame] | 70 | |
Patrick Georgi | f0bbc95 | 2015-03-07 10:57:25 +0100 | [diff] [blame] | 71 | build-riscv-without-gdb: |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 72 | @$(MAKE) build_tools_without_gdb BUILD_PLATFORM=riscv-elf |
Patrick Georgi | f0bbc95 | 2015-03-07 10:57:25 +0100 | [diff] [blame] | 73 | |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 74 | clean_tempfiles: |
Martin Roth | 32c9651 | 2015-06-21 13:05:03 -0600 | [diff] [blame] | 75 | rm -rf build-* |
| 76 | rm -rf binutils-* gcc-* gmp-* libelf-* mpc-* mpfr-* |
| 77 | rm -rf llvm-* clang-tools-* cfe-* compiler-rt-* |
| 78 | rm -rf acpica-* |
| 79 | rm -rf gdb-* |
zbao | ff3f15c | 2015-08-26 22:00:31 -0400 | [diff] [blame] | 80 | rm -f getopt |
Cristian Magherusan-Stanciu | 0b933d4 | 2011-05-16 01:35:03 +0000 | [diff] [blame] | 81 | |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 82 | clean: clean_tempfiles |
| 83 | rm -rf xgcc |
| 84 | |
Martin Roth | 32c9651 | 2015-06-21 13:05:03 -0600 | [diff] [blame] | 85 | distclean: clean |
| 86 | rm -rf tarballs |
| 87 | |
Martin Roth | 403ba77 | 2015-06-27 19:09:05 -0600 | [diff] [blame] | 88 | .PHONY: build_gcc build_iasl build_gdb build_tools build_tools_without_gdb \ |
| 89 | build-i386-without-gdb build-x64-without-gdb build-armv7a-without-gdb \ |
| 90 | build-aarch64-without-gdb build-mips-without-gdb build-riscv-without-gdb \ |
| 91 | all build clean distclean clean_tempfiles all_without_gdb |