blob: 152115c8a0f1af8479be924bfb7fe1bf786500f2 [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 Roth8fe68182015-10-27 15:03:46 -06004# 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
9all 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 Roth403ba772015-06-27 19:09:05 -060014
15all_without_gdb:
Martin Roth8fe68182015-10-27 15:03:46 -060016 $(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 Roth403ba772015-06-27 19:09:05 -060020
21build_tools: build_gcc build_iasl build_gdb
22
Martin Roth403ba772015-06-27 19:09:05 -060023###########################################################
24### targets to do buildgcc builds
25
26build_gcc:
Martin Roth8fe68182015-10-27 15:03:46 -060027 bash ./buildgcc -p $(BUILD_PLATFORM) $(if $(CPUS),-j $(CPUS)) $(if $(KEEP_SOURCES),-t) $(BUILDGCC_OPTIONS) \
Nico Huberbb313bf2015-09-08 12:30:27 +020028 $(if $(BUILD_LANGUAGES),-l $(BUILD_LANGUAGES))
Martin Roth403ba772015-06-27 19:09:05 -060029
30build_gdb:
Martin Roth8fe68182015-10-27 15:03:46 -060031ifeq ($(SKIP_GDB),)
32 bash ./buildgcc -p $(BUILD_PLATFORM) -P gdb $(if $(CPUS),-j $(CPUS)) $(if $(KEEP_SOURCES),-t) $(BUILDGCC_OPTIONS)
33endif
Martin Roth403ba772015-06-27 19:09:05 -060034
35build_iasl:
Martin Roth8fe68182015-10-27 15:03:46 -060036ifeq ($(SKIP_IASL),)
37 bash ./buildgcc -P iasl $(if $(CPUS),-j $(CPUS)) $(if $(KEEP_SOURCES),-t) $(BUILDGCC_OPTIONS)
38endif
Martin Roth403ba772015-06-27 19:09:05 -060039
40build_clang:
Martin Roth8fe68182015-10-27 15:03:46 -060041ifeq ($(SKIP_CLANG),)
42 bash ./buildgcc -P clang $(if $(CPUS),-j $(CPUS)) $(if $(KEEP_SOURCES),-t) $(BUILDGCC_OPTIONS)
43endif
Martin Roth403ba772015-06-27 19:09:05 -060044
45###########################################################
Edward O'Callaghan3a722782013-11-02 03:40:39 +110046build-i386:
Martin Roth403ba772015-06-27 19:09:05 -060047 @$(MAKE) build_tools BUILD_PLATFORM=i386-elf
Edward O'Callaghan3a722782013-11-02 03:40:39 +110048
Stefan Reinauer24f9cb92015-03-13 22:50:22 +010049build-x64:
Martin Roth403ba772015-06-27 19:09:05 -060050 @$(MAKE) build_tools BUILD_PLATFORM=x86_64-elf
Stefan Reinauer24f9cb92015-03-13 22:50:22 +010051
Edward O'Callaghan3a722782013-11-02 03:40:39 +110052build-armv7a:
Martin Roth403ba772015-06-27 19:09:05 -060053 @$(MAKE) build_tools BUILD_PLATFORM=armv7a-eabi
Cristian Magherusan-Stanciu0b933d42011-05-16 01:35:03 +000054
Patrick Georgi3bff5d92014-11-19 18:36:37 +010055build-aarch64:
Martin Roth403ba772015-06-27 19:09:05 -060056 @$(MAKE) build_tools BUILD_PLATFORM=aarch64-elf
Patrick Georgi3bff5d92014-11-19 18:36:37 +010057
Paul Burton6529c332014-05-27 15:18:42 +010058build-mips:
Martin Roth403ba772015-06-27 19:09:05 -060059 @$(MAKE) build_tools BUILD_PLATFORM=mipsel-elf
Paul Burton6529c332014-05-27 15:18:42 +010060
Alexander Couzensa49c0cc2015-03-10 20:24:34 +010061build-riscv:
Martin Roth403ba772015-06-27 19:09:05 -060062 @$(MAKE) build_tools BUILD_PLATFORM=riscv-elf
Patrick Georgif0bbc952015-03-07 10:57:25 +010063
Martin Roth403ba772015-06-27 19:09:05 -060064clean_tempfiles:
Martin Roth32c96512015-06-21 13:05:03 -060065 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-*
zbaoff3f15c2015-08-26 22:00:31 -040070 rm -f getopt
Cristian Magherusan-Stanciu0b933d42011-05-16 01:35:03 +000071
Martin Roth403ba772015-06-27 19:09:05 -060072clean: clean_tempfiles
73 rm -rf xgcc
74
Martin Roth32c96512015-06-21 13:05:03 -060075distclean: clean
76 rm -rf tarballs
77
Martin Roth8fe68182015-10-27 15:03:46 -060078.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