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.

60 lines
1.4KB

  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=nocona
  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. ifdef ARCH_WIN
  23. CMAKE := cmake -G 'MSYS Makefiles' -DCMAKE_INSTALL_PREFIX="$(DEP_PATH)"
  24. else
  25. CMAKE := cmake -DCMAKE_INSTALL_PREFIX="$(DEP_PATH)"
  26. endif
  27. # Some platforms try to install to lib64
  28. CMAKE += -DCMAKE_INSTALL_LIBDIR=lib
  29. ifdef ARCH_MAC
  30. SHA256SUM := shasum -a 256
  31. SED := sed -i ''
  32. else
  33. SHA256SUM := sha256sum
  34. SED := sed -i
  35. endif
  36. SHA256 := sha256check() { echo "$$2 $$1" | $(SHA256SUM) -c; }; sha256check
  37. # Export environment for all dependency targets
  38. $(DEPS): export CFLAGS = $(DEP_CFLAGS)
  39. $(DEPS): export CXXFLAGS = $(DEP_CXXFLAGS)
  40. $(DEPS): export LDFLAGS = $(DEP_LDFLAGS)
  41. dep: $(DEPS)
  42. cleandep:
  43. ifeq ($(DEP_LOCAL), .)
  44. $(error Refusing to clean cwd)
  45. endif
  46. rm -rfv $(DEP_LOCAL)
  47. .PHONY: dep