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.3KB

7 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. LOCAL = $(shell pwd)
  2. # Arch-specifics
  3. include ../arch.mk
  4. FLAGS += -g -O3 -march=nocona
  5. ifeq ($(ARCH),mac)
  6. FLAGS += -mmacosx-version-min=10.7 -stdlib=libc++
  7. LDFLAGS += -mmacosx-version-min=10.7 -stdlib=libc++
  8. endif
  9. CFLAGS += $(FLAGS)
  10. CXXFLAGS += $(FLAGS)
  11. export CFLAGS
  12. export CXXFLAGS
  13. export LDFLAGS
  14. # Commands
  15. WGET = wget -nc
  16. UNTAR = tar xf
  17. UNZIP = unzip
  18. ifeq ($(ARCH),win)
  19. CMAKE = cmake -G 'MSYS Makefiles'
  20. else
  21. CMAKE = cmake
  22. endif
  23. # Libraries
  24. ifeq ($(ARCH),lin)
  25. glew = lib/libGLEW.so
  26. glfw = lib/libglfw.so
  27. jansson = lib/libjansson.so
  28. libspeexdsp = lib/libspeexdsp.so
  29. libcurl = lib/libcurl.so
  30. libzip = lib/libzip.so
  31. rtmidi = lib/librtmidi.so
  32. rtaudio = lib/librtaudio.so
  33. openssl = lib/libssl.so
  34. endif
  35. ifeq ($(ARCH),mac)
  36. glew = lib/libGLEW.dylib
  37. glfw = lib/libglfw.dylib
  38. jansson = lib/libjansson.dylib
  39. libspeexdsp = lib/libspeexdsp.dylib
  40. libcurl = lib/libcurl.dylib
  41. libzip = lib/libzip.dylib
  42. rtmidi = lib/librtmidi.dylib
  43. rtaudio = lib/librtaudio.dylib
  44. openssl = lib/libssl.dylib
  45. endif
  46. ifeq ($(ARCH),win)
  47. glew = bin/glew32.dll
  48. glfw = bin/glfw3.dll
  49. jansson = bin/libjansson-4.dll
  50. libspeexdsp = bin/libspeexdsp.dll
  51. libcurl = bin/libcurl-4.dll
  52. libzip = bin/libzip-5.dll
  53. rtmidi = bin/librtmidi-4.dll
  54. rtaudio = bin/librtaudio.dll
  55. openssl = bin/libssl-1_1-x64.dll
  56. endif
  57. # Library configuration
  58. ifdef RTAUDIO_ALL_APIS
  59. ifeq ($(ARCH),mac)
  60. RTAUDIO_FLAGS = -DAUDIO_OSX_CORE=ON
  61. endif
  62. ifeq ($(ARCH),win)
  63. RTAUDIO_FLAGS = -DAUDIO_WINDOWS_DS=ON -DAUDIO_WINDOWS_WASAPI=ON -DAUDIO_WINDOWS_ASIO=ON
  64. endif
  65. ifeq ($(ARCH),lin)
  66. RTAUDIO_FLAGS = -DAUDIO_LINUX_ALSA=ON
  67. endif
  68. endif
  69. .NOTPARALLEL:
  70. all: $(glew) $(glfw) $(jansson) $(libspeexdsp) $(libcurl) $(libzip) $(rtmidi) $(rtaudio)
  71. @echo ""
  72. @echo "#######################################"
  73. @echo "# Built all dependencies successfully #"
  74. @echo "#######################################"
  75. @echo ""
  76. $(glew):
  77. $(WGET) https://github.com/nigels-com/glew/releases/download/glew-2.1.0/glew-2.1.0.tgz
  78. $(UNTAR) glew-2.1.0.tgz
  79. $(MAKE) -C glew-2.1.0 glew.lib
  80. # On Linux, default lib path is lib64, so change it back to lib.
  81. $(MAKE) -C glew-2.1.0 GLEW_DEST="$(LOCAL)" LIBDIR="$(LOCAL)/lib" install
  82. $(glfw):
  83. cd glfw && $(CMAKE) . \
  84. -DCMAKE_INSTALL_PREFIX="$(LOCAL)" -DBUILD_SHARED_LIBS=ON \
  85. -DGLFW_COCOA_CHDIR_RESOURCES=OFF -DGLFW_COCOA_MENUBAR=ON -DGLFW_COCOA_RETINA_FRAMEBUFFER=ON
  86. $(MAKE) -C glfw
  87. $(MAKE) -C glfw install
  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. $(libspeexdsp):
  95. $(WGET) https://github.com/xiph/speexdsp/archive/SpeexDSP-1.2rc3.tar.gz
  96. $(UNTAR) SpeexDSP-1.2rc3.tar.gz
  97. cd speexdsp-SpeexDSP-1.2rc3 && ./autogen.sh && ./configure --prefix="$(LOCAL)"
  98. $(MAKE) -C speexdsp-SpeexDSP-1.2rc3
  99. $(MAKE) -C speexdsp-SpeexDSP-1.2rc3 install
  100. $(openssl):
  101. $(WGET) https://www.openssl.org/source/openssl-1.1.0g.tar.gz
  102. $(UNTAR) openssl-1.1.0g.tar.gz
  103. cd openssl-1.1.0g && ./config --prefix="$(LOCAL)"
  104. $(MAKE) -C openssl-1.1.0g
  105. $(MAKE) -C openssl-1.1.0g install
  106. $(libcurl): $(openssl)
  107. $(WGET) https://github.com/curl/curl/releases/download/curl-7_56_0/curl-7.56.0.tar.gz
  108. $(UNTAR) curl-7.56.0.tar.gz
  109. cd curl-7.56.0 && ./configure --prefix="$(LOCAL)" \
  110. --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 \
  111. --without-zlib --without-libpsl --without-libmetalink --without-libssh2 --without-librtmp --without-winidn --without-libidn2 --without-nghttp2 \
  112. --without-ca-bundle --with-ca-fallback --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. git clone https://github.com/thestk/rtmidi.git
  123. cd rtmidi && ./autogen.sh --no-configure && ./configure --prefix="$(LOCAL)"
  124. $(MAKE) -C rtmidi
  125. $(MAKE) -C rtmidi install
  126. $(rtaudio):
  127. cd rtaudio && mkdir -p cmakebuild
  128. cd rtaudio/cmakebuild && cmake -G 'Unix Makefiles' -DCMAKE_INSTALL_PREFIX="$(LOCAL)" $(RTAUDIO_FLAGS) ..
  129. $(MAKE) -C rtaudio/cmakebuild
  130. $(MAKE) -C rtaudio/cmakebuild install
  131. clean:
  132. git clean -ffdx