You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

146 lines
3.9KB

  1. # Installation path for executables
  2. LOCAL_DIR := $(PWD)/local
  3. # Local programs should have higher path priority than system-installed programs
  4. export PATH := $(LOCAL_DIR)/bin:$(PATH)
  5. all: toolchain-linux toolchain-windows toolchain-mac
  6. crosstool-ng := $(LOCAL_DIR)/bin/ct-ng
  7. $(crosstool-ng):
  8. wget -c "http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-1.24.0.tar.xz"
  9. tar -xf crosstool-ng-1.24.0.tar.xz
  10. rm crosstool-ng-1.24.0.tar.xz
  11. cd crosstool-ng-1.24.0 && ./bootstrap
  12. cd crosstool-ng-1.24.0 && ./configure --prefix="$(LOCAL_DIR)"
  13. cd crosstool-ng-1.24.0 && make
  14. cd crosstool-ng-1.24.0 && make install
  15. rm -rf crosstool-ng-1.24.0
  16. toolchain-linux := $(LOCAL_DIR)/x86_64-ubuntu16.04-linux-gnu
  17. toolchain-linux: $(toolchain-linux)
  18. $(toolchain-linux): $(crosstool-ng)
  19. ct-ng x86_64-ubuntu16.04-linux-gnu
  20. CT_PREFIX="$(LOCAL_DIR)" ct-ng build
  21. rm -rf .build .config
  22. # HACK Copy GL include dir to toolchain sysroot
  23. chmod +w $(toolchain-linux)/x86_64-ubuntu16.04-linux-gnu/sysroot/usr/include
  24. cp -r /usr/include/GL $(toolchain-linux)/x86_64-ubuntu16.04-linux-gnu/sysroot/usr/include/
  25. chmod -w $(toolchain-linux)/x86_64-ubuntu16.04-linux-gnu/sysroot/usr/include
  26. toolchain-windows := $(LOCAL_DIR)/x86_64-w64-mingw32
  27. toolchain-windows: $(toolchain-windows)
  28. $(toolchain-windows): $(crosstool-ng)
  29. ct-ng x86_64-w64-mingw32
  30. CT_PREFIX="$(LOCAL_DIR)" ct-ng build
  31. rm -rf .build .config
  32. toolchain-mac := osxcross
  33. toolchain-mac: $(toolchain-mac)
  34. $(toolchain-mac):
  35. git clone "https://github.com/tpoechtrager/osxcross.git" $@
  36. cd $@ && git checkout a791ad4fca685ea9fceb520b77db586881cd3f3d
  37. # Build clang
  38. #cd $@ && UNATTENDED=1 DISABLE_BOOTSTRAP=1 INSTALLPREFIX="$(LOCAL_DIR)" OCDEBUG=1 ./build_clang.sh
  39. #cd $@/build/llvm-10.0.1.src/build && make install
  40. # Build osxcross
  41. cp MacOSX10.13.sdk.tar.bz2 $@/tarballs/
  42. cd $@ && UNATTENDED=1 TARGET_DIR="$(LOCAL_DIR)/osxcross" ./build.sh
  43. rack-sdk := Rack-SDK
  44. rack-sdk: $(rack-sdk)
  45. $(rack-sdk):
  46. wget -c "https://vcvrack.com/downloads/Rack-SDK-1.1.6.zip"
  47. unzip Rack-SDK-1.1.6.zip
  48. rm Rack-SDK-1.1.6.zip
  49. RACK_DIR := $(PWD)/$(rack-sdk)
  50. plugin-build-mac: export PATH := $(PWD)/osxcross/target/bin:$(PATH)
  51. plugin-build-mac: export CC := x86_64-apple-darwin17-clang
  52. plugin-build-mac: export CXX := x86_64-apple-darwin17-clang++-libc++
  53. plugin-build-mac: export STRIP := x86_64-apple-darwin17-strip
  54. plugin-build-windows: export PATH := $(LOCAL_DIR)/x86_64-w64-mingw32/bin:$(PATH)
  55. plugin-build-windows: export CC := x86_64-w64-mingw32-gcc
  56. plugin-build-windows: export CXX := x86_64-w64-mingw32-g++
  57. plugin-build-windows: export STRIP := x86_64-w64-mingw32-strip
  58. plugin-build-linux: export PATH:=$(LOCAL_DIR)/x86_64-ubuntu16.04-linux-gnu/bin:$(PATH)
  59. plugin-build-linux: export CC := x86_64-ubuntu16.04-linux-gnu-gcc
  60. plugin-build-linux: export CXX := x86_64-ubuntu16.04-linux-gnu-g++
  61. plugin-build-linux: export STRIP := x86_64-ubuntu16.04-linux-gnu-strip
  62. plugin-build-mac plugin-build-windows plugin-build-linux: export RACK_DIR := $(RACK_DIR)
  63. plugin-build-mac plugin-build-windows plugin-build-linux:
  64. cd $(PLUGIN_DIR) && $(MAKE) clean
  65. cd $(PLUGIN_DIR) && $(MAKE) cleandep
  66. cd $(PLUGIN_DIR) && $(MAKE) dep
  67. cd $(PLUGIN_DIR) && $(MAKE) dist
  68. mkdir -p plugin-build
  69. cp $(PLUGIN_DIR)/dist/*.zip plugin-build/
  70. cd $(PLUGIN_DIR) && $(MAKE) clean
  71. plugin-build: plugin-build-mac plugin-build-windows plugin-build-linux
  72. dep-ubuntu:
  73. sudo apt-get update
  74. sudo apt-get install -y --no-install-recommends \
  75. ca-certificates \
  76. git \
  77. build-essential \
  78. autoconf \
  79. automake \
  80. bison \
  81. flex \
  82. gawk \
  83. libtool-bin \
  84. libncurses5-dev \
  85. unzip \
  86. zip \
  87. jq \
  88. libgl-dev \
  89. libglu-dev \
  90. git \
  91. wget \
  92. curl \
  93. cmake \
  94. nasm \
  95. xz-utils \
  96. file \
  97. python3 \
  98. libxml2-dev \
  99. libssl-dev \
  100. texinfo \
  101. help2man
  102. dep-arch-linux:
  103. # TODO Complete this list
  104. sudo pacman -S --needed \
  105. wget \
  106. help2man
  107. docker-build:
  108. docker build -t rack-plugin-toolchain:1 .
  109. docker-run:
  110. docker run --rm -it rack-plugin-toolchain:1
  111. .NOTPARALLEL:
  112. .PHONY: all plugin-build