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.

119 lines
3.5KB

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