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.

173 lines
4.8KB

  1. RACK_DIR ?= ..
  2. .NOTPARALLEL:
  3. # Target paths
  4. include $(RACK_DIR)/arch.mk
  5. ifeq ($(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. ifeq ($(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. ifeq ($(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. DEPS += $(glew) $(glfw) $(jansson) $(libspeexdsp) $(libcurl) $(libzip) $(rtmidi) $(rtaudio) $(nanovg) $(nanosvg) $(oui-blendish) $(osdialog)
  46. include $(RACK_DIR)/dep.mk
  47. # Targets
  48. $(glew):
  49. $(WGET) "https://github.com/nigels-com/glew/releases/download/glew-2.1.0/glew-2.1.0.tgz"
  50. $(UNTAR) glew-2.1.0.tgz
  51. cd glew-2.1.0 && mkdir -p build
  52. cd glew-2.1.0/build && $(CMAKE) -DCMAKE_INSTALL_LIBDIR=lib ./cmake
  53. $(MAKE) -C glew-2.1.0/build
  54. $(MAKE) -C glew-2.1.0/build install
  55. $(glfw):
  56. cd glfw && $(CMAKE) . \
  57. -DGLFW_COCOA_CHDIR_RESOURCES=OFF -DGLFW_COCOA_MENUBAR=ON -DGLFW_COCOA_RETINA_FRAMEBUFFER=ON
  58. $(MAKE) -C glfw
  59. $(MAKE) -C glfw install
  60. $(jansson):
  61. $(WGET) "http://www.digip.org/jansson/releases/jansson-2.10.tar.gz"
  62. $(UNTAR) jansson-2.10.tar.gz
  63. cd jansson-2.10 && $(CONFIGURE)
  64. $(MAKE) -C jansson-2.10
  65. $(MAKE) -C jansson-2.10 install
  66. $(libspeexdsp):
  67. $(WGET) "https://vcvrack.com/downloads/dep/speexdsp-SpeexDSP-1.2rc3.tgz"
  68. $(UNTAR) speexdsp-SpeexDSP-1.2rc3.tgz
  69. cd speexdsp-SpeexDSP-1.2rc3 && $(CONFIGURE)
  70. $(MAKE) -C speexdsp-SpeexDSP-1.2rc3
  71. $(MAKE) -C speexdsp-SpeexDSP-1.2rc3 install
  72. $(openssl):
  73. $(WGET) "https://www.openssl.org/source/openssl-1.1.0h.tar.gz"
  74. $(UNTAR) openssl-1.1.0h.tar.gz
  75. # ./config ignores CFLAGS, so hack it in with CC
  76. cd openssl-1.1.0h && CC="$(CC) $(CFLAGS)" ./config --prefix="$(realpath $(DEP_LOCAL))"
  77. $(MAKE) -C openssl-1.1.0h
  78. $(MAKE) -C openssl-1.1.0h install_sw
  79. $(libcurl): $(openssl)
  80. $(WGET) "https://curl.haxx.se/download/curl-7.59.0.tar.gz"
  81. $(UNTAR) curl-7.59.0.tar.gz
  82. cd curl-7.59.0 && PKG_CONFIG_PATH="$(realpath $(DEP_LOCAL))/lib/pkgconfig" $(CONFIGURE) \
  83. --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 \
  84. --without-zlib --without-libpsl --without-libmetalink --without-libssh2 --without-librtmp --without-winidn --without-libidn2 --without-nghttp2 --without-brotli \
  85. --without-ca-bundle --with-ca-fallback --with-ssl
  86. $(MAKE) -C curl-7.59.0
  87. $(MAKE) -C curl-7.59.0 install
  88. $(libzip): $(zlib)
  89. $(WGET) "https://nih.at/libzip/libzip-1.2.0.tar.gz"
  90. $(UNTAR) libzip-1.2.0.tar.gz
  91. cd libzip-1.2.0 && $(CONFIGURE)
  92. $(MAKE) -C libzip-1.2.0
  93. $(MAKE) -C libzip-1.2.0 install
  94. $(zlib):
  95. $(WGET) "https://www.zlib.net/zlib-1.2.11.tar.gz"
  96. $(UNTAR) zlib-1.2.11.tar.gz
  97. ifeq ($(ARCH), win)
  98. $(MAKE) -C zlib-1.2.11 -f win32/Makefile.gcc
  99. $(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
  100. else
  101. cd zlib-1.2.11 && $(CONFIGURE)
  102. $(MAKE) -C zlib-1.2.11
  103. $(MAKE) -C zlib-1.2.11 install
  104. endif
  105. $(rtmidi):
  106. $(WGET) "https://vcvrack.com/downloads/dep/rtmidi.tgz"
  107. $(UNTAR) rtmidi.tgz
  108. cd rtmidi && $(CONFIGURE)
  109. $(MAKE) -C rtmidi
  110. $(MAKE) -C rtmidi install
  111. ifeq ($(ARCH), mac)
  112. RTAUDIO_FLAGS += -DAUDIO_OSX_CORE=ON
  113. endif
  114. ifeq ($(ARCH), win)
  115. RTAUDIO_FLAGS += -DAUDIO_WINDOWS_DS=ON -DAUDIO_WINDOWS_WASAPI=ON -DAUDIO_WINDOWS_ASIO=ON
  116. endif
  117. ifeq ($(ARCH), lin)
  118. RTAUDIO_FLAGS += -DAUDIO_LINUX_ALSA=ON -DAUDIO_UNIX_JACK=ON
  119. endif
  120. ifdef RTAUDIO_ALL_APIS
  121. ifeq ($(ARCH), mac)
  122. RTAUDIO_FLAGS += -DAUDIO_UNIX_JACK=ON
  123. endif
  124. ifeq ($(ARCH), lin)
  125. RTAUDIO_FLAGS += -DAUDIO_LINUX_PULSE=ON
  126. endif
  127. endif
  128. $(rtaudio):
  129. cd rtaudio && mkdir -p build
  130. cd rtaudio/build && $(CMAKE) $(RTAUDIO_FLAGS) ..
  131. $(MAKE) -C rtaudio/build
  132. $(MAKE) -C rtaudio/build install
  133. # For some reason, it doesn't install the static library
  134. cp rtaudio/build/librtaudio_static.a lib/librtaudio.a
  135. $(nanovg):
  136. cp nanovg/src/*.h include/
  137. $(nanosvg):
  138. cp nanosvg/src/*.h include/
  139. $(oui-blendish):
  140. cp oui-blendish/*.h include/
  141. $(osdialog):
  142. cp osdialog/*.h include/
  143. clean:
  144. git clean -fdx
  145. git submodule foreach git clean -fdx