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.

180 lines
4.8KB

  1. LOCAL = $(shell pwd)
  2. # Arch-specifics
  3. include ../arch.mk
  4. FLAGS += -g -O3 -march=nocona
  5. ifeq ($(ARCH),mac)
  6. FLAGS += -mmacosx-version-min=10.7 -stdlib=libc++
  7. LDFLAGS += -mmacosx-version-min=10.7 -stdlib=libc++
  8. endif
  9. CFLAGS += $(FLAGS)
  10. CXXFLAGS += $(FLAGS)
  11. export CFLAGS
  12. export CXXFLAGS
  13. export LDFLAGS
  14. # Commands
  15. WGET = curl -OL
  16. UNTAR = tar xf
  17. UNZIP = unzip
  18. ifeq ($(ARCH),win)
  19. CMAKE = cmake -G 'MSYS Makefiles'
  20. else
  21. CMAKE = cmake
  22. endif
  23. # Libraries
  24. ifeq ($(ARCH),lin)
  25. glew = lib/libGLEW.so
  26. glfw = lib/libglfw.so
  27. jansson = lib/libjansson.so
  28. libspeexdsp = lib/libspeexdsp.so
  29. libcurl = lib/libcurl.so
  30. libzip = lib/libzip.so
  31. rtmidi = lib/librtmidi.so
  32. rtaudio = lib/librtaudio.so
  33. openssl = lib/libssl.so
  34. endif
  35. ifeq ($(ARCH),mac)
  36. glew = lib/libGLEW.dylib
  37. glfw = lib/libglfw.dylib
  38. jansson = lib/libjansson.dylib
  39. libspeexdsp = lib/libspeexdsp.dylib
  40. libcurl = lib/libcurl.dylib
  41. libzip = lib/libzip.dylib
  42. rtmidi = lib/librtmidi.dylib
  43. rtaudio = lib/librtaudio.dylib
  44. openssl = lib/libssl.dylib
  45. endif
  46. ifeq ($(ARCH),win)
  47. glew = bin/glew32.dll
  48. glfw = bin/glfw3.dll
  49. jansson = bin/libjansson-4.dll
  50. libspeexdsp = bin/libspeexdsp-1.dll
  51. libcurl = bin/libcurl-4.dll
  52. libzip = bin/libzip-5.dll
  53. rtmidi = bin/librtmidi-4.dll
  54. rtaudio = bin/librtaudio.dll
  55. openssl = bin/libssl-1_1-x64.dll
  56. endif
  57. nanovg = include/nanovg.h
  58. nanosvg = include/nanosvg.h
  59. oui-blendish = include/blendish.h
  60. osdialog = include/osdialog.h
  61. .NOTPARALLEL:
  62. all: $(glew) $(glfw) $(jansson) $(libspeexdsp) $(libcurl) $(libzip) $(rtmidi) $(rtaudio) $(nanovg) $(nanosvg) $(oui-blendish) $(osdialog)
  63. @echo ""
  64. @echo "#######################################"
  65. @echo "# Built all dependencies successfully #"
  66. @echo "#######################################"
  67. @echo ""
  68. $(glew):
  69. $(WGET) https://github.com/nigels-com/glew/releases/download/glew-2.1.0/glew-2.1.0.tgz
  70. $(UNTAR) glew-2.1.0.tgz
  71. $(MAKE) -C glew-2.1.0 glew.lib
  72. # On Linux, default lib path is lib64, so change it back to lib.
  73. $(MAKE) -C glew-2.1.0 GLEW_DEST="$(LOCAL)" LIBDIR="$(LOCAL)/lib" install
  74. $(glfw):
  75. cd glfw && $(CMAKE) . \
  76. -DCMAKE_INSTALL_PREFIX="$(LOCAL)" -DBUILD_SHARED_LIBS=ON \
  77. -DGLFW_COCOA_CHDIR_RESOURCES=OFF -DGLFW_COCOA_MENUBAR=ON -DGLFW_COCOA_RETINA_FRAMEBUFFER=ON
  78. $(MAKE) -C glfw
  79. $(MAKE) -C glfw install
  80. $(jansson):
  81. $(WGET) http://www.digip.org/jansson/releases/jansson-2.10.tar.gz
  82. $(UNTAR) jansson-2.10.tar.gz
  83. cd jansson-2.10 && ./configure --prefix="$(LOCAL)"
  84. $(MAKE) -C jansson-2.10
  85. $(MAKE) -C jansson-2.10 install
  86. $(libspeexdsp):
  87. $(WGET) https://vcvrack.com/downloads/dep/speexdsp-SpeexDSP-1.2rc3.tgz
  88. $(UNTAR) speexdsp-SpeexDSP-1.2rc3.tgz
  89. cd speexdsp-SpeexDSP-1.2rc3 && ./configure --prefix="$(LOCAL)"
  90. $(MAKE) -C speexdsp-SpeexDSP-1.2rc3
  91. $(MAKE) -C speexdsp-SpeexDSP-1.2rc3 install
  92. $(openssl):
  93. $(WGET) https://www.openssl.org/source/openssl-1.1.0g.tar.gz
  94. $(UNTAR) openssl-1.1.0g.tar.gz
  95. cd openssl-1.1.0g && ./config --prefix="$(LOCAL)"
  96. $(MAKE) -C openssl-1.1.0g
  97. $(MAKE) -C openssl-1.1.0g install_sw
  98. $(libcurl): $(openssl)
  99. $(WGET) https://github.com/curl/curl/releases/download/curl-7_56_0/curl-7.56.0.tar.gz
  100. $(UNTAR) curl-7.56.0.tar.gz
  101. cd curl-7.56.0 && ./configure --prefix="$(LOCAL)" \
  102. --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 \
  103. --without-zlib --without-libpsl --without-libmetalink --without-libssh2 --without-librtmp --without-winidn --without-libidn2 --without-nghttp2 \
  104. --without-ca-bundle --with-ca-fallback --with-ssl="$(LOCAL)"
  105. $(MAKE) -C curl-7.56.0
  106. $(MAKE) -C curl-7.56.0 install
  107. $(libzip):
  108. $(WGET) https://nih.at/libzip/libzip-1.2.0.tar.gz
  109. $(UNTAR) libzip-1.2.0.tar.gz
  110. cd libzip-1.2.0 && ./configure --prefix="$(LOCAL)"
  111. $(MAKE) -C libzip-1.2.0
  112. $(MAKE) -C libzip-1.2.0 install
  113. $(rtmidi):
  114. $(WGET) https://vcvrack.com/downloads/dep/rtmidi.tgz
  115. $(UNTAR) rtmidi.tgz
  116. cd rtmidi && ./configure --prefix="$(LOCAL)"
  117. $(MAKE) -C rtmidi
  118. $(MAKE) -C rtmidi install
  119. ifeq ($(ARCH),mac)
  120. RTAUDIO_FLAGS += -DAUDIO_OSX_CORE=ON
  121. endif
  122. ifeq ($(ARCH),win)
  123. RTAUDIO_FLAGS += -DAUDIO_WINDOWS_DS=ON -DAUDIO_WINDOWS_WASAPI=ON -DAUDIO_WINDOWS_ASIO=ON
  124. endif
  125. ifeq ($(ARCH),lin)
  126. RTAUDIO_FLAGS += -DAUDIO_LINUX_ALSA=ON
  127. endif
  128. ifdef RTAUDIO_ALL_APIS
  129. ifeq ($(ARCH),mac)
  130. RTAUDIO_FLAGS += -DAUDIO_UNIX_JACK=ON
  131. endif
  132. ifeq ($(ARCH),lin)
  133. RTAUDIO_FLAGS += -DAUDIO_LINUX_PULSE=ON -DAUDIO_UNIX_JACK=ON
  134. endif
  135. endif
  136. $(rtaudio):
  137. cd rtaudio && mkdir -p build
  138. cd rtaudio/build && cmake -G 'Unix Makefiles' -DCMAKE_INSTALL_PREFIX="$(LOCAL)" $(RTAUDIO_FLAGS) ..
  139. $(MAKE) -C rtaudio/build
  140. $(MAKE) -C rtaudio/build install
  141. $(nanovg):
  142. cp nanovg/src/*.h include/
  143. $(nanosvg):
  144. cp nanosvg/src/*.h include/
  145. $(oui-blendish):
  146. cp oui-blendish/*.h include/
  147. $(osdialog):
  148. cp osdialog/*.h include/
  149. clean:
  150. git clean -ffdx