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.

170 lines
4.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. libspeexdsp = lib/libspeexdsp.a
  10. libcurl = lib/libcurl.a
  11. libzip = lib/libzip.a
  12. zlib = lib/libz.a
  13. rtmidi = lib/librtmidi.a
  14. rtaudio = lib/librtaudio.a
  15. openssl = lib/libssl.a
  16. endif
  17. ifdef ARCH_MAC
  18. glew = lib/libGLEW.a
  19. glfw = lib/libglfw3.a
  20. jansson = lib/libjansson.a
  21. libspeexdsp = lib/libspeexdsp.a
  22. libcurl = lib/libcurl.a
  23. libzip = lib/libzip.a
  24. zlib = lib/libz.a
  25. rtmidi = lib/librtmidi.a
  26. rtaudio = lib/librtaudio.a
  27. openssl = lib/libssl.a
  28. endif
  29. ifdef ARCH_WIN
  30. glew = lib/libglew32.a
  31. glfw = lib/libglfw3.a
  32. jansson = lib/libjansson.a
  33. libspeexdsp = lib/libspeexdsp.a
  34. libcurl = lib/libcurl.a
  35. libzip = lib/libzip.a
  36. zlib = lib/libz.a
  37. rtmidi = lib/librtmidi.a
  38. rtaudio = lib/librtaudio.a
  39. openssl = lib/libssl.a
  40. endif
  41. nanovg = include/nanovg.h
  42. nanosvg = include/nanosvg.h
  43. oui-blendish = include/blendish.h
  44. osdialog = include/osdialog.h
  45. pffft = include/pffft.h
  46. DEPS += $(glew) $(glfw) $(jansson) $(libspeexdsp) $(libcurl) $(libzip) $(rtmidi) $(rtaudio) $(nanovg) $(nanosvg) $(oui-blendish) $(osdialog) $(pffft)
  47. include $(RACK_DIR)/dep.mk
  48. # Targets
  49. $(glew):
  50. $(WGET) "https://github.com/nigels-com/glew/releases/download/glew-2.1.0/glew-2.1.0.tgz"
  51. $(UNTAR) glew-2.1.0.tgz
  52. cd glew-2.1.0 && mkdir -p build
  53. cd glew-2.1.0/build && $(CMAKE) -DCMAKE_INSTALL_LIBDIR=lib ./cmake
  54. $(MAKE) -C glew-2.1.0/build
  55. $(MAKE) -C glew-2.1.0/build install
  56. $(glfw):
  57. cd glfw && $(CMAKE) . \
  58. -DGLFW_COCOA_CHDIR_RESOURCES=OFF -DGLFW_COCOA_MENUBAR=ON -DGLFW_COCOA_RETINA_FRAMEBUFFER=ON
  59. $(MAKE) -C glfw
  60. $(MAKE) -C glfw install
  61. $(jansson):
  62. $(WGET) "http://www.digip.org/jansson/releases/jansson-2.10.tar.gz"
  63. $(UNTAR) jansson-2.10.tar.gz
  64. cd jansson-2.10 && $(CONFIGURE)
  65. $(MAKE) -C jansson-2.10
  66. $(MAKE) -C jansson-2.10 install
  67. $(libspeexdsp):
  68. $(WGET) "https://vcvrack.com/downloads/dep/speexdsp-SpeexDSP-1.2rc3.tgz"
  69. $(UNTAR) speexdsp-SpeexDSP-1.2rc3.tgz
  70. cd speexdsp-SpeexDSP-1.2rc3 && $(CONFIGURE)
  71. $(MAKE) -C speexdsp-SpeexDSP-1.2rc3
  72. $(MAKE) -C speexdsp-SpeexDSP-1.2rc3 install
  73. $(openssl):
  74. $(WGET) "https://www.openssl.org/source/openssl-1.1.0h.tar.gz"
  75. $(UNTAR) openssl-1.1.0h.tar.gz
  76. @# ./config ignores CFLAGS, so hack it in with CC
  77. cd openssl-1.1.0h && CC="$(CC) $(CFLAGS)" ./config --prefix="$(realpath $(DEP_LOCAL))"
  78. $(MAKE) -C openssl-1.1.0h
  79. $(MAKE) -C openssl-1.1.0h install_sw
  80. $(libcurl): $(openssl)
  81. $(WGET) "https://curl.haxx.se/download/curl-7.59.0.tar.gz"
  82. $(UNTAR) curl-7.59.0.tar.gz
  83. cd curl-7.59.0 && PKG_CONFIG_PATH= $(CONFIGURE) \
  84. --disable-ftp --disable-file --disable-ldap --disable-ldaps --disable-rtsp --disable-proxy --disable-dict --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smb --disable-smtp --disable-gopher --disable-manual --disable-shared --disable-symbol-hiding \
  85. --without-zlib --without-libpsl --without-libmetalink --without-libssh2 --without-librtmp --without-winidn --without-libidn2 --without-nghttp2 --without-brotli \
  86. --without-ca-bundle --with-ca-fallback --with-ssl=$(realpath $(DEP_LOCAL))
  87. $(MAKE) -C curl-7.59.0
  88. $(MAKE) -C curl-7.59.0 install
  89. $(libzip): $(zlib)
  90. $(WGET) "https://nih.at/libzip/libzip-1.2.0.tar.gz"
  91. $(UNTAR) libzip-1.2.0.tar.gz
  92. cd libzip-1.2.0 && $(CONFIGURE)
  93. $(MAKE) -C libzip-1.2.0
  94. $(MAKE) -C libzip-1.2.0 install
  95. $(zlib):
  96. $(WGET) "https://www.zlib.net/zlib-1.2.11.tar.gz"
  97. $(UNTAR) zlib-1.2.11.tar.gz
  98. ifdef ARCH_WIN
  99. $(MAKE) -C zlib-1.2.11 -f win32/Makefile.gcc
  100. $(MAKE) -C zlib-1.2.11 -f win32/Makefile.gcc BINARY_PATH="$(realpath $(DEP_LOCAL))/bin" INCLUDE_PATH="$(realpath $(DEP_LOCAL))/include" LIBRARY_PATH="$(realpath $(DEP_LOCAL))/lib" install
  101. else
  102. cd zlib-1.2.11 && $(CONFIGURE)
  103. $(MAKE) -C zlib-1.2.11
  104. $(MAKE) -C zlib-1.2.11 install
  105. endif
  106. $(rtmidi):
  107. $(WGET) "https://vcvrack.com/downloads/dep/rtmidi.tgz"
  108. $(UNTAR) rtmidi.tgz
  109. cd rtmidi && $(CONFIGURE)
  110. $(MAKE) -C rtmidi
  111. $(MAKE) -C rtmidi install
  112. ifdef ARCH_MAC
  113. RTAUDIO_FLAGS += -DAUDIO_OSX_CORE=ON
  114. endif
  115. ifdef ARCH_WIN
  116. RTAUDIO_FLAGS += -DAUDIO_WINDOWS_DS=ON -DAUDIO_WINDOWS_WASAPI=ON -DAUDIO_WINDOWS_ASIO=ON
  117. endif
  118. ifdef ARCH_LIN
  119. RTAUDIO_FLAGS += -DAUDIO_LINUX_ALSA=ON -DAUDIO_UNIX_JACK=ON
  120. endif
  121. $(rtaudio):
  122. cd rtaudio && mkdir -p build
  123. cd rtaudio/build && $(CMAKE) $(RTAUDIO_FLAGS) ..
  124. $(MAKE) -C rtaudio/build
  125. $(MAKE) -C rtaudio/build install
  126. @# For some reason, it doesn't install the static library
  127. cp rtaudio/build/librtaudio_static.a lib/librtaudio.a
  128. $(nanovg): $(wildcard nanovg/src/*.h)
  129. cp $^ include/
  130. $(nanosvg): $(wildcard nanosvg/src/*.h)
  131. cp $^ include/
  132. $(oui-blendish): $(wildcard oui-blendish/*.h)
  133. cp $^ include/
  134. $(osdialog): $(wildcard osdialog/*.h)
  135. cp $^ include/
  136. $(pffft):
  137. $(WGET) "https://bitbucket.org/jpommier/pffft/get/29e4f76ac53b.zip"
  138. $(UNZIP) 29e4f76ac53b.zip
  139. cp jpommier-pffft-29e4f76ac53b/*.h include/
  140. clean:
  141. git clean -fdx
  142. git submodule foreach git clean -fdx