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.

143 lines
4.5KB

  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. portaudio = lib/libportaudio.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. portaudio = lib/libportaudio.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. portaudio = bin/portaudio_x64.dll
  50. endif
  51. .NOTPARALLEL:
  52. all: $(glew) $(glfw) $(jansson) $(libsamplerate) $(libcurl) $(libzip) $(rtmidi) $(portaudio)
  53. @echo ""
  54. @echo "#######################################"
  55. @echo "# Built all dependencies successfully #"
  56. @echo "#######################################"
  57. @echo ""
  58. $(glew):
  59. $(WGET) https://github.com/nigels-com/glew/releases/download/glew-2.1.0/glew-2.1.0.tgz
  60. $(UNTAR) glew-2.1.0.tgz
  61. $(MAKE) -C glew-2.1.0 glew.lib
  62. # On Linux, default lib path is lib64, so change it back to lib.
  63. $(MAKE) -C glew-2.1.0 GLEW_DEST="$(LOCAL)" LIBDIR="$(LOCAL)/lib" install
  64. $(glfw):
  65. $(WGET) https://github.com/glfw/glfw/releases/download/3.2.1/glfw-3.2.1.zip
  66. $(UNZIP) glfw-3.2.1.zip
  67. cd glfw-3.2.1 && $(CMAKE) . \
  68. -DCMAKE_INSTALL_PREFIX="$(LOCAL)" -DBUILD_SHARED_LIBS=ON \
  69. -DGLFW_USE_CHDIR=OFF -DGLFW_USE_MENUBAR=ON -DGLFW_USE_RETINA=ON
  70. $(MAKE) -C glfw-3.2.1
  71. $(MAKE) -C glfw-3.2.1 install
  72. ifeq ($(ARCH),win)
  73. # Not sure why the GLFW build system puts a .dll in the lib directory
  74. mv "$(LOCAL)/lib/glfw3.dll" "$(LOCAL)/bin/"
  75. endif
  76. $(jansson):
  77. $(WGET) http://www.digip.org/jansson/releases/jansson-2.10.tar.gz
  78. $(UNTAR) jansson-2.10.tar.gz
  79. cd jansson-2.10 && ./configure --prefix="$(LOCAL)"
  80. $(MAKE) -C jansson-2.10
  81. $(MAKE) -C jansson-2.10 install
  82. $(libsamplerate):
  83. $(WGET) http://www.mega-nerd.com/SRC/libsamplerate-0.1.9.tar.gz
  84. $(UNTAR) libsamplerate-0.1.9.tar.gz
  85. cd libsamplerate-0.1.9 && ./configure --prefix="$(LOCAL)" --disable-fftw --disable-sndfile
  86. $(MAKE) -C libsamplerate-0.1.9/src
  87. $(MAKE) -C libsamplerate-0.1.9/src install
  88. $(libcurl):
  89. $(WGET) https://github.com/curl/curl/releases/download/curl-7_56_0/curl-7.56.0.tar.gz
  90. $(UNTAR) curl-7.56.0.tar.gz
  91. cd curl-7.56.0 && ./configure --prefix="$(LOCAL)" \
  92. --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 \
  93. --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
  94. $(MAKE) -C curl-7.56.0
  95. $(MAKE) -C curl-7.56.0 install
  96. $(libzip):
  97. $(WGET) https://nih.at/libzip/libzip-1.2.0.tar.gz
  98. $(UNTAR) libzip-1.2.0.tar.gz
  99. cd libzip-1.2.0 && ./configure --prefix="$(LOCAL)"
  100. $(MAKE) -C libzip-1.2.0
  101. $(MAKE) -C libzip-1.2.0 install
  102. $(rtmidi):
  103. $(WGET) http://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-3.0.0.tar.gz
  104. $(UNTAR) rtmidi-3.0.0.tar.gz
  105. cd rtmidi-3.0.0 && ./configure --prefix="$(LOCAL)"
  106. $(MAKE) -C rtmidi-3.0.0
  107. $(MAKE) -C rtmidi-3.0.0 install
  108. $(portaudio):
  109. ifeq ($(ARCH),win)
  110. $(WGET) https://github.com/adfernandes/precompiled-portaudio-windows/raw/master/portaudio-r1891-build.zip
  111. $(UNZIP) portaudio-r1891-build.zip
  112. mv portaudio-r1891-build portaudio
  113. cp portaudio/lib/x64/ReleaseMinDependency/portaudio_x64.lib "$(LOCAL)/lib"
  114. cp portaudio/lib/x64/ReleaseMinDependency/portaudio_x64.dll "$(LOCAL)/bin"
  115. cp portaudio/include/*.h "$(LOCAL)/include"
  116. else
  117. $(WGET) http://www.portaudio.com/archives/pa_stable_v190600_20161030.tgz
  118. $(UNTAR) pa_stable_v190600_20161030.tgz
  119. cd portaudio && ./configure --prefix="$(LOCAL)" --disable-debug --disable-dependency-tracking --enable-mac-universal=no
  120. $(MAKE) -C portaudio
  121. $(MAKE) -C portaudio install
  122. endif
  123. clean:
  124. git clean -ffdxi