blob: cb552dd08465b1082b5789e370e2eb63d849eb47 [file] [log] [blame]
Martin Roth403ba772015-06-27 19:09:05 -06001# if no architecture is specified, set a default
2BUILD_PLATFORM ?= i386-elf
Stefan Reinauer9b1936d2016-03-01 12:55:47 -08003DEST ?= $(CURDIR)/xgcc
Cristian Magherusan-Stanciu0b933d42011-05-16 01:35:03 +00004
Martin Roth8fe68182015-10-27 15:03:46 -06005# For the toolchain builds, use CPUS=x to use multiple processors to build
6# use KEEP_SOURCES=1 to keep temporary files after the build
7# use BUILDGCC_OPTIONS= to set any other crossgcc command line options
8# Example: BUILDGCC_OPTIONS=-c to remove temporary files before build
9
Patrick Georgif32eed12021-10-16 10:50:00 +020010all:
Julius Wernerf96d9052019-08-16 15:35:39 -070011 $(MAKE) build-i386 build-x64 build-arm \
Jonathan Neuschäferc22ad582018-11-30 00:06:50 +010012 build-riscv build-aarch64 build-ppc64 build-nds32le \
Elyes HAOUAS91fb1392020-01-20 15:33:11 +010013 build_clang build_iasl build_nasm
Martin Roth403ba772015-06-27 19:09:05 -060014
Martin Roth403ba772015-06-27 19:09:05 -060015###########################################################
16### targets to do buildgcc builds
17
18build_gcc:
Martin Roth8fe68182015-10-27 15:03:46 -060019 bash ./buildgcc -p $(BUILD_PLATFORM) $(if $(CPUS),-j $(CPUS)) $(if $(KEEP_SOURCES),-t) $(BUILDGCC_OPTIONS) \
Stefan Reinauer163506a2016-02-27 12:29:58 -080020 $(if $(BUILD_LANGUAGES),-l $(BUILD_LANGUAGES)) -d $(DEST)
Martin Roth403ba772015-06-27 19:09:05 -060021
Martin Roth403ba772015-06-27 19:09:05 -060022build_iasl:
Stefan Reinauer163506a2016-02-27 12:29:58 -080023 bash ./buildgcc -P iasl $(if $(CPUS),-j $(CPUS)) $(if $(KEEP_SOURCES),-t) $(BUILDGCC_OPTIONS) -d $(DEST)
Martin Roth403ba772015-06-27 19:09:05 -060024
25build_clang:
Martin Roth8fe68182015-10-27 15:03:46 -060026ifeq ($(SKIP_CLANG),)
Stefan Reinauer163506a2016-02-27 12:29:58 -080027 bash ./buildgcc -P clang $(if $(CPUS),-j $(CPUS)) $(if $(KEEP_SOURCES),-t) $(BUILDGCC_OPTIONS) -d $(DEST)
Martin Roth8fe68182015-10-27 15:03:46 -060028endif
Martin Roth403ba772015-06-27 19:09:05 -060029
Martin Rothd70f5fa2019-05-26 17:24:19 -060030build_nasm:
31 bash ./buildgcc -P nasm $(if $(CPUS),-j $(CPUS)) $(if $(KEEP_SOURCES),-t) $(BUILDGCC_OPTIONS) -d $(DEST)
32
Martin Roth403ba772015-06-27 19:09:05 -060033###########################################################
Edward O'Callaghan3a722782013-11-02 03:40:39 +110034build-i386:
Patrick Georgif32eed12021-10-16 10:50:00 +020035 @$(MAKE) build_gcc build_nasm BUILD_PLATFORM=i386-elf
Edward O'Callaghan3a722782013-11-02 03:40:39 +110036
Stefan Reinauer24f9cb92015-03-13 22:50:22 +010037build-x64:
Patrick Georgif32eed12021-10-16 10:50:00 +020038 @$(MAKE) build_gcc build_nasm BUILD_PLATFORM=x86_64-elf
Stefan Reinauer24f9cb92015-03-13 22:50:22 +010039
Stefan Reinauer2cc2ff62016-01-29 17:39:07 -080040build-arm:
Patrick Georgif32eed12021-10-16 10:50:00 +020041 @$(MAKE) build_gcc BUILD_PLATFORM=arm-eabi
Cristian Magherusan-Stanciu0b933d42011-05-16 01:35:03 +000042
Patrick Georgi3bff5d92014-11-19 18:36:37 +010043build-aarch64:
Patrick Georgif32eed12021-10-16 10:50:00 +020044 @$(MAKE) build_gcc BUILD_PLATFORM=aarch64-elf
Patrick Georgi3bff5d92014-11-19 18:36:37 +010045
Alexander Couzensa49c0cc2015-03-10 20:24:34 +010046build-riscv:
Stefan Reinauerc77e0412016-03-01 22:28:20 -080047 @$(MAKE) build_gcc BUILD_PLATFORM=riscv-elf
Patrick Georgif0bbc952015-03-07 10:57:25 +010048
Jonathan Neuschäferc22ad582018-11-30 00:06:50 +010049build-ppc64:
Patrick Georgif32eed12021-10-16 10:50:00 +020050 @$(MAKE) build_gcc BUILD_PLATFORM=powerpc64-linux-gnu
Timothy Pearsona9f62352015-12-30 18:59:00 -060051
Stefan Reinauer8adbcc22016-01-29 17:39:07 -080052build-nds32le:
Patrick Georgif32eed12021-10-16 10:50:00 +020053 @$(MAKE) build_gcc BUILD_PLATFORM=nds32le-elf
Stefan Reinauer8adbcc22016-01-29 17:39:07 -080054
Martin Roth403ba772015-06-27 19:09:05 -060055clean_tempfiles:
Martin Roth32c96512015-06-21 13:05:03 -060056 rm -rf build-*
Nico Huberafda56e2017-12-07 17:50:53 +010057 rm -rf binutils-* gcc-* gmp-* mpc-* mpfr-*
Martin Roth32c96512015-06-21 13:05:03 -060058 rm -rf llvm-* clang-tools-* cfe-* compiler-rt-*
59 rm -rf acpica-*
zbaoff3f15c2015-08-26 22:00:31 -040060 rm -f getopt
Cristian Magherusan-Stanciu0b933d42011-05-16 01:35:03 +000061
Martin Roth403ba772015-06-27 19:09:05 -060062clean: clean_tempfiles
63 rm -rf xgcc
64
Martin Roth32c96512015-06-21 13:05:03 -060065distclean: clean
66 rm -rf tarballs
67
Elyes HAOUAS52607fd2021-11-17 18:59:51 +010068.PHONY: all build_gcc build_iasl build_clang build_nasm \
Patrick Georgi6dad77d2021-11-01 16:24:35 +000069 clean distclean clean_tempfiles \
70 build-i386 build-x64 build-arm build-aarch64 \
71 build-riscv build-ppc64 build-nds32le
72
Alexander Couzensf126b4b2017-08-27 21:08:50 +020073.NOTPARALLEL: