1 # if no architecture is specified, set a default
2 BUILD_PLATFORM ?
= i386-elf
5 # 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
11 $(MAKE
) build-i386 build-x64 build-arm \
12 build-riscv build-aarch64 build-ppc64 build-nds32le \
13 build_clang build_iasl build_make build_nasm
16 $(MAKE
) SKIP_GDB
=1 build-i386 build-x64 build-arm \
17 build-riscv build-aarch64 build-ppc64 build-nds32le \
18 build_clang build_iasl build_make build_nasm
20 build_tools
: build_gcc build_gdb
22 ###########################################################
23 ### targets to do buildgcc builds
26 bash .
/buildgcc
-p
$(BUILD_PLATFORM
) $(if
$(CPUS
),-j
$(CPUS
)) $(if
$(KEEP_SOURCES
),-t
) $(BUILDGCC_OPTIONS
) \
27 $(if
$(BUILD_LANGUAGES
),-l
$(BUILD_LANGUAGES
)) -d
$(DEST
)
31 bash .
/buildgcc
-p
$(BUILD_PLATFORM
) -P gdb
$(if
$(CPUS
),-j
$(CPUS
)) $(if
$(KEEP_SOURCES
),-t
) \
32 $(BUILDGCC_OPTIONS
) -d
$(DEST
)
36 bash .
/buildgcc
-P iasl
$(if
$(CPUS
),-j
$(CPUS
)) $(if
$(KEEP_SOURCES
),-t
) $(BUILDGCC_OPTIONS
) -d
$(DEST
)
40 bash .
/buildgcc
-P clang
$(if
$(CPUS
),-j
$(CPUS
)) $(if
$(KEEP_SOURCES
),-t
) $(BUILDGCC_OPTIONS
) -d
$(DEST
)
44 bash .
/buildgcc
-P make
$(if
$(CPUS
),-j
$(CPUS
)) $(if
$(KEEP_SOURCES
),-t
) $(BUILDGCC_OPTIONS
) -d
$(DEST
)
47 bash .
/buildgcc
-P nasm
$(if
$(CPUS
),-j
$(CPUS
)) $(if
$(KEEP_SOURCES
),-t
) $(BUILDGCC_OPTIONS
) -d
$(DEST
)
49 ###########################################################
51 @
$(MAKE
) build_tools build_nasm BUILD_PLATFORM
=i386-elf
54 @
$(MAKE
) build_tools build_nasm BUILD_PLATFORM
=x86_64-elf
57 @
$(MAKE
) build_tools BUILD_PLATFORM
=arm-eabi
60 @
$(MAKE
) build_tools BUILD_PLATFORM
=aarch64-elf
63 # GDB is currently not supported on RISC-V
64 @
$(MAKE
) build_gcc BUILD_PLATFORM
=riscv-elf
67 @
$(MAKE
) build_tools BUILD_PLATFORM
=powerpc64-linux-gnu
70 @
$(MAKE
) build_tools BUILD_PLATFORM
=nds32le-elf
74 rm -rf binutils-
* gcc-
* gmp-
* mpc-
* mpfr-
*
75 rm -rf llvm-
* clang-tools-
* cfe-
* compiler-rt-
*
80 clean: clean_tempfiles
86 .PHONY
: build_gcc build_iasl build_gdb build_clang
all all_with_gdb \
87 all_without_gdb build_tools build-i386 build-x64 build-arm \
88 build-aarch64 build-riscv build-ppc64 build-nds32le build-nasm \
89 clean distclean clean_tempfiles