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.

141 lines
4.4KB

  1. LOCAL = $(shell pwd)
  2. # Arch-specifics
  3. include ../arch.mk
  4. ifeq ($(ARCH),mac)
  5. export CFLAGS = -mmacosx-version-min=10.7
  6. export CXXFLAGS = $(CFLAGS)
  7. export LDFLAGS = $(CFLAGS)
  8. endif
  9. # Commands
  10. WGET = wget -nc
  11. UNTAR = tar xf
  12. UNZIP = unzip
  13. ifeq ($(ARCH),win)
  14. CMAKE = cmake -G 'MSYS Makefiles'
  15. else
  16. CMAKE = cmake
  17. endif
  18. # Libraries
  19. ifeq ($(ARCH),lin)
  20. glew = lib/libGLEW.so
  21. glfw = lib/libglfw.so
  22. jansson = lib/libjansson.so
  23. libsamplerate = lib/libsamplerate.so
  24. libcurl = lib/libcurl.so
  25. libzip = lib/libzip.so
  26. portmidi = lib/libportmidi.so
  27. portaudio = lib/libportaudio.so
  28. endif
  29. ifeq ($(ARCH),mac)
  30. glew = lib/libGLEW.dylib
  31. glfw = lib/libglfw.dylib
  32. jansson = lib/libjansson.dylib
  33. libsamplerate = lib/libsamplerate.dylib
  34. libcurl = lib/libcurl.dylib
  35. libzip = lib/libzip.dylib
  36. portmidi = lib/libportmidi.dylib
  37. portaudio = lib/libportaudio.dylib
  38. endif
  39. ifeq ($(ARCH),win)
  40. glew = bin/glew32.dll
  41. glfw = bin/glfw3.dll
  42. jansson = bin/libjansson-4.dll
  43. libsamplerate = bin/libsamplerate-0.dll
  44. libcurl = bin/libcurl-4.dll
  45. libzip = bin/libzip-5.dll
  46. portmidi = bin/libportmidi.dll
  47. portaudio = bin/libportaudio_x64.dll
  48. endif
  49. .NOTPARALLEL:
  50. all: $(glew) $(glfw) $(jansson) $(libsamplerate) $(libcurl) $(libzip) $(portmidi) $(portaudio)
  51. @echo ""
  52. @echo "#######################################"
  53. @echo "# Built all dependencies successfully #"
  54. @echo "#######################################"
  55. @echo ""
  56. $(glew):
  57. $(WGET) https://downloads.sourceforge.net/project/glew/glew/2.1.0/glew-2.1.0.tgz
  58. $(UNTAR) glew-2.1.0.tgz
  59. $(MAKE) -C glew-2.1.0 glew.lib
  60. # On Linux, default lib path is lib64, so change it back to lib.
  61. $(MAKE) -C glew-2.1.0 GLEW_DEST="$(LOCAL)" LIBDIR="$(LOCAL)/lib" install
  62. $(glfw):
  63. $(WGET) https://github.com/glfw/glfw/releases/download/3.2.1/glfw-3.2.1.zip
  64. $(UNZIP) glfw-3.2.1.zip
  65. cd glfw-3.2.1 && $(CMAKE) . \
  66. -DCMAKE_INSTALL_PREFIX="$(LOCAL)" -DBUILD_SHARED_LIBS=ON \
  67. -DGLFW_USE_CHDIR=OFF -DGLFW_USE_MENUBAR=ON -DGLFW_USE_RETINA=ON
  68. $(MAKE) -C glfw-3.2.1
  69. $(MAKE) -C glfw-3.2.1 install
  70. ifeq ($(ARCH),win)
  71. # Not sure why the GLFW build system puts a .dll in the lib directory
  72. mv "$(LOCAL)/lib/glfw3.dll" "$(LOCAL)/bin/"
  73. endif
  74. $(jansson):
  75. $(WGET) http://www.digip.org/jansson/releases/jansson-2.10.tar.gz
  76. $(UNTAR) jansson-2.10.tar.gz
  77. cd jansson-2.10 && ./configure --prefix="$(LOCAL)"
  78. $(MAKE) -C jansson-2.10
  79. $(MAKE) -C jansson-2.10 install
  80. $(libsamplerate):
  81. $(WGET) http://www.mega-nerd.com/SRC/libsamplerate-0.1.9.tar.gz
  82. $(UNTAR) libsamplerate-0.1.9.tar.gz
  83. cd libsamplerate-0.1.9 && ./configure --prefix="$(LOCAL)" --disable-fftw --disable-sndfile
  84. $(MAKE) -C libsamplerate-0.1.9/src
  85. $(MAKE) -C libsamplerate-0.1.9/src install
  86. $(libcurl):
  87. $(WGET) https://github.com/curl/curl/files/1101227/curl-7.54.1.tar.gz
  88. $(UNTAR) curl-7.54.1.tar.gz
  89. cd curl-7.54.1 && ./configure --prefix="$(LOCAL)" \
  90. --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 \
  91. --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
  92. $(MAKE) -C curl-7.54.1
  93. $(MAKE) -C curl-7.54.1 install
  94. $(libzip):
  95. $(WGET) https://nih.at/libzip/libzip-1.2.0.tar.gz
  96. $(UNTAR) libzip-1.2.0.tar.gz
  97. cd libzip-1.2.0 && ./configure --prefix="$(LOCAL)"
  98. $(MAKE) -C libzip-1.2.0
  99. $(MAKE) -C libzip-1.2.0 install
  100. $(portmidi):
  101. git clone https://github.com/AndrewBelt/portmidi.git portmidi
  102. cd portmidi && $(CMAKE) . -DCMAKE_INSTALL_PREFIX="$(LOCAL)" -DCMAKE_BUILD_TYPE=Release
  103. $(MAKE) -C portmidi
  104. $(MAKE) -C portmidi install
  105. $(portaudio):
  106. ifeq ($(ARCH),win)
  107. $(WGET) https://github.com/adfernandes/precompiled-portaudio-windows/raw/master/portaudio-r1891-build.zip
  108. $(UNZIP) portaudio-r1891-build.zip
  109. mv portaudio-r1891-build portaudio
  110. cp portaudio/lib/x64/ReleaseMinDependency/portaudio_x64.lib "$(LOCAL)/lib"
  111. cp portaudio/lib/x64/ReleaseMinDependency/portaudio_x64.dll "$(LOCAL)/bin"
  112. cp portaudio/include/*.h "$(LOCAL)/include"
  113. else
  114. $(WGET) http://www.portaudio.com/archives/pa_stable_v190600_20161030.tgz
  115. $(UNTAR) pa_stable_v190600_20161030.tgz
  116. cd portaudio && ./configure --prefix="$(LOCAL)" $(PORTAUDIO_ASIO)
  117. $(MAKE) -C portaudio
  118. $(MAKE) -C portaudio install
  119. endif
  120. clean:
  121. git clean -ffdxi