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.

Makefile 4.2KB

7 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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. git clone https://github.com/glfw/glfw.git
  78. cd glfw && $(CMAKE) . \
  79. -DCMAKE_INSTALL_PREFIX="$(LOCAL)" -DBUILD_SHARED_LIBS=ON \
  80. -DGLFW_COCOA_CHDIR_RESOURCES=OFF -DGLFW_COCOA_MENUBAR=ON -DGLFW_COCOA_RETINA_FRAMEBUFFER=ON
  81. $(MAKE) -C glfw
  82. $(MAKE) -C glfw install
  83. $(jansson):
  84. $(WGET) http://www.digip.org/jansson/releases/jansson-2.10.tar.gz
  85. $(UNTAR) jansson-2.10.tar.gz
  86. cd jansson-2.10 && ./configure --prefix="$(LOCAL)"
  87. $(MAKE) -C jansson-2.10
  88. $(MAKE) -C jansson-2.10 install
  89. $(libsamplerate):
  90. $(WGET) http://www.mega-nerd.com/SRC/libsamplerate-0.1.9.tar.gz
  91. $(UNTAR) libsamplerate-0.1.9.tar.gz
  92. cd libsamplerate-0.1.9 && ./configure --prefix="$(LOCAL)" --disable-fftw --disable-sndfile
  93. $(MAKE) -C libsamplerate-0.1.9/src
  94. $(MAKE) -C libsamplerate-0.1.9/src install
  95. $(libcurl):
  96. $(WGET) https://github.com/curl/curl/releases/download/curl-7_56_0/curl-7.56.0.tar.gz
  97. $(UNTAR) curl-7.56.0.tar.gz
  98. cd curl-7.56.0 && ./configure --prefix="$(LOCAL)" \
  99. --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 \
  100. --without-zlib --without-ssl --without-ca-bundle --without-ca-path --without-ca-fallback --without-libpsl --without-libmetalink --without-libssh2 --without-librtmp --without-winidn --without-libidn2 --without-nghttp2
  101. $(MAKE) -C curl-7.56.0
  102. $(MAKE) -C curl-7.56.0 install
  103. $(libzip):
  104. $(WGET) https://nih.at/libzip/libzip-1.2.0.tar.gz
  105. $(UNTAR) libzip-1.2.0.tar.gz
  106. cd libzip-1.2.0 && ./configure --prefix="$(LOCAL)"
  107. $(MAKE) -C libzip-1.2.0
  108. $(MAKE) -C libzip-1.2.0 install
  109. $(rtmidi):
  110. $(WGET) http://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-3.0.0.tar.gz
  111. $(UNTAR) rtmidi-3.0.0.tar.gz
  112. cd rtmidi-3.0.0 && ./configure --prefix="$(LOCAL)"
  113. $(MAKE) -C rtmidi-3.0.0
  114. $(MAKE) -C rtmidi-3.0.0 install
  115. $(rtaudio):
  116. git clone https://github.com/thestk/rtaudio.git
  117. cd rtaudio && mkdir -p cmakebuild
  118. cd rtaudio/cmakebuild && cmake -G 'Unix Makefiles' -DCMAKE_INSTALL_PREFIX="$(LOCAL)" $(RTAUDIO_FLAGS) ..
  119. $(MAKE) -C rtaudio/cmakebuild
  120. $(MAKE) -C rtaudio/cmakebuild install
  121. clean:
  122. git clean -ffdxi