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.

277 lines
10KB

  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_static.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. fuzzysearchdatabase = include/FuzzySearchDatabase.hpp
  50. ghcfilesystem = include/ghc/filesystem.hpp
  51. tinyexpr = include/tinyexpr.h
  52. sse2neon = include/sse2neon.h
  53. DEPS += $(glew)
  54. DEPS += $(glfw)
  55. DEPS += $(jansson)
  56. DEPS += $(libcurl)
  57. DEPS += $(libarchive)
  58. DEPS += $(libspeexdsp)
  59. DEPS += $(libsamplerate)
  60. DEPS += $(rtmidi)
  61. DEPS += $(rtaudio)
  62. DEPS += $(nanovg)
  63. DEPS += $(nanosvg)
  64. DEPS += $(oui-blendish)
  65. DEPS += $(osdialog)
  66. DEPS += $(pffft)
  67. DEPS += $(fuzzysearchdatabase)
  68. DEPS += $(ghcfilesystem)
  69. DEPS += $(tinyexpr)
  70. DEPS += $(sse2neon)
  71. DEP_LOCAL := .
  72. include $(RACK_DIR)/dep.mk
  73. # Targets
  74. # These targets are all order-only "|" because we usually don't care if a library was built before or after other libraries.
  75. glew-2.1.0:
  76. $(WGET) "https://github.com/nigels-com/glew/releases/download/glew-2.1.0/glew-2.1.0.tgz"
  77. $(SHA256) glew-2.1.0.tgz 04de91e7e6763039bc11940095cd9c7f880baba82196a7765f727ac05a993c95
  78. $(UNTAR) glew-2.1.0.tgz
  79. rm glew-2.1.0.tgz
  80. $(glew): | glew-2.1.0
  81. cd glew-2.1.0 && mkdir -p build
  82. cd glew-2.1.0/build && $(CMAKE) ./cmake
  83. $(MAKE) -C glew-2.1.0/build
  84. $(MAKE) -C glew-2.1.0/build install
  85. $(glfw): | glfw
  86. cd glfw && mkdir -p build
  87. cd glfw/build && $(CMAKE) .. \
  88. -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF -DGLFW_BUILD_DOCS=OFF
  89. $(MAKE) -C glfw/build
  90. $(MAKE) -C glfw/build install
  91. jansson-2.12:
  92. $(WGET) "https://github.com/akheron/jansson/releases/download/v2.12/jansson-2.12.tar.gz" || $(WGET) "http://www.digip.org/jansson/releases/jansson-2.12.tar.gz"
  93. $(SHA256) jansson-2.12.tar.gz 5f8dec765048efac5d919aded51b26a32a05397ea207aa769ff6b53c7027d2c9
  94. $(UNTAR) jansson-2.12.tar.gz
  95. rm jansson-2.12.tar.gz
  96. $(jansson): | jansson-2.12
  97. cd jansson-2.12 && $(CONFIGURE)
  98. $(MAKE) -C jansson-2.12
  99. $(MAKE) -C jansson-2.12 install
  100. openssl-1.1.1k:
  101. $(WGET) "https://www.openssl.org/source/openssl-1.1.1k.tar.gz"
  102. $(SHA256) openssl-1.1.1k.tar.gz 892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5
  103. $(UNTAR) openssl-1.1.1k.tar.gz
  104. rm openssl-1.1.1k.tar.gz
  105. $(openssl): | openssl-1.1.1k
  106. # The CFLAGS environment variable is ignored, so pass CFLAGS to their custom ./config script, which passes them to the compiler.
  107. # Set no-pinshared so OpenSSL doesn't call GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_PIN, ...) on initialization on Windows. This prevents libRack from being unloaded on Windows with FreeLibrary().
  108. cd openssl-1.1.1k && ./config --prefix="$(DEP_PATH)" no-shared no-hw threads no-zlib no-capieng no-pinshared $(CFLAGS)
  109. $(MAKE) -C openssl-1.1.1k
  110. $(MAKE) -C openssl-1.1.1k install_sw
  111. curl-7.79.1:
  112. $(WGET) "https://github.com/curl/curl/releases/download/curl-7_79_1/curl-7.79.1.tar.gz" || $(WGET) "https://curl.se/download/curl-7.79.1.tar.gz"
  113. $(SHA256) curl-7.79.1.tar.gz 370b11201349816287fb0ccc995e420277fbfcaf76206e309b3f60f0eda090c2
  114. $(UNTAR) curl-7.79.1.tar.gz
  115. rm curl-7.79.1.tar.gz
  116. CURL_FLAGS += --disable-symbol-hiding --enable-shared=no
  117. CURL_FLAGS += --enable-http --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-mqtt --disable-manual --enable-threaded-resolver --enable-pthreads --enable-verbose --disable-sspi --disable-ntlm --disable-ntlm-wb --disable-tls-srp --disable-unix-sockets --disable-doh --disable-mime --disable-dateparse --disable-netrc --disable-progress-meter --disable-alt-svc
  118. CURL_FLAGS += --without-hyper --without-zlib --without-brotli --without-zstd --without-libpsl --without-libgsasl --without-libssh2 --without-librtmp --without-winidn --without-libidn2 --without-nghttp2 --without-ngtcp2 --without-nghttp3 --without-quiche
  119. CURL_FLAGS += --with-ssl="$(DEP_PATH)"
  120. $(libcurl): | $(openssl) curl-7.79.1
  121. cd curl-7.79.1 && PKG_CONFIG_PATH= $(CONFIGURE) $(CURL_FLAGS)
  122. $(MAKE) -C curl-7.79.1
  123. $(MAKE) -C curl-7.79.1 install
  124. zstd-1.4.5:
  125. $(WGET) "https://github.com/facebook/zstd/releases/download/v1.4.5/zstd-1.4.5.tar.gz"
  126. $(SHA256) zstd-1.4.5.tar.gz 98e91c7c6bf162bf90e4e70fdbc41a8188b9fa8de5ad840c401198014406ce9e
  127. $(UNTAR) zstd-1.4.5.tar.gz
  128. rm zstd-1.4.5.tar.gz
  129. $(zstd): | zstd-1.4.5
  130. cd zstd-1.4.5/build/cmake && $(CMAKE) -DZSTD_BUILD_PROGRAMS=ON -DZSTD_BUILD_SHARED=ON -DZSTD_BUILD_STATIC=ON -DZSTD_MULTITHREAD_SUPPORT=OFF .
  131. $(MAKE) -C zstd-1.4.5/build/cmake
  132. $(MAKE) -C zstd-1.4.5/build/cmake install
  133. libarchive-3.4.3:
  134. $(WGET) "https://github.com/libarchive/libarchive/releases/download/v3.4.3/libarchive-3.4.3.tar.gz" || $(WGET) "https://libarchive.org/downloads/libarchive-3.4.3.tar.gz"
  135. $(SHA256) libarchive-3.4.3.tar.gz ee1e749213c108cb60d53147f18c31a73d6717d7e3d2481c157e1b34c881ea39
  136. $(UNTAR) libarchive-3.4.3.tar.gz
  137. rm libarchive-3.4.3.tar.gz
  138. $(libarchive): | $(zstd) libarchive-3.4.3
  139. #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
  140. cd libarchive-3.4.3 && mkdir -p build
  141. cd libarchive-3.4.3/build && $(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 -DBUILD_TESTING:BOOL=OFF ..
  142. $(MAKE) -C libarchive-3.4.3/build
  143. $(MAKE) -C libarchive-3.4.3/build install
  144. speexdsp-SpeexDSP-1.2rc3:
  145. $(WGET) "https://vcvrack.com/downloads/dep/speexdsp-SpeexDSP-1.2rc3.tgz"
  146. $(SHA256) speexdsp-SpeexDSP-1.2rc3.tgz c8dded1454747f65956f981c95e7f89a06abdaa2a53e8aeaa66bab2a3d59cebd
  147. $(UNTAR) speexdsp-SpeexDSP-1.2rc3.tgz
  148. rm speexdsp-SpeexDSP-1.2rc3.tgz
  149. $(libspeexdsp): | speexdsp-SpeexDSP-1.2rc3
  150. cd speexdsp-SpeexDSP-1.2rc3 && $(CONFIGURE)
  151. $(MAKE) -C speexdsp-SpeexDSP-1.2rc3
  152. $(MAKE) -C speexdsp-SpeexDSP-1.2rc3 install
  153. libsamplerate-0.1.9:
  154. $(WGET) "https://github.com/libsndfile/libsamplerate/releases/download/0.1.9/libsamplerate-0.1.9.tar.gz" || $(WGET) "http://www.mega-nerd.com/SRC/libsamplerate-0.1.9.tar.gz"
  155. $(SHA256) libsamplerate-0.1.9.tar.gz 0a7eb168e2f21353fb6d84da152e4512126f7dc48ccb0be80578c565413444c1
  156. $(UNTAR) libsamplerate-0.1.9.tar.gz
  157. rm libsamplerate-0.1.9.tar.gz
  158. $(libsamplerate): | libsamplerate-0.1.9
  159. cd libsamplerate-0.1.9 && $(CONFIGURE) --disable-fftw --disable-sndfile
  160. $(MAKE) -C libsamplerate-0.1.9
  161. $(MAKE) -C libsamplerate-0.1.9 install
  162. RTMIDI_FLAGS += --enable-shared=no
  163. ifdef ARCH_LIN
  164. RTMIDI_FLAGS += --with-alsa --with-jack
  165. endif
  166. ifdef ARCH_MAC
  167. RTMIDI_FLAGS += --with-core --without-jack
  168. endif
  169. ifdef ARCH_WIN
  170. RTMIDI_FLAGS += --with-winmm
  171. endif
  172. $(rtmidi): | rtmidi
  173. cd rtmidi && ./autogen.sh --no-configure
  174. cd rtmidi && $(CONFIGURE) $(RTMIDI_FLAGS)
  175. $(MAKE) -C rtmidi
  176. $(MAKE) -C rtmidi install
  177. RTAUDIO_FLAGS += -DRTAUDIO_BUILD_STATIC_LIBS=ON -DRTAUDIO_BUILD_TESTING=OFF
  178. ifdef ARCH_LIN
  179. RTAUDIO_FLAGS += -DRTAUDIO_API_ALSA=ON -DRTAUDIO_API_JACK=ON -DRTAUDIO_API_PULSE=ON -DRTAUDIO_API_OSS=OFF
  180. endif
  181. ifdef ARCH_MAC
  182. RTAUDIO_FLAGS += -DRTAUDIO_API_CORE=ON -DRTAUDIO_API_PULSE=OFF -DRTAUDIO_API_JACK=OFF
  183. endif
  184. ifdef ARCH_WIN
  185. RTAUDIO_FLAGS += -DRTAUDIO_API_DS=ON -DRTAUDIO_API_WASAPI=ON
  186. # ASIO is proprietary software owned by Steinberg, so distributing it with your own VCV Rack build would violate Rack's GPLv3 license.
  187. # However, since VCV owns the copyright of all GPL'd code in the Rack package, we include ASIO in the Windows build for convenience to our users.
  188. ifdef RTAUDIO_ASIO
  189. RTAUDIO_FLAGS += -DRTAUDIO_API_ASIO=ON
  190. else
  191. RTAUDIO_FLAGS += -DRTAUDIO_API_ASIO=OFF
  192. endif
  193. endif
  194. $(rtaudio): | rtaudio
  195. cd rtaudio && mkdir -p build
  196. cd rtaudio/build && $(CMAKE) $(RTAUDIO_FLAGS) ..
  197. $(MAKE) -C rtaudio/build
  198. $(MAKE) -C rtaudio/build install
  199. $(nanovg): $(wildcard nanovg/src/*.h) nanovg/example/stb_image_write.h
  200. mkdir -p include
  201. cp $^ include/
  202. $(nanosvg): $(wildcard nanosvg/src/*.h)
  203. mkdir -p include
  204. cp $^ include/
  205. $(oui-blendish): $(wildcard oui-blendish/*.h)
  206. mkdir -p include
  207. cp $^ include/
  208. $(osdialog): $(wildcard osdialog/*.h)
  209. mkdir -p include
  210. cp $^ include/
  211. $(pffft): | pffft
  212. mkdir -p include
  213. cp pffft/*.h include/
  214. $(fuzzysearchdatabase): fuzzysearchdatabase/src/FuzzySearchDatabase.hpp
  215. mkdir -p include
  216. cp $^ include/
  217. $(ghcfilesystem): filesystem/include/ghc
  218. mkdir -p include
  219. cp -r $^ include/
  220. $(tinyexpr): tinyexpr/tinyexpr.h
  221. mkdir -p include
  222. cp $^ include/
  223. $(sse2neon): sse2neon/sse2neon.h
  224. mkdir -p include
  225. cp $^ include/
  226. # Helpers
  227. src: glew-2.1.0 glfw jansson-2.12 speexdsp-SpeexDSP-1.2rc3 libsamplerate-0.1.9 openssl-1.1.1k curl-7.79.1 zstd-1.4.5 libarchive-3.4.3 rtaudio nanovg nanosvg oui-blendish osdialog
  228. clean:
  229. git clean -fdx
  230. git submodule foreach git clean -fdx