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
8.4KB

  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. zstd = lib/libzstd.a
  12. libarchive = lib/libarchive.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. zstd = lib/libzstd.a
  25. libarchive = lib/libarchive.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. zstd = lib/libzstd.a
  38. libarchive = lib/libarchive.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 += $(libarchive)
  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. # These targets are all order-only "|" because we usually don't care if a library was built before or after other libraries.
  67. glew-2.1.0:
  68. $(WGET) "https://github.com/nigels-com/glew/releases/download/glew-2.1.0/glew-2.1.0.tgz"
  69. $(SHA256) glew-2.1.0.tgz 04de91e7e6763039bc11940095cd9c7f880baba82196a7765f727ac05a993c95
  70. $(UNTAR) glew-2.1.0.tgz
  71. rm glew-2.1.0.tgz
  72. $(glew): | glew-2.1.0
  73. cd glew-2.1.0 && mkdir -p build
  74. cd glew-2.1.0/build && $(CMAKE) ./cmake
  75. $(MAKE) -C glew-2.1.0/build
  76. $(MAKE) -C glew-2.1.0/build install
  77. $(glfw): | glfw
  78. cd glfw && mkdir -p build
  79. cd glfw/build && $(CMAKE) .. \
  80. -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF -DGLFW_BUILD_DOCS=OFF
  81. $(MAKE) -C glfw/build
  82. $(MAKE) -C glfw/build install
  83. jansson-2.12:
  84. $(WGET) "http://www.digip.org/jansson/releases/jansson-2.12.tar.gz"
  85. $(SHA256) jansson-2.12.tar.gz 5f8dec765048efac5d919aded51b26a32a05397ea207aa769ff6b53c7027d2c9
  86. $(UNTAR) jansson-2.12.tar.gz
  87. rm jansson-2.12.tar.gz
  88. $(jansson): | jansson-2.12
  89. cd jansson-2.12 && $(CONFIGURE)
  90. $(MAKE) -C jansson-2.12
  91. $(MAKE) -C jansson-2.12 install
  92. openssl-1.1.1d:
  93. $(WGET) "https://www.openssl.org/source/openssl-1.1.1d.tar.gz"
  94. $(SHA256) openssl-1.1.1d.tar.gz 1e3a91bc1f9dfce01af26026f856e064eab4c8ee0a8f457b5ae30b40b8b711f2
  95. $(UNTAR) openssl-1.1.1d.tar.gz
  96. rm openssl-1.1.1d.tar.gz
  97. $(openssl): | openssl-1.1.1d
  98. @# ./config ignores CFLAGS, so hack it in with CC
  99. cd openssl-1.1.1d && CC="$(CC) $(CFLAGS)" ./config --prefix="$(DEP_PATH)"
  100. $(MAKE) -C openssl-1.1.1d
  101. $(MAKE) -C openssl-1.1.1d install_sw
  102. curl-7.66.0:
  103. $(WGET) "https://curl.haxx.se/download/curl-7.66.0.tar.gz"
  104. $(SHA256) curl-7.66.0.tar.gz d0393da38ac74ffac67313072d7fe75b1fa1010eb5987f63f349b024a36b7ffb
  105. $(UNTAR) curl-7.66.0.tar.gz
  106. rm curl-7.66.0.tar.gz
  107. 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
  108. CURL_FLAGS += --without-zlib --without-libpsl --without-libmetalink --without-libssh2 --without-librtmp --without-winidn --without-libidn2 --without-nghttp2 --without-brotli
  109. CURL_FLAGS += --with-ssl="$(DEP_PATH)"
  110. $(libcurl): | $(openssl) curl-7.66.0
  111. cd curl-7.66.0 && PKG_CONFIG_PATH= $(CONFIGURE) $(CURL_FLAGS)
  112. $(MAKE) -C curl-7.66.0
  113. $(MAKE) -C curl-7.66.0 install
  114. zstd-1.4.5:
  115. $(WGET) "https://github.com/facebook/zstd/releases/download/v1.4.5/zstd-1.4.5.tar.gz"
  116. $(SHA256) zstd-1.4.5.tar.gz 98e91c7c6bf162bf90e4e70fdbc41a8188b9fa8de5ad840c401198014406ce9e
  117. $(UNTAR) zstd-1.4.5.tar.gz
  118. rm zstd-1.4.5.tar.gz
  119. $(zstd): | zstd-1.4.5
  120. cd zstd-1.4.5/build/cmake && $(CMAKE) -DZSTD_BUILD_PROGRAMS=ON -DZSTD_BUILD_SHARED=ON -DZSTD_BUILD_STATIC=ON -DZSTD_MULTITHREAD_SUPPORT=OFF .
  121. $(MAKE) -C zstd-1.4.5/build/cmake
  122. $(MAKE) -C zstd-1.4.5/build/cmake install
  123. libarchive-3.4.3:
  124. $(WGET) "https://libarchive.org/downloads/libarchive-3.4.3.tar.gz"
  125. $(SHA256) libarchive-3.4.3.tar.gz ee1e749213c108cb60d53147f18c31a73d6717d7e3d2481c157e1b34c881ea39
  126. $(UNTAR) libarchive-3.4.3.tar.gz
  127. rm libarchive-3.4.3.tar.gz
  128. $(libarchive): | $(zstd) libarchive-3.4.3
  129. cd libarchive-3.4.3 && $(CONFIGURE) --enable-shared=no --enable-static=yes --disable-bsdtar --disable-bsdcat --disable-bsdcpio --disable-posix-regex-lib --disable-xattr --disable-acl --without-zlib --without-bz2lib --without-libb2 --without-iconv --without-lz4 --without-lzma --without-cng --without-openssl --without-xml2 --without-expat
  130. # cd libarchive-3.4.3 && $(CMAKE) -DENABLE_ACL:BOOL=OFF -DENABLE_BZip2:BOOL=OFF -DENABLE_CAT:BOOL=OFF -DENABLE_CNG:BOOL=OFF -DENABLE_COVERAGE:BOOL=OFF -DENABLE_CPIO:BOOL=OFF -DENABLE_EXPAT:BOOL=OFF -DENABLE_ICONV:BOOL=OFF -DENABLE_LIBB2:BOOL=OFF -DENABLE_LIBXML2:BOOL=OFF -DENABLE_LZ4:BOOL=OFF -DENABLE_LZMA:BOOL=OFF -DENABLE_LZO:BOOL=OFF -DENABLE_MBEDTLS:BOOL=OFF -DENABLE_NETTLE:BOOL=OFF -DENABLE_OPENSSL:BOOL=OFF -DENABLE_TAR:BOOL=OFF -DENABLE_TEST:BOOL=OFF -DENABLE_WERROR:BOOL=OFF -DENABLE_XATTR:BOOL=OFF -DENABLE_ZLIB:BOOL=OFF -DENABLE_ZSTD:BOOL=ON -DZSTD_INCLUDE_DIR:PATH=$(DEP_PATH)/include .
  131. $(MAKE) -C libarchive-3.4.3
  132. $(MAKE) -C libarchive-3.4.3 install
  133. speexdsp-SpeexDSP-1.2rc3:
  134. $(WGET) "https://vcvrack.com/downloads/dep/speexdsp-SpeexDSP-1.2rc3.tgz"
  135. $(SHA256) speexdsp-SpeexDSP-1.2rc3.tgz c8dded1454747f65956f981c95e7f89a06abdaa2a53e8aeaa66bab2a3d59cebd
  136. $(UNTAR) speexdsp-SpeexDSP-1.2rc3.tgz
  137. rm speexdsp-SpeexDSP-1.2rc3.tgz
  138. $(libspeexdsp): | speexdsp-SpeexDSP-1.2rc3
  139. cd speexdsp-SpeexDSP-1.2rc3 && $(CONFIGURE)
  140. $(MAKE) -C speexdsp-SpeexDSP-1.2rc3
  141. $(MAKE) -C speexdsp-SpeexDSP-1.2rc3 install
  142. libsamplerate-0.1.9:
  143. $(WGET) "http://www.mega-nerd.com/SRC/libsamplerate-0.1.9.tar.gz"
  144. $(SHA256) libsamplerate-0.1.9.tar.gz 0a7eb168e2f21353fb6d84da152e4512126f7dc48ccb0be80578c565413444c1
  145. $(UNTAR) libsamplerate-0.1.9.tar.gz
  146. rm libsamplerate-0.1.9.tar.gz
  147. $(libsamplerate): | libsamplerate-0.1.9
  148. cd libsamplerate-0.1.9 && $(CONFIGURE) --disable-fftw --disable-sndfile
  149. $(MAKE) -C libsamplerate-0.1.9
  150. $(MAKE) -C libsamplerate-0.1.9 install
  151. rtmidi-4.0.0:
  152. $(WGET) "http://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-4.0.0.tar.gz"
  153. $(SHA256) rtmidi-4.0.0.tar.gz 370cfe710f43fbeba8d2b8c8bc310f314338c519c2cf2865e2d2737b251526cd
  154. $(UNTAR) rtmidi-4.0.0.tar.gz
  155. rm rtmidi-4.0.0.tar.gz
  156. RTMIDI_FLAGS += --enable-shared=no
  157. ifdef ARCH_LIN
  158. RTMIDI_FLAGS += --with-jack --with-alsa
  159. endif
  160. ifdef ARCH_MAC
  161. RTMIDI_FLAGS += --with-core --without-jack
  162. endif
  163. ifdef ARCH_WIN
  164. RTMIDI_FLAGS += --with-winmm
  165. endif
  166. $(rtmidi): | rtmidi-4.0.0
  167. cd rtmidi-4.0.0 && $(CONFIGURE) $(RTMIDI_FLAGS)
  168. $(MAKE) -C rtmidi-4.0.0
  169. $(MAKE) -C rtmidi-4.0.0 install
  170. RTAUDIO_FLAGS += -DRTAUDIO_BUILD_STATIC_LIBS=ON -DRTAUDIO_BUILD_TESTING=OFF
  171. ifdef ARCH_LIN
  172. RTAUDIO_FLAGS += -DRTAUDIO_API_ALSA=ON -DRTAUDIO_API_JACK=ON -DRTAUDIO_API_PULSE=OFF -DRTAUDIO_API_OSS=OFF
  173. endif
  174. ifdef ARCH_MAC
  175. RTAUDIO_FLAGS += -DRTAUDIO_API_CORE=ON -DRTAUDIO_API_PULSE=OFF -DRTAUDIO_API_JACK=OFF
  176. endif
  177. ifdef ARCH_WIN
  178. RTAUDIO_FLAGS += -DRTAUDIO_API_DS=ON -DRTAUDIO_API_WASAPI=ON -DRTAUDIO_API_ASIO=ON
  179. endif
  180. $(rtaudio): | rtaudio
  181. cd rtaudio && mkdir -p build
  182. cd rtaudio/build && $(CMAKE) $(RTAUDIO_FLAGS) ..
  183. $(MAKE) -C rtaudio/build
  184. $(MAKE) -C rtaudio/build install
  185. $(nanovg): $(wildcard nanovg/src/*.h) nanovg/example/stb_image_write.h
  186. mkdir -p include
  187. cp $^ include/
  188. $(nanosvg): $(wildcard nanosvg/src/*.h)
  189. mkdir -p include
  190. cp $^ include/
  191. $(oui-blendish): $(wildcard oui-blendish/*.h)
  192. mkdir -p include
  193. cp $^ include/
  194. $(osdialog): $(wildcard osdialog/*.h)
  195. mkdir -p include
  196. cp $^ include/
  197. pffft:
  198. $(WGET) "https://vcvrack.com/downloads/dep/pffft.zip"
  199. $(SHA256) pffft.zip fd3ebe4f3843675a79912167a4e74415ed0ad302ed8adc90e1af23a7c67654b4
  200. $(UNZIP) pffft.zip
  201. rm pffft.zip
  202. $(pffft): | pffft
  203. mkdir -p include
  204. cp pffft/*.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 zstd-1.4.5 libarchive-3.4.3 rtmidi-4.0.0 rtaudio nanovg nanosvg oui-blendish osdialog pffft
  207. clean:
  208. git clean -fdx
  209. git submodule foreach git clean -fdx