2015-06-28 03:09:05 +02:00
|
|
|
# if no architecture is specified, set a default
|
|
|
|
BUILD_PLATFORM ?= i386-elf
|
2016-03-01 21:55:47 +01:00
|
|
|
DEST ?= $(CURDIR)/xgcc
|
2011-05-16 03:35:03 +02:00
|
|
|
|
2015-10-27 22:03:46 +01:00
|
|
|
# For the toolchain builds, use CPUS=x to use multiple processors to build
|
|
|
|
# use KEEP_SOURCES=1 to keep temporary files after the build
|
|
|
|
# use BUILDGCC_OPTIONS= to set any other crossgcc command line options
|
|
|
|
# Example: BUILDGCC_OPTIONS=-c to remove temporary files before build
|
|
|
|
|
|
|
|
all all_with_gdb:
|
2019-08-17 00:35:39 +02:00
|
|
|
$(MAKE) build-i386 build-x64 build-arm \
|
2018-11-30 00:06:50 +01:00
|
|
|
build-riscv build-aarch64 build-ppc64 build-nds32le \
|
2019-05-27 01:24:19 +02:00
|
|
|
build_clang build_iasl build_make build_nasm
|
2015-06-28 03:09:05 +02:00
|
|
|
|
|
|
|
all_without_gdb:
|
2019-08-17 00:35:39 +02:00
|
|
|
$(MAKE) SKIP_GDB=1 build-i386 build-x64 build-arm \
|
2018-11-30 00:06:50 +01:00
|
|
|
build-riscv build-aarch64 build-ppc64 build-nds32le \
|
2019-05-27 01:24:19 +02:00
|
|
|
build_clang build_iasl build_make build_nasm
|
2015-06-28 03:09:05 +02:00
|
|
|
|
2016-01-30 02:39:07 +01:00
|
|
|
build_tools: build_gcc build_gdb
|
2015-06-28 03:09:05 +02:00
|
|
|
|
|
|
|
###########################################################
|
|
|
|
### targets to do buildgcc builds
|
|
|
|
|
|
|
|
build_gcc:
|
2015-10-27 22:03:46 +01:00
|
|
|
bash ./buildgcc -p $(BUILD_PLATFORM) $(if $(CPUS),-j $(CPUS)) $(if $(KEEP_SOURCES),-t) $(BUILDGCC_OPTIONS) \
|
2016-02-27 21:29:58 +01:00
|
|
|
$(if $(BUILD_LANGUAGES),-l $(BUILD_LANGUAGES)) -d $(DEST)
|
2015-06-28 03:09:05 +02:00
|
|
|
|
|
|
|
build_gdb:
|
2015-10-27 22:03:46 +01:00
|
|
|
ifeq ($(SKIP_GDB),)
|
2016-02-27 21:29:58 +01:00
|
|
|
bash ./buildgcc -p $(BUILD_PLATFORM) -P gdb $(if $(CPUS),-j $(CPUS)) $(if $(KEEP_SOURCES),-t) \
|
|
|
|
$(BUILDGCC_OPTIONS) -d $(DEST)
|
2015-10-27 22:03:46 +01:00
|
|
|
endif
|
2015-06-28 03:09:05 +02:00
|
|
|
|
|
|
|
build_iasl:
|
2016-02-27 21:29:58 +01:00
|
|
|
bash ./buildgcc -P iasl $(if $(CPUS),-j $(CPUS)) $(if $(KEEP_SOURCES),-t) $(BUILDGCC_OPTIONS) -d $(DEST)
|
2015-06-28 03:09:05 +02:00
|
|
|
|
|
|
|
build_clang:
|
2015-10-27 22:03:46 +01:00
|
|
|
ifeq ($(SKIP_CLANG),)
|
2016-02-27 21:29:58 +01:00
|
|
|
bash ./buildgcc -P clang $(if $(CPUS),-j $(CPUS)) $(if $(KEEP_SOURCES),-t) $(BUILDGCC_OPTIONS) -d $(DEST)
|
2015-10-27 22:03:46 +01:00
|
|
|
endif
|
2015-06-28 03:09:05 +02:00
|
|
|
|
2016-03-06 11:18:47 +01:00
|
|
|
build_make:
|
|
|
|
bash ./buildgcc -P make $(if $(CPUS),-j $(CPUS)) $(if $(KEEP_SOURCES),-t) $(BUILDGCC_OPTIONS) -d $(DEST)
|
|
|
|
|
2019-05-27 01:24:19 +02:00
|
|
|
build_nasm:
|
|
|
|
bash ./buildgcc -P nasm $(if $(CPUS),-j $(CPUS)) $(if $(KEEP_SOURCES),-t) $(BUILDGCC_OPTIONS) -d $(DEST)
|
|
|
|
|
2015-06-28 03:09:05 +02:00
|
|
|
###########################################################
|
2013-11-01 17:40:39 +01:00
|
|
|
build-i386:
|
2019-05-27 01:24:19 +02:00
|
|
|
@$(MAKE) build_tools build_nasm BUILD_PLATFORM=i386-elf
|
2013-11-01 17:40:39 +01:00
|
|
|
|
2015-03-13 22:50:22 +01:00
|
|
|
build-x64:
|
2019-05-27 01:24:19 +02:00
|
|
|
@$(MAKE) build_tools build_nasm BUILD_PLATFORM=x86_64-elf
|
2015-03-13 22:50:22 +01:00
|
|
|
|
2016-01-30 02:39:07 +01:00
|
|
|
build-arm:
|
|
|
|
@$(MAKE) build_tools BUILD_PLATFORM=arm-eabi
|
2011-05-16 03:35:03 +02:00
|
|
|
|
2014-11-19 18:36:37 +01:00
|
|
|
build-aarch64:
|
2015-06-28 03:09:05 +02:00
|
|
|
@$(MAKE) build_tools BUILD_PLATFORM=aarch64-elf
|
2014-11-19 18:36:37 +01:00
|
|
|
|
2015-03-10 20:24:34 +01:00
|
|
|
build-riscv:
|
2016-03-02 07:28:20 +01:00
|
|
|
# GDB is currently not supported on RISC-V
|
|
|
|
@$(MAKE) build_gcc BUILD_PLATFORM=riscv-elf
|
2015-03-07 10:57:25 +01:00
|
|
|
|
2018-11-30 00:06:50 +01:00
|
|
|
build-ppc64:
|
2016-03-23 16:00:11 +01:00
|
|
|
@$(MAKE) build_tools BUILD_PLATFORM=powerpc64-linux-gnu
|
2015-12-31 01:59:00 +01:00
|
|
|
|
2016-01-30 02:39:07 +01:00
|
|
|
build-nds32le:
|
|
|
|
@$(MAKE) build_tools BUILD_PLATFORM=nds32le-elf
|
|
|
|
|
2015-06-28 03:09:05 +02:00
|
|
|
clean_tempfiles:
|
2015-06-21 21:05:03 +02:00
|
|
|
rm -rf build-*
|
2017-12-07 17:50:53 +01:00
|
|
|
rm -rf binutils-* gcc-* gmp-* mpc-* mpfr-*
|
2015-06-21 21:05:03 +02:00
|
|
|
rm -rf llvm-* clang-tools-* cfe-* compiler-rt-*
|
|
|
|
rm -rf acpica-*
|
|
|
|
rm -rf gdb-*
|
2015-08-27 04:00:31 +02:00
|
|
|
rm -f getopt
|
2011-05-16 03:35:03 +02:00
|
|
|
|
2015-06-28 03:09:05 +02:00
|
|
|
clean: clean_tempfiles
|
|
|
|
rm -rf xgcc
|
|
|
|
|
2015-06-21 21:05:03 +02:00
|
|
|
distclean: clean
|
|
|
|
rm -rf tarballs
|
|
|
|
|
2016-01-30 02:39:07 +01:00
|
|
|
.PHONY: build_gcc build_iasl build_gdb build_clang all all_with_gdb \
|
|
|
|
all_without_gdb build_tools build-i386 build-x64 build-arm \
|
2019-08-17 00:35:39 +02:00
|
|
|
build-aarch64 build-riscv build-ppc64 build-nds32le build-nasm \
|
2015-10-27 22:03:46 +01:00
|
|
|
clean distclean clean_tempfiles
|
2017-08-27 21:08:50 +02:00
|
|
|
.NOTPARALLEL:
|