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.

254 lines
7.8KB

  1. RACK_DIR ?= ..
  2. .NOTPARALLEL:
  3. # Target paths
  4. include $(RACK_DIR)/arch.mk
  5. ifdef ARCH_LIN
  6. glew = lib/libGLEW.a
  7. glfw = lib/libglfw3.a
  8. jansson = lib/libjansson.a
  9. openssl = lib/libssl.a
  10. libcurl = lib/libcurl.a
  11. libzip = lib/libzip.a
  12. zlib = lib/libz.a
  13. libspeexdsp = lib/libspeexdsp.a
  14. libsamplerate = lib/libsamplerate.a
  15. rtmidi = lib/librtmidi.a
  16. rtaudio = lib/librtaudio.a
  17. endif
  18. ifdef ARCH_MAC
  19. glew = lib/libGLEW.a
  20. glfw = lib/libglfw3.a
  21. jansson = lib/libjansson.a
  22. openssl = lib/libssl.a
  23. libcurl = lib/libcurl.a
  24. libzip = lib/libzip.a
  25. zlib = lib/libz.a
  26. libspeexdsp = lib/libspeexdsp.a
  27. libsamplerate = lib/libsamplerate.a
  28. rtmidi = lib/librtmidi.a
  29. rtaudio = lib/librtaudio.a
  30. endif
  31. ifdef ARCH_WIN
  32. glew = lib/libglew32.a
  33. glfw = lib/libglfw3.a
  34. jansson = lib/libjansson.a
  35. openssl = lib/libssl.a
  36. libcurl = lib/libcurl.a
  37. libzip = lib/libzip.a
  38. zlib = lib/libz.a
  39. libspeexdsp = lib/libspeexdsp.a
  40. libsamplerate = lib/libsamplerate.a
  41. rtmidi = lib/librtmidi.a
  42. rtaudio = lib/librtaudio.a
  43. endif
  44. nanovg = include/nanovg.h
  45. nanosvg = include/nanosvg.h
  46. oui-blendish = include/blendish.h
  47. osdialog = include/osdialog.h
  48. pffft = include/pffft.h
  49. DEPS += $(glew)
  50. DEPS += $(glfw)
  51. DEPS += $(jansson)
  52. DEPS += $(libcurl)
  53. DEPS += $(libzip)
  54. DEPS += $(libspeexdsp)
  55. DEPS += $(libsamplerate)
  56. DEPS += $(rtmidi)
  57. DEPS += $(rtaudio)
  58. DEPS += $(nanovg)
  59. DEPS += $(nanosvg)
  60. DEPS += $(oui-blendish)
  61. DEPS += $(osdialog)
  62. DEPS += $(pffft)
  63. DEP_LOCAL := .
  64. include $(RACK_DIR)/dep.mk
  65. # Targets
  66. glew-2.1.0:
  67. $(WGET) "https://github.com/nigels-com/glew/releases/download/glew-2.1.0/glew-2.1.0.tgz"
  68. $(SHA256) glew-2.1.0.tgz 04de91e7e6763039bc11940095cd9c7f880baba82196a7765f727ac05a993c95
  69. $(UNTAR) glew-2.1.0.tgz
  70. rm glew-2.1.0.tgz
  71. $(glew): glew-2.1.0
  72. cd glew-2.1.0 && mkdir -p build
  73. cd glew-2.1.0/build && $(CMAKE) ./cmake
  74. $(MAKE) -C glew-2.1.0/build
  75. $(MAKE) -C glew-2.1.0/build install
  76. $(glfw): glfw
  77. cd glfw && mkdir -p build
  78. cd glfw/build && $(CMAKE) .. \
  79. -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF -DGLFW_BUILD_DOCS=OFF
  80. $(MAKE) -C glfw/build
  81. $(MAKE) -C glfw/build install
  82. jansson-2.12:
  83. $(WGET) "http://www.digip.org/jansson/releases/jansson-2.12.tar.gz"
  84. $(SHA256) jansson-2.12.tar.gz 5f8dec765048efac5d919aded51b26a32a05397ea207aa769ff6b53c7027d2c9
  85. $(UNTAR) jansson-2.12.tar.gz
  86. rm jansson-2.12.tar.gz
  87. $(jansson): jansson-2.12
  88. cd jansson-2.12 && $(CONFIGURE)
  89. $(MAKE) -C jansson-2.12
  90. $(MAKE) -C jansson-2.12 install
  91. openssl-1.1.1d:
  92. $(WGET) "https://www.openssl.org/source/openssl-1.1.1d.tar.gz"
  93. $(SHA256) openssl-1.1.1d.tar.gz 1e3a91bc1f9dfce01af26026f856e064eab4c8ee0a8f457b5ae30b40b8b711f2
  94. $(UNTAR) openssl-1.1.1d.tar.gz
  95. rm openssl-1.1.1d.tar.gz
  96. $(openssl): openssl-1.1.1d
  97. @# ./config ignores CFLAGS, so hack it in with CC
  98. cd openssl-1.1.1d && CC="$(CC) $(CFLAGS)" ./config --prefix="$(DEP_PATH)"
  99. $(MAKE) -C openssl-1.1.1d
  100. $(MAKE) -C openssl-1.1.1d install_sw
  101. curl-7.66.0:
  102. $(WGET) "https://curl.haxx.se/download/curl-7.66.0.tar.gz"
  103. $(SHA256) curl-7.66.0.tar.gz d0393da38ac74ffac67313072d7fe75b1fa1010eb5987f63f349b024a36b7ffb
  104. $(UNTAR) curl-7.66.0.tar.gz
  105. rm curl-7.66.0.tar.gz
  106. CURL_FLAGS += --disable-ftp --disable-file --disable-ldap --disable-ldaps --disable-rtsp --enable-proxy --disable-dict --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smb --disable-smtp --disable-gopher --disable-manual --disable-shared --disable-symbol-hiding
  107. CURL_FLAGS += --without-zlib --without-libpsl --without-libmetalink --without-libssh2 --without-librtmp --without-winidn --without-libidn2 --without-nghttp2 --without-brotli
  108. CURL_FLAGS += --with-ssl="$(DEP_PATH)"
  109. $(libcurl): $(openssl) curl-7.66.0
  110. cd curl-7.66.0 && PKG_CONFIG_PATH= $(CONFIGURE) $(CURL_FLAGS)
  111. $(MAKE) -C curl-7.66.0
  112. $(MAKE) -C curl-7.66.0 install
  113. libzip-1.5.2:
  114. $(WGET) "https://libzip.org/download/libzip-1.5.2.tar.gz"
  115. $(SHA256) libzip-1.5.2.tar.gz be694a4abb2ffe5ec02074146757c8b56084dbcebf329123c84b205417435e15
  116. $(UNTAR) libzip-1.5.2.tar.gz
  117. rm libzip-1.5.2.tar.gz
  118. $(libzip): $(zlib) libzip-1.5.2
  119. cd libzip-1.5.2 && mkdir -p build
  120. cd libzip-1.5.2/build && $(CMAKE) .. -DCMAKE_FIND_ROOT_PATH="$(DEP_PATH)" -DENABLE_COMMONCRYPTO=OFF -DENABLE_GNUTLS=OFF -DENABLE_MBEDTLS=OFF -DENABLE_OPENSSL=OFF -DENABLE_WINDOWS_CRYPTO=OFF -DENABLE_BZIP2=OFF -DBUILD_TOOLS=OFF -DBUILD_REGRESS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_DOC=OFF -DBUILD_SHARED_LIBS=OFF
  121. $(MAKE) -C libzip-1.5.2/build
  122. $(MAKE) -C libzip-1.5.2/build install
  123. zlib-1.2.11:
  124. $(WGET) "https://www.zlib.net/zlib-1.2.11.tar.gz"
  125. $(SHA256) zlib-1.2.11.tar.gz c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1
  126. $(UNTAR) zlib-1.2.11.tar.gz
  127. rm zlib-1.2.11.tar.gz
  128. $(zlib): zlib-1.2.11
  129. ifdef ARCH_WIN
  130. $(MAKE) -C zlib-1.2.11 -f win32/Makefile.gcc
  131. $(MAKE) -C zlib-1.2.11 -f win32/Makefile.gcc BINARY_PATH="$(DEP_PATH)/bin" INCLUDE_PATH="$(DEP_PATH)/include" LIBRARY_PATH="$(DEP_PATH)/lib" install
  132. else
  133. # Don't use $(CONFIGURE) because this is a handwritten configure script
  134. cd zlib-1.2.11 && ./configure --prefix="$(DEP_PATH)"
  135. $(MAKE) -C zlib-1.2.11
  136. $(MAKE) -C zlib-1.2.11 install
  137. endif
  138. speexdsp-SpeexDSP-1.2rc3:
  139. $(WGET) "https://vcvrack.com/downloads/dep/speexdsp-SpeexDSP-1.2rc3.tgz"
  140. $(SHA256) speexdsp-SpeexDSP-1.2rc3.tgz c8dded1454747f65956f981c95e7f89a06abdaa2a53e8aeaa66bab2a3d59cebd
  141. $(UNTAR) speexdsp-SpeexDSP-1.2rc3.tgz
  142. rm speexdsp-SpeexDSP-1.2rc3.tgz
  143. $(libspeexdsp): speexdsp-SpeexDSP-1.2rc3
  144. cd speexdsp-SpeexDSP-1.2rc3 && $(CONFIGURE)
  145. $(MAKE) -C speexdsp-SpeexDSP-1.2rc3
  146. $(MAKE) -C speexdsp-SpeexDSP-1.2rc3 install
  147. libsamplerate-0.1.9:
  148. $(WGET) "http://www.mega-nerd.com/SRC/libsamplerate-0.1.9.tar.gz"
  149. $(SHA256) libsamplerate-0.1.9.tar.gz 0a7eb168e2f21353fb6d84da152e4512126f7dc48ccb0be80578c565413444c1
  150. $(UNTAR) libsamplerate-0.1.9.tar.gz
  151. rm libsamplerate-0.1.9.tar.gz
  152. $(libsamplerate): libsamplerate-0.1.9
  153. cd libsamplerate-0.1.9 && $(CONFIGURE) --disable-fftw --disable-sndfile
  154. $(MAKE) -C libsamplerate-0.1.9
  155. $(MAKE) -C libsamplerate-0.1.9 install
  156. rtmidi-4.0.0:
  157. $(WGET) "http://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-4.0.0.tar.gz"
  158. $(SHA256) rtmidi-4.0.0.tar.gz 370cfe710f43fbeba8d2b8c8bc310f314338c519c2cf2865e2d2737b251526cd
  159. $(UNTAR) rtmidi-4.0.0.tar.gz
  160. rm rtmidi-4.0.0.tar.gz
  161. RTMIDI_FLAGS += --enable-shared=no
  162. ifdef ARCH_LIN
  163. RTMIDI_FLAGS += --with-jack --with-alsa
  164. endif
  165. ifdef ARCH_MAC
  166. RTMIDI_FLAGS += --with-core --without-jack
  167. endif
  168. ifdef ARCH_WIN
  169. RTMIDI_FLAGS += --with-winmm
  170. endif
  171. $(rtmidi): rtmidi-4.0.0
  172. cd rtmidi-4.0.0 && $(CONFIGURE) $(RTMIDI_FLAGS)
  173. $(MAKE) -C rtmidi-4.0.0
  174. $(MAKE) -C rtmidi-4.0.0 install
  175. RTAUDIO_FLAGS += -DRTAUDIO_BUILD_STATIC_LIBS=ON
  176. ifdef ARCH_LIN
  177. RTAUDIO_FLAGS += -DRTAUDIO_API_ALSA=ON -DRTAUDIO_API_JACK=ON -DRTAUDIO_API_PULSE=OFF -DRTAUDIO_API_OSS=OFF
  178. endif
  179. ifdef ARCH_MAC
  180. RTAUDIO_FLAGS += -DRTAUDIO_API_CORE=ON -DRTAUDIO_API_PULSE=OFF -DRTAUDIO_API_JACK=OFF
  181. endif
  182. ifdef ARCH_WIN
  183. RTAUDIO_FLAGS += -DRTAUDIO_API_DS=ON -DRTAUDIO_API_WASAPI=ON -DRTAUDIO_API_ASIO=ON
  184. endif
  185. $(rtaudio): rtaudio
  186. cd rtaudio && mkdir -p build
  187. cd rtaudio/build && $(CMAKE) $(RTAUDIO_FLAGS) ..
  188. $(MAKE) -C rtaudio/build
  189. $(MAKE) -C rtaudio/build install
  190. $(nanovg): $(wildcard nanovg/src/*.h) nanovg/example/stb_image_write.h
  191. cp $^ include/
  192. $(nanosvg): $(wildcard nanosvg/src/*.h)
  193. cp $^ include/
  194. $(oui-blendish): $(wildcard oui-blendish/*.h)
  195. cp $^ include/
  196. $(osdialog): $(wildcard osdialog/*.h)
  197. cp $^ include/
  198. jpommier-pffft-29e4f76ac53b:
  199. $(WGET) "https://bitbucket.org/jpommier/pffft/get/29e4f76ac53b.zip"
  200. $(SHA256) 29e4f76ac53b.zip bb10afba127904a0c6c553fa445082729b7d72373511bda1b12a5be0e03f318a
  201. $(UNZIP) 29e4f76ac53b.zip
  202. rm 29e4f76ac53b.zip
  203. $(pffft): jpommier-pffft-29e4f76ac53b
  204. cp jpommier-pffft-29e4f76ac53b/*.h include/
  205. # Helpers
  206. src: glew-2.1.0 glfw jansson-2.12 speexdsp-SpeexDSP-1.2rc3 openssl-1.1.1d curl-7.66.0 libzip-1.5.2 zlib-1.2.11 rtmidi-4.0.0 rtaudio nanovg nanosvg oui-blendish osdialog jpommier-pffft-29e4f76ac53b
  207. clean:
  208. git clean -fdx
  209. git submodule foreach git clean -fdx