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.

62 lines
1.5KB

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