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.

151 lines
4.4KB

  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. libspeexdsp = lib/libspeexdsp.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. libspeexdsp = lib/libspeexdsp.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. libspeexdsp = bin/libspeexdsp.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) $(libspeexdsp) $(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. cd glfw && $(CMAKE) . \
  81. -DCMAKE_INSTALL_PREFIX="$(LOCAL)" -DBUILD_SHARED_LIBS=ON \
  82. -DGLFW_COCOA_CHDIR_RESOURCES=OFF -DGLFW_COCOA_MENUBAR=ON -DGLFW_COCOA_RETINA_FRAMEBUFFER=ON
  83. $(MAKE) -C glfw
  84. $(MAKE) -C glfw install
  85. $(jansson):
  86. $(WGET) http://www.digip.org/jansson/releases/jansson-2.10.tar.gz
  87. $(UNTAR) jansson-2.10.tar.gz
  88. cd jansson-2.10 && ./configure --prefix="$(LOCAL)"
  89. $(MAKE) -C jansson-2.10
  90. $(MAKE) -C jansson-2.10 install
  91. $(libspeexdsp):
  92. $(WGET) https://github.com/xiph/speexdsp/archive/SpeexDSP-1.2rc3.tar.gz
  93. $(UNTAR) SpeexDSP-1.2rc3.tar.gz
  94. cd speexdsp-SpeexDSP-1.2rc3 && ./autogen.sh && ./configure --prefix="$(LOCAL)"
  95. $(MAKE) -C speexdsp-SpeexDSP-1.2rc3
  96. $(MAKE) -C speexdsp-SpeexDSP-1.2rc3 install
  97. $(openssl):
  98. $(WGET) https://www.openssl.org/source/openssl-1.1.0g.tar.gz
  99. $(UNTAR) openssl-1.1.0g.tar.gz
  100. cd openssl-1.1.0g && ./config --prefix="$(LOCAL)"
  101. $(MAKE) -C openssl-1.1.0g
  102. $(MAKE) -C openssl-1.1.0g install
  103. $(libcurl): $(openssl)
  104. $(WGET) https://github.com/curl/curl/releases/download/curl-7_56_0/curl-7.56.0.tar.gz
  105. $(UNTAR) curl-7.56.0.tar.gz
  106. cd curl-7.56.0 && ./configure --prefix="$(LOCAL)" \
  107. --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 \
  108. --without-zlib --without-libpsl --without-libmetalink --without-libssh2 --without-librtmp --without-winidn --without-libidn2 --without-nghttp2 \
  109. --without-ca-bundle --with-ca-fallback --with-ssl="$(LOCAL)"
  110. $(MAKE) -C curl-7.56.0
  111. $(MAKE) -C curl-7.56.0 install
  112. $(libzip):
  113. $(WGET) https://nih.at/libzip/libzip-1.2.0.tar.gz
  114. $(UNTAR) libzip-1.2.0.tar.gz
  115. cd libzip-1.2.0 && ./configure --prefix="$(LOCAL)"
  116. $(MAKE) -C libzip-1.2.0
  117. $(MAKE) -C libzip-1.2.0 install
  118. $(rtmidi):
  119. $(WGET) http://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-3.0.0.tar.gz
  120. $(UNTAR) rtmidi-3.0.0.tar.gz
  121. cd rtmidi-3.0.0 && ./configure --prefix="$(LOCAL)"
  122. $(MAKE) -C rtmidi-3.0.0
  123. $(MAKE) -C rtmidi-3.0.0 install
  124. $(rtaudio):
  125. cd rtaudio && mkdir -p cmakebuild
  126. cd rtaudio/cmakebuild && cmake -G 'Unix Makefiles' -DCMAKE_INSTALL_PREFIX="$(LOCAL)" $(RTAUDIO_FLAGS) ..
  127. $(MAKE) -C rtaudio/cmakebuild
  128. $(MAKE) -C rtaudio/cmakebuild install
  129. clean:
  130. git clean -ffdx