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.

147 lines
4.3KB

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