blob: b4b0223a453250895e547a5c7b072d305e39e3b6 [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:
22 bash ./buildgcc -p $(BUILD_PLATFORM) $(if $(BUILDJOBS),-j $(BUILDJOBS)) $(BUILDGCC_OPTIONS)
23
24build_gdb:
25 bash ./buildgcc -p $(BUILD_PLATFORM) -P gdb $(if $(BUILDJOBS),-j $(BUILDJOBS)) $(BUILDGCC_OPTIONS)
26
27build_iasl:
28 bash ./buildgcc -P iasl $(if $(BUILDJOBS),-j $(BUILDJOBS)) $(BUILDGCC_OPTIONS)
29
30build_clang:
31 bash ./buildgcc -P clang $(if $(BUILDJOBS),-j $(BUILDJOBS)) $(BUILDGCC_OPTIONS)
32
33###########################################################
34### Build with GDB ###
Edward O'Callaghan3a722782013-11-02 03:40:39 +110035build-i386:
Martin Roth403ba772015-06-27 19:09:05 -060036 @$(MAKE) build_tools BUILD_PLATFORM=i386-elf
Edward O'Callaghan3a722782013-11-02 03:40:39 +110037
Stefan Reinauer24f9cb92015-03-13 22:50:22 +010038build-x64:
Martin Roth403ba772015-06-27 19:09:05 -060039 @$(MAKE) build_tools BUILD_PLATFORM=x86_64-elf
Stefan Reinauer24f9cb92015-03-13 22:50:22 +010040
Edward O'Callaghan3a722782013-11-02 03:40:39 +110041build-armv7a:
Martin Roth403ba772015-06-27 19:09:05 -060042 @$(MAKE) build_tools BUILD_PLATFORM=armv7a-eabi
Cristian Magherusan-Stanciu0b933d42011-05-16 01:35:03 +000043
Patrick Georgi3bff5d92014-11-19 18:36:37 +010044build-aarch64:
Martin Roth403ba772015-06-27 19:09:05 -060045 @$(MAKE) build_tools BUILD_PLATFORM=aarch64-elf
Patrick Georgi3bff5d92014-11-19 18:36:37 +010046
Paul Burton6529c332014-05-27 15:18:42 +010047build-mips:
Martin Roth403ba772015-06-27 19:09:05 -060048 @$(MAKE) build_tools BUILD_PLATFORM=mipsel-elf
Paul Burton6529c332014-05-27 15:18:42 +010049
Alexander Couzensa49c0cc2015-03-10 20:24:34 +010050build-riscv:
Martin Roth403ba772015-06-27 19:09:05 -060051 @$(MAKE) build_tools BUILD_PLATFORM=riscv-elf
Patrick Georgif0bbc952015-03-07 10:57:25 +010052
Martin Roth403ba772015-06-27 19:09:05 -060053###########################################################
54### Build without GDB
Edward O'Callaghan3a722782013-11-02 03:40:39 +110055build-i386-without-gdb:
Martin Roth403ba772015-06-27 19:09:05 -060056 @$(MAKE) build_tools_without_gdb BUILD_PLATFORM=i386-elf
Edward O'Callaghan3a722782013-11-02 03:40:39 +110057
Stefan Reinauer24f9cb92015-03-13 22:50:22 +010058build-x64-without-gdb:
Martin Roth403ba772015-06-27 19:09:05 -060059 @$(MAKE) build_tools_without_gdb BUILD_PLATFORM=x86_64-elf
Stefan Reinauer24f9cb92015-03-13 22:50:22 +010060
Edward O'Callaghan3a722782013-11-02 03:40:39 +110061build-armv7a-without-gdb:
Martin Roth403ba772015-06-27 19:09:05 -060062 @$(MAKE) build_tools_without_gdb BUILD_PLATFORM=armv7a-eabi
Peter Stugecc5dd982011-06-09 05:04:20 +020063
Patrick Georgi3bff5d92014-11-19 18:36:37 +010064build-aarch64-without-gdb:
Martin Roth403ba772015-06-27 19:09:05 -060065 @$(MAKE) build_tools_without_gdb BUILD_PLATFORM=aarch64-elf
Patrick Georgi3bff5d92014-11-19 18:36:37 +010066
Paul Burton6529c332014-05-27 15:18:42 +010067build-mips-without-gdb:
Martin Roth403ba772015-06-27 19:09:05 -060068 @$(MAKE) build_tools_without_gdb BUILD_PLATFORM=mipsel-elf
Paul Burton6529c332014-05-27 15:18:42 +010069
Patrick Georgif0bbc952015-03-07 10:57:25 +010070build-riscv-without-gdb:
Martin Roth403ba772015-06-27 19:09:05 -060071 @$(MAKE) build_tools_without_gdb BUILD_PLATFORM=riscv-elf
Patrick Georgif0bbc952015-03-07 10:57:25 +010072
Martin Roth403ba772015-06-27 19:09:05 -060073clean_tempfiles:
Martin Roth32c96512015-06-21 13:05:03 -060074 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-Stanciu0b933d42011-05-16 01:35:03 +000079
Martin Roth403ba772015-06-27 19:09:05 -060080clean: clean_tempfiles
81 rm -rf xgcc
82
Martin Roth32c96512015-06-21 13:05:03 -060083distclean: clean
84 rm -rf tarballs
85
Martin Roth403ba772015-06-27 19:09:05 -060086.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