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.

dep.mk 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. ifeq ($(ARCH), mac)
  11. DEP_MAC_SDK_FLAGS := -mmacosx-version-min=10.7
  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. else
  32. SHA256SUM := sha256sum
  33. endif
  34. SHA256 := sha256check() { echo "$$2 $$1" | $(SHA256SUM) -c; }; sha256check
  35. SED := perl -pi -e
  36. # Export environment for all dependency targets
  37. $(DEPS): export CFLAGS = $(DEP_CFLAGS)
  38. $(DEPS): export CXXFLAGS = $(DEP_CXXFLAGS)
  39. $(DEPS): export LDFLAGS = $(DEP_LDFLAGS)
  40. dep: $(DEPS)
  41. cleandep:
  42. ifeq ($(DEP_LOCAL), .)
  43. $(error Refusing to clean cwd)
  44. endif
  45. rm -rfv $(DEP_LOCAL)
  46. .PHONY: dep