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.

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