treewide: Move device_tree to commonlib
[coreboot2.git] / util / crossgcc / Makefile
blob06ec91c4933a1295da67cb1b15e4ae4ff6e3316f
1 ## SPDX-License-Identifier: GPL-2.0-only
2 # if no architecture is specified, set a default
3 BUILD_PLATFORM ?= i386-elf
4 DEST ?= $(CURDIR)/xgcc
6 # For the toolchain builds, use CPUS=x to use multiple processors to build
7 # use KEEP_SOURCES=1 to keep temporary files after the build
8 # use BUILDGCC_OPTIONS= to set any other crossgcc command line options
9 # Example: BUILDGCC_OPTIONS=-c to remove temporary files before build
11 all:
12 $(MAKE) build-i386 build-x64 build-arm \
13 build-riscv build-aarch64 build-ppc64 build-nds32le \
14 build_clang build_iasl build_nasm
16 ###########################################################
17 ### targets to do buildgcc builds
19 build_gcc:
20 bash ./buildgcc -p $(BUILD_PLATFORM) $(if $(CPUS),-j $(CPUS)) $(if $(KEEP_SOURCES),-t) $(BUILDGCC_OPTIONS) \
21 $(if $(BUILD_LANGUAGES),-l $(BUILD_LANGUAGES)) -d $(DEST)
23 build_iasl:
24 bash ./buildgcc -P iasl $(if $(CPUS),-j $(CPUS)) $(if $(KEEP_SOURCES),-t) $(BUILDGCC_OPTIONS) -d $(DEST)
26 build_clang:
27 ifeq ($(SKIP_CLANG),)
28 bash ./buildgcc -P clang $(if $(CPUS),-j $(CPUS)) $(if $(KEEP_SOURCES),-t) $(BUILDGCC_OPTIONS) -d $(DEST)
29 endif
31 build_nasm:
32 bash ./buildgcc -P nasm $(if $(CPUS),-j $(CPUS)) $(if $(KEEP_SOURCES),-t) $(BUILDGCC_OPTIONS) -d $(DEST)
34 ###########################################################
35 build-i386:
36 @$(MAKE) build_gcc build_nasm BUILD_PLATFORM=i386-elf
38 build-x64:
39 @$(MAKE) build_gcc build_nasm BUILD_PLATFORM=x86_64-elf
41 build-arm:
42 @$(MAKE) build_gcc BUILD_PLATFORM=arm-eabi
44 build-aarch64:
45 @$(MAKE) build_gcc BUILD_PLATFORM=aarch64-elf
47 build-riscv:
48 @$(MAKE) build_gcc BUILD_PLATFORM=riscv-elf
50 build-ppc64:
51 @$(MAKE) build_gcc BUILD_PLATFORM=powerpc64-linux-gnu
53 build-nds32le:
54 @$(MAKE) build_gcc BUILD_PLATFORM=nds32le-elf
56 clean_tempfiles:
57 rm -rf build-*
58 rm -rf binutils-* gcc-* gmp-* mpc-* mpfr-*
59 rm -rf llvm-* clang-tools-* cfe-* compiler-rt-*
60 rm -rf acpica-*
61 rm -f getopt
63 clean: clean_tempfiles
64 rm -rf xgcc
66 distclean: clean
67 rm -rf tarballs
69 .PHONY: all build_gcc build_iasl build_clang build_nasm \
70 clean distclean clean_tempfiles \
71 build-i386 build-x64 build-arm build-aarch64 \
72 build-riscv build-ppc64 build-nds32le
74 .NOTPARALLEL: