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.

77 lines
1.7KB

  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. ifdef ARCH_X64
  11. DEP_FLAGS += -march=nehalem
  12. endif
  13. ifdef ARCH_ARM64
  14. DEP_FLAGS += -march=armv8-a+fp+simd
  15. endif
  16. ifdef ARCH_MAC
  17. DEP_MAC_SDK_FLAGS := -mmacosx-version-min=10.9
  18. DEP_FLAGS += $(DEP_MAC_SDK_FLAGS) -stdlib=libc++
  19. DEP_LDFLAGS += $(DEP_MAC_SDK_FLAGS) -stdlib=libc++
  20. endif
  21. DEP_CFLAGS += $(DEP_FLAGS)
  22. DEP_CXXFLAGS += $(DEP_FLAGS)
  23. # Commands
  24. WGET := wget -c
  25. UNTAR := tar xf
  26. UNZIP := unzip -o
  27. CONFIGURE := ./configure --prefix="$(DEP_PATH)"
  28. CMAKE := cmake
  29. ifdef ARCH_WIN
  30. CMAKE += -DCMAKE_SYSTEM_NAME=Windows
  31. endif
  32. # We must specify the MSYS generator if in an MSYS shell
  33. ifdef MSYSTEM
  34. CMAKE += -G "MSYS Makefiles"
  35. endif
  36. ifdef ARCH_MAC
  37. CMAKE += -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9
  38. endif
  39. ifdef ARCH_LIN
  40. CMAKE += -DCMAKE_SYSTEM_NAME=Linux
  41. endif
  42. CMAKE += -DCMAKE_INSTALL_PREFIX="$(DEP_PATH)"
  43. # Some platforms try to install to lib64
  44. CMAKE += -DCMAKE_INSTALL_LIBDIR=lib
  45. ifdef ARCH_MAC
  46. SHA256SUM := shasum -a 256
  47. SED := sed -i ''
  48. else
  49. SHA256SUM := sha256sum
  50. SED := sed -i
  51. endif
  52. SHA256 := sha256check() { echo "$$2 $$1" | $(SHA256SUM) -c; }; sha256check
  53. # Export environment for all dependency targets
  54. $(DEPS): export CFLAGS = $(DEP_CFLAGS)
  55. $(DEPS): export CXXFLAGS = $(DEP_CXXFLAGS)
  56. $(DEPS): export LDFLAGS = $(DEP_LDFLAGS)
  57. dep: $(DEPS)
  58. cleandep:
  59. ifeq ($(DEP_LOCAL), .)
  60. $(error Refusing to clean cwd)
  61. endif
  62. rm -rfv $(DEP_LOCAL)
  63. .PHONY: dep