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