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.

157 lines
4.6KB

  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. endif
  31. ifeq ($(ARCH),mac)
  32. glew = lib/libGLEW.dylib
  33. glfw = lib/libglfw.dylib
  34. jansson = lib/libjansson.dylib
  35. libsamplerate = lib/libsamplerate.dylib
  36. libcurl = lib/libcurl.dylib
  37. libzip = lib/libzip.dylib
  38. rtmidi = lib/librtmidi.dylib
  39. rtaudio = lib/librtaudio.dylib
  40. openssl = lib/libssl.dylib
  41. endif
  42. ifeq ($(ARCH),win)
  43. glew = bin/glew32.dll
  44. glfw = bin/glfw3.dll
  45. jansson = bin/libjansson-4.dll
  46. libsamplerate = bin/libsamplerate-0.dll
  47. libcurl = bin/libcurl-4.dll
  48. libzip = bin/libzip-5.dll
  49. rtmidi = bin/librtmidi-4.dll
  50. rtaudio = bin/librtaudio.dll
  51. openssl = bin/libssl-1_1-x64.dll
  52. endif
  53. # Library configuration
  54. ifdef RTAUDIO_ALL_APIS
  55. ifeq ($(ARCH),mac)
  56. RTAUDIO_FLAGS = -DAUDIO_OSX_CORE=ON
  57. endif
  58. ifeq ($(ARCH),win)
  59. RTAUDIO_FLAGS = -DAUDIO_WINDOWS_DS=ON -DAUDIO_WINDOWS_WASAPI=ON -DAUDIO_WINDOWS_ASIO=ON
  60. endif
  61. ifeq ($(ARCH),lin)
  62. RTAUDIO_FLAGS = -DAUDIO_LINUX_ALSA=ON
  63. endif
  64. endif
  65. .NOTPARALLEL:
  66. all: $(glew) $(glfw) $(jansson) $(libsamplerate) $(libcurl) $(libzip) $(rtmidi) $(rtaudio)
  67. @echo ""
  68. @echo "#######################################"
  69. @echo "# Built all dependencies successfully #"
  70. @echo "#######################################"
  71. @echo ""
  72. $(glew):
  73. $(WGET) https://github.com/nigels-com/glew/releases/download/glew-2.1.0/glew-2.1.0.tgz
  74. $(UNTAR) glew-2.1.0.tgz
  75. $(MAKE) -C glew-2.1.0 glew.lib
  76. # On Linux, default lib path is lib64, so change it back to lib.
  77. $(MAKE) -C glew-2.1.0 GLEW_DEST="$(LOCAL)" LIBDIR="$(LOCAL)/lib" install
  78. $(glfw):
  79. $(WGET) https://github.com/glfw/glfw/releases/download/3.2.1/glfw-3.2.1.zip
  80. $(UNZIP) glfw-3.2.1.zip
  81. cd glfw-3.2.1 && $(CMAKE) . \
  82. -DCMAKE_INSTALL_PREFIX="$(LOCAL)" -DBUILD_SHARED_LIBS=ON \
  83. -DGLFW_USE_CHDIR=OFF -DGLFW_USE_MENUBAR=ON -DGLFW_USE_RETINA=ON
  84. $(MAKE) -C glfw-3.2.1
  85. $(MAKE) -C glfw-3.2.1 install
  86. ifeq ($(ARCH),win)
  87. # Not sure why the GLFW build system puts a .dll in the lib directory
  88. mv "$(LOCAL)/lib/glfw3.dll" "$(LOCAL)/bin/"
  89. endif
  90. $(jansson):
  91. $(WGET) http://www.digip.org/jansson/releases/jansson-2.10.tar.gz
  92. $(UNTAR) jansson-2.10.tar.gz
  93. cd jansson-2.10 && ./configure --prefix="$(LOCAL)"
  94. $(MAKE) -C jansson-2.10
  95. $(MAKE) -C jansson-2.10 install
  96. $(libsamplerate):
  97. $(WGET) http://www.mega-nerd.com/SRC/libsamplerate-0.1.9.tar.gz
  98. $(UNTAR) libsamplerate-0.1.9.tar.gz
  99. cd libsamplerate-0.1.9 && ./configure --prefix="$(LOCAL)" --disable-fftw --disable-sndfile
  100. $(MAKE) -C libsamplerate-0.1.9/src
  101. $(MAKE) -C libsamplerate-0.1.9/src install
  102. $(openssl):
  103. $(WGET) https://www.openssl.org/source/openssl-1.1.0g.tar.gz
  104. $(UNTAR) openssl-1.1.0g.tar.gz
  105. cd openssl-1.1.0g && ./config --prefix="$(LOCAL)"
  106. $(MAKE) -C openssl-1.1.0g
  107. $(MAKE) -C openssl-1.1.0g install
  108. $(libcurl): $(openssl)
  109. $(WGET) https://github.com/curl/curl/releases/download/curl-7_56_0/curl-7.56.0.tar.gz
  110. $(UNTAR) curl-7.56.0.tar.gz
  111. cd curl-7.56.0 && ./configure --prefix="$(LOCAL)" \
  112. --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 \
  113. --without-zlib --without-libpsl --without-libmetalink --without-libssh2 --without-librtmp --without-winidn --without-libidn2 --without-nghttp2 \
  114. --without-ca-bundle --with-ca-fallback --with-ssl="$(LOCAL)"
  115. $(MAKE) -C curl-7.56.0
  116. $(MAKE) -C curl-7.56.0 install
  117. $(libzip):
  118. $(WGET) https://nih.at/libzip/libzip-1.2.0.tar.gz
  119. $(UNTAR) libzip-1.2.0.tar.gz
  120. cd libzip-1.2.0 && ./configure --prefix="$(LOCAL)"
  121. $(MAKE) -C libzip-1.2.0
  122. $(MAKE) -C libzip-1.2.0 install
  123. $(rtmidi):
  124. $(WGET) http://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-3.0.0.tar.gz
  125. $(UNTAR) rtmidi-3.0.0.tar.gz
  126. cd rtmidi-3.0.0 && ./configure --prefix="$(LOCAL)"
  127. $(MAKE) -C rtmidi-3.0.0
  128. $(MAKE) -C rtmidi-3.0.0 install
  129. $(rtaudio):
  130. git clone https://github.com/thestk/rtaudio.git
  131. cd rtaudio && mkdir -p cmakebuild
  132. cd rtaudio/cmakebuild && cmake -G 'Unix Makefiles' -DCMAKE_INSTALL_PREFIX="$(LOCAL)" $(RTAUDIO_FLAGS) ..
  133. $(MAKE) -C rtaudio/cmakebuild
  134. $(MAKE) -C rtaudio/cmakebuild install
  135. clean:
  136. git clean -ffdxi