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.

114 lines
3.3KB

  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. $(glew):
  32. $(WGET) https://downloads.sourceforge.net/project/glew/glew/$(patsubst glew-%,%,$@)/$@.tgz
  33. $(UNTAR) $@.tgz
  34. $(MAKE) -C $@ glew.lib
  35. # On Linux, default lib path is lib64, so change it back to lib.
  36. $(MAKE) -C $@ GLEW_DEST="$(LOCAL)" LIBDIR="$(LOCAL)/lib" install
  37. $(glfw):
  38. $(WGET) https://github.com/glfw/glfw/releases/download/$(patsubst glfw-%,%,$@)/$@.zip
  39. $(UNZIP) $@.zip
  40. cd $@ && $(CMAKE) . \
  41. -DCMAKE_INSTALL_PREFIX="$(LOCAL)" -DBUILD_SHARED_LIBS=ON \
  42. -DGLFW_USE_CHDIR=OFF -DGLFW_USE_MENUBAR=ON -DGLFW_USE_RETINA=ON
  43. $(MAKE) -C $@
  44. $(MAKE) -C $@ install
  45. ifeq ($(ARCH),win)
  46. # Not sure why the GLFW build system puts a .dll in the lib directory
  47. mv "$(LOCAL)/lib/glfw3.dll" "$(LOCAL)/bin/"
  48. endif
  49. $(jansson):
  50. $(WGET) http://www.digip.org/jansson/releases/$@.tar.gz
  51. $(UNTAR) $@.tar.gz
  52. cd $@ && ./configure --prefix="$(LOCAL)"
  53. $(MAKE) -C $@
  54. $(MAKE) -C $@ install
  55. $(libsamplerate):
  56. $(WGET) http://www.mega-nerd.com/SRC/$@.tar.gz
  57. $(UNTAR) $@.tar.gz
  58. cd $@ && ./configure --prefix="$(LOCAL)"
  59. $(MAKE) -C $@
  60. $(MAKE) -C $@ install
  61. $(libcurl):
  62. $(WGET) https://curl.haxx.se/download/$@.tar.gz
  63. $(UNTAR) $@.tar.gz
  64. cd $@ && ./configure --prefix="$(LOCAL)" \
  65. --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 \
  66. --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
  67. $(MAKE) -C $@
  68. $(MAKE) -C $@ install
  69. $(libzip):
  70. $(WGET) https://nih.at/libzip/$@.tar.gz
  71. $(UNTAR) $@.tar.gz
  72. cd $@ && ./configure --prefix="$(LOCAL)"
  73. $(MAKE) -C $@
  74. $(MAKE) -C $@ install
  75. $(portmidi):
  76. git clone https://github.com/AndrewBelt/portmidi.git $@
  77. cd $@ && $(CMAKE) . -DCMAKE_INSTALL_PREFIX="$(LOCAL)" -DCMAKE_BUILD_TYPE=Release
  78. $(MAKE) -C $@
  79. $(MAKE) -C $@ install
  80. $(portaudio):
  81. ifeq ($(ARCH),win)
  82. $(WGET) https://github.com/adfernandes/precompiled-portaudio-windows/raw/master/portaudio-r1891-build.zip
  83. $(UNZIP) portaudio-r1891-build.zip
  84. mv portaudio-r1891-build $@
  85. cp portaudio/lib/x64/ReleaseMinDependency/portaudio_x64.lib "$(LOCAL)/lib"
  86. cp portaudio/lib/x64/ReleaseMinDependency/portaudio_x64.dll "$(LOCAL)/bin"
  87. cp portaudio/include/*.h "$(LOCAL)/include"
  88. else
  89. $(WGET) http://www.portaudio.com/archives/pa_stable_v190600_20161030.tgz
  90. $(UNTAR) pa_stable_v190600_20161030.tgz
  91. cd $@ && ./configure --prefix="$(LOCAL)" $(PORTAUDIO_ASIO)
  92. $(MAKE) -C $@
  93. $(MAKE) -C $@ install
  94. endif
  95. clean:
  96. git clean -fdxi