blob: 1f1dc1f5576476981d393c363192785793104961 [file] [log] [blame]
Martin Roth403ba772015-06-27 19:09:05 -06001# if no architecture is specified, set a default
2BUILD_PLATFORM ?= i386-elf
Cristian Magherusan-Stanciu0b933d42011-05-16 01:35:03 +00003
Martin Roth403ba772015-06-27 19:09:05 -06004all:
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
9all_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
14build_tools: build_gcc build_iasl build_gdb
15
16build_tools_without_gdb: build_gcc build_iasl
17
18###########################################################
19### targets to do buildgcc builds
20
21build_gcc:
Martin Roth11bee402015-10-27 14:17:11 -060022 bash ./buildgcc -p $(BUILD_PLATFORM) $(if $(CPUS),-j $(CPUS)) $(BUILDGCC_OPTIONS) \
Nico Huberbb313bf2015-09-08 12:30:27 +020023 $(if $(BUILD_LANGUAGES),-l $(BUILD_LANGUAGES))
Martin Roth403ba772015-06-27 19:09:05 -060024
25build_gdb:
Martin Roth11bee402015-10-27 14:17:11 -060026 bash ./buildgcc -p $(BUILD_PLATFORM) -P gdb $(if $(CPUS),-j $(CPUS)) $(BUILDGCC_OPTIONS)
Martin Roth403ba772015-06-27 19:09:05 -060027
28build_iasl:
Martin Roth11bee402015-10-27 14:17:11 -060029 bash ./buildgcc -P iasl $(if $(CPUS),-j $(CPUS)) $(BUILDGCC_OPTIONS)
Martin Roth403ba772015-06-27 19:09:05 -060030
31build_clang:
Martin Roth11bee402015-10-27 14:17:11 -060032 bash ./buildgcc -P clang $(if $(CPUS),-j $(CPUS)) $(BUILDGCC_OPTIONS)
Martin Roth403ba772015-06-27 19:09:05 -060033
34###########################################################
35### Build with GDB ###
Edward O'Callaghan3a722782013-11-02 03:40:39 +110036build-i386:
Martin Roth403ba772015-06-27 19:09:05 -060037 @$(MAKE) build_tools BUILD_PLATFORM=i386-elf
Edward O'Callaghan3a722782013-11-02 03:40:39 +110038
Stefan Reinauer24f9cb92015-03-13 22:50:22 +010039build-x64:
Martin Roth403ba772015-06-27 19:09:05 -060040 @$(MAKE) build_tools BUILD_PLATFORM=x86_64-elf
Stefan Reinauer24f9cb92015-03-13 22:50:22 +010041
Edward O'Callaghan3a722782013-11-02 03:40:39 +110042build-armv7a:
Martin Roth403ba772015-06-27 19:09:05 -060043 @$(MAKE) build_tools BUILD_PLATFORM=armv7a-eabi
Cristian Magherusan-Stanciu0b933d42011-05-16 01:35:03 +000044
Patrick Georgi3bff5d92014-11-19 18:36:37 +010045build-aarch64:
Martin Roth403ba772015-06-27 19:09:05 -060046 @$(MAKE) build_tools BUILD_PLATFORM=aarch64-elf
Patrick Georgi3bff5d92014-11-19 18:36:37 +010047
Paul Burton6529c332014-05-27 15:18:42 +010048build-mips:
Martin Roth403ba772015-06-27 19:09:05 -060049 @$(MAKE) build_tools BUILD_PLATFORM=mipsel-elf
Paul Burton6529c332014-05-27 15:18:42 +010050
Alexander Couzensa49c0cc2015-03-10 20:24:34 +010051build-riscv:
Martin Roth403ba772015-06-27 19:09:05 -060052 @$(MAKE) build_tools BUILD_PLATFORM=riscv-elf
Patrick Georgif0bbc952015-03-07 10:57:25 +010053
Martin Roth403ba772015-06-27 19:09:05 -060054###########################################################
55### Build without GDB
Edward O'Callaghan3a722782013-11-02 03:40:39 +110056build-i386-without-gdb:
Martin Roth403ba772015-06-27 19:09:05 -060057 @$(MAKE) build_tools_without_gdb BUILD_PLATFORM=i386-elf
Edward O'Callaghan3a722782013-11-02 03:40:39 +110058
Stefan Reinauer24f9cb92015-03-13 22:50:22 +010059build-x64-without-gdb:
Martin Roth403ba772015-06-27 19:09:05 -060060 @$(MAKE) build_tools_without_gdb BUILD_PLATFORM=x86_64-elf
Stefan Reinauer24f9cb92015-03-13 22:50:22 +010061
Edward O'Callaghan3a722782013-11-02 03:40:39 +110062build-armv7a-without-gdb:
Martin Roth403ba772015-06-27 19:09:05 -060063 @$(MAKE) build_tools_without_gdb BUILD_PLATFORM=armv7a-eabi
Peter Stugecc5dd982011-06-09 05:04:20 +020064
Patrick Georgi3bff5d92014-11-19 18:36:37 +010065build-aarch64-without-gdb:
Martin Roth403ba772015-06-27 19:09:05 -060066 @$(MAKE) build_tools_without_gdb BUILD_PLATFORM=aarch64-elf
Patrick Georgi3bff5d92014-11-19 18:36:37 +010067
Paul Burton6529c332014-05-27 15:18:42 +010068build-mips-without-gdb:
Martin Roth403ba772015-06-27 19:09:05 -060069 @$(MAKE) build_tools_without_gdb BUILD_PLATFORM=mipsel-elf
Paul Burton6529c332014-05-27 15:18:42 +010070
Patrick Georgif0bbc952015-03-07 10:57:25 +010071build-riscv-without-gdb:
Martin Roth403ba772015-06-27 19:09:05 -060072 @$(MAKE) build_tools_without_gdb BUILD_PLATFORM=riscv-elf
Patrick Georgif0bbc952015-03-07 10:57:25 +010073
Martin Roth403ba772015-06-27 19:09:05 -060074clean_tempfiles:
Martin Roth32c96512015-06-21 13:05:03 -060075 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-*
zbaoff3f15c2015-08-26 22:00:31 -040080 rm -f getopt
Cristian Magherusan-Stanciu0b933d42011-05-16 01:35:03 +000081
Martin Roth403ba772015-06-27 19:09:05 -060082clean: clean_tempfiles
83 rm -rf xgcc
84
Martin Roth32c96512015-06-21 13:05:03 -060085distclean: clean
86 rm -rf tarballs
87
Martin Roth403ba772015-06-27 19:09:05 -060088.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