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.

169 lines
5.1KB

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