1 ## SPDX-License-Identifier: GPL-2.0-only
2 # if no architecture is specified, set a default
3 BUILD_PLATFORM ?
= i386-elf
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
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
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
)
24 bash .
/buildgcc
-P iasl
$(if
$(CPUS
),-j
$(CPUS
)) $(if
$(KEEP_SOURCES
),-t
) $(BUILDGCC_OPTIONS
) -d
$(DEST
)
28 bash .
/buildgcc
-P clang
$(if
$(CPUS
),-j
$(CPUS
)) $(if
$(KEEP_SOURCES
),-t
) $(BUILDGCC_OPTIONS
) -d
$(DEST
)
32 bash .
/buildgcc
-P nasm
$(if
$(CPUS
),-j
$(CPUS
)) $(if
$(KEEP_SOURCES
),-t
) $(BUILDGCC_OPTIONS
) -d
$(DEST
)
34 ###########################################################
36 @
$(MAKE
) build_gcc build_nasm BUILD_PLATFORM
=i386-elf
39 @
$(MAKE
) build_gcc build_nasm BUILD_PLATFORM
=x86_64-elf
42 @
$(MAKE
) build_gcc BUILD_PLATFORM
=arm-eabi
45 @
$(MAKE
) build_gcc BUILD_PLATFORM
=aarch64-elf
48 @
$(MAKE
) build_gcc BUILD_PLATFORM
=riscv-elf
51 @
$(MAKE
) build_gcc BUILD_PLATFORM
=powerpc64-linux-gnu
54 @
$(MAKE
) build_gcc BUILD_PLATFORM
=nds32le-elf
58 rm -rf binutils-
* gcc-
* gmp-
* mpc-
* mpfr-
*
59 rm -rf llvm-
* clang-tools-
* cfe-
* compiler-rt-
*
63 clean: clean_tempfiles
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