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.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. include $(RACK_DIR)/arch.mk
  2. # The install location for `make install`
  3. DEP_LOCAL ?= dep
  4. $(shell mkdir -p $(DEP_LOCAL))
  5. DEP_PATH := $(abspath $(DEP_LOCAL))
  6. DEP_FLAGS += -g -O3
  7. # This is needed for Rack for DAWs.
  8. # Static libs don't usually compiled with -fPIC, but since we're including them in a shared library, it's needed.
  9. DEP_FLAGS += -fPIC
  10. # Define compiler/linker target if cross-compiling
  11. ifdef CROSS_COMPILE
  12. DEP_FLAGS += --target=$(MACHINE)
  13. endif
  14. ifdef ARCH_X64
  15. DEP_FLAGS += -march=nehalem
  16. endif
  17. ifdef ARCH_ARM64
  18. DEP_FLAGS += -march=armv8-a+fp+simd
  19. endif
  20. ifdef ARCH_MAC
  21. DEP_MAC_SDK_FLAGS := -mmacosx-version-min=10.9
  22. DEP_FLAGS += $(DEP_MAC_SDK_FLAGS)
  23. DEP_CXXFLAGS += -stdlib=libc++
  24. DEP_LDFLAGS += -stdlib=libc++
  25. endif
  26. DEP_CFLAGS += $(DEP_FLAGS)
  27. DEP_CXXFLAGS += $(DEP_FLAGS)
  28. DEP_LDFLAGS += $(DEP_FLAGS)
  29. # Commands
  30. WGET := wget -c
  31. UNTAR := tar xf
  32. UNZIP := unzip -o
  33. CONFIGURE := ./configure --prefix="$(DEP_PATH)"
  34. CMAKE := cmake
  35. ifdef ARCH_WIN
  36. CMAKE += -DCMAKE_SYSTEM_NAME=Windows
  37. endif
  38. # We must specify the MSYS generator if in an MSYS shell
  39. ifdef MSYSTEM
  40. CMAKE += -G "MSYS Makefiles"
  41. endif
  42. ifdef ARCH_MAC
  43. CMAKE += -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9
  44. endif
  45. ifdef ARCH_LIN
  46. CMAKE += -DCMAKE_SYSTEM_NAME=Linux
  47. endif
  48. CMAKE += -DCMAKE_INSTALL_PREFIX="$(DEP_PATH)"
  49. # Some platforms try to install to lib64
  50. CMAKE += -DCMAKE_INSTALL_LIBDIR=lib
  51. ifdef ARCH_MAC
  52. SHA256SUM := shasum -a 256
  53. SED := sed -i ''
  54. else
  55. SHA256SUM := sha256sum
  56. SED := sed -i
  57. endif
  58. SHA256 := sha256check() { echo "$$2 $$1" | $(SHA256SUM) -c; }; sha256check
  59. # Export environment for all dependency targets
  60. $(DEPS): export CFLAGS = $(DEP_CFLAGS)
  61. $(DEPS): export CXXFLAGS = $(DEP_CXXFLAGS)
  62. $(DEPS): export LDFLAGS = $(DEP_LDFLAGS)
  63. dep: $(DEPS)
  64. cleandep:
  65. ifeq ($(DEP_LOCAL), .)
  66. $(error Refusing to clean cwd)
  67. endif
  68. rm -rfv $(DEP_LOCAL)
  69. .PHONY: dep