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.

83 lines
1.8KB

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