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