maximgusev

Untitled

Jan 31st, 2017
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.79 KB | None | 0 0
  1. # if no architecture is specified, set a default
  2. BUILD_PLATFORM ?= i386-elf
  3. DEST ?= $(CURDIR)/xgcc
  4.  
  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
  9.  
  10. all all_with_gdb:
  11. $(MAKE) build-elbrus build-i386 build-x64 build-arm build-mips \
  12. build-riscv build-aarch64 build-power8 build-nds32le \
  13. build_clang build_iasl build_make
  14.  
  15. all_without_gdb:
  16. $(MAKE) SKIP_GDB=1 build-elbrus build-i386 build-x64 build-arm build-mips \
  17. build-riscv build-aarch64 build-power8 build-nds32le \
  18. build_clang build_iasl build_make
  19.  
  20. build_tools: build_gcc build_gdb
  21.  
  22. ###########################################################
  23. ### targets to do buildgcc builds
  24.  
  25. build_gcc:
  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)
  28.  
  29. build_gdb:
  30. ifeq ($(SKIP_GDB),)
  31. bash ./buildgcc -p $(BUILD_PLATFORM) -P gdb $(if $(CPUS),-j $(CPUS)) $(if $(KEEP_SOURCES),-t) \
  32. $(BUILDGCC_OPTIONS) -d $(DEST)
  33. endif
  34.  
  35. build_iasl:
  36. bash ./buildgcc -P iasl $(if $(CPUS),-j $(CPUS)) $(if $(KEEP_SOURCES),-t) $(BUILDGCC_OPTIONS) -d $(DEST)
  37.  
  38. build_clang:
  39. ifeq ($(SKIP_CLANG),)
  40. bash ./buildgcc -P clang $(if $(CPUS),-j $(CPUS)) $(if $(KEEP_SOURCES),-t) $(BUILDGCC_OPTIONS) -d $(DEST)
  41. endif
  42.  
  43. build_make:
  44. bash ./buildgcc -P make $(if $(CPUS),-j $(CPUS)) $(if $(KEEP_SOURCES),-t) $(BUILDGCC_OPTIONS) -d $(DEST)
  45.  
  46. ###########################################################
  47. build-i386:
  48. @$(MAKE) build_tools BUILD_PLATFORM=i386-elf
  49.  
  50. build-x64:
  51. @$(MAKE) build_tools BUILD_PLATFORM=x86_64-elf
  52.  
  53. build-arm:
  54. @$(MAKE) build_tools BUILD_PLATFORM=arm-eabi
  55.  
  56. build-aarch64:
  57. @$(MAKE) build_tools BUILD_PLATFORM=aarch64-elf
  58.  
  59. build-mips:
  60. @$(MAKE) build_tools BUILD_PLATFORM=mipsel-elf
  61.  
  62. build-riscv:
  63. # GDB is currently not supported on RISC-V
  64. @$(MAKE) build_gcc BUILD_PLATFORM=riscv-elf
  65.  
  66. build-power8:
  67. @$(MAKE) build_tools BUILD_PLATFORM=powerpc64-linux-gnu
  68.  
  69. build-nds32le:
  70. @$(MAKE) build_tools BUILD_PLATFORM=nds32le-elf
  71.  
  72. build-elbrus:
  73. echo "Elbrus architecture"
  74.  
  75.  
  76. clean_tempfiles:
  77. rm -rf build-*
  78. rm -rf binutils-* gcc-* gmp-* libelf-* mpc-* mpfr-*
  79. rm -rf llvm-* clang-tools-* cfe-* compiler-rt-*
  80. rm -rf acpica-*
  81. rm -rf gdb-*
  82. rm -f getopt
  83.  
  84. clean: clean_tempfiles
  85. rm -rf xgcc
  86.  
  87. distclean: clean
  88. rm -rf tarballs
  89.  
  90. .PHONY: build_gcc build_iasl build_gdb build_clang all all_with_gdb \
  91. all_without_gdb build_tools build-i386 build-x64 build-arm \
  92. build-aarch64 build-mips build-riscv build-power8 build-nds32le \
  93. clean distclean clean_tempfiles build-elbrus
Add Comment
Please, Sign In to add comment