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.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. ifeq ($(ARCH), mac)
  8. DEP_MAC_SDK_FLAGS := -mmacosx-version-min=10.7
  9. DEP_FLAGS += $(DEP_MAC_SDK_FLAGS) -stdlib=libc++
  10. DEP_LDFLAGS += $(DEP_MAC_SDK_FLAGS) -stdlib=libc++
  11. endif
  12. DEP_CFLAGS += $(DEP_FLAGS)
  13. DEP_CXXFLAGS += $(DEP_FLAGS)
  14. # Commands
  15. WGET := wget -c
  16. UNTAR := tar xf
  17. UNZIP := unzip -o
  18. CONFIGURE := ./configure --prefix="$(DEP_PATH)" --host=$(MACHINE)
  19. ifdef ARCH_WIN
  20. CMAKE := cmake -G 'MSYS Makefiles' -DCMAKE_INSTALL_PREFIX="$(DEP_PATH)"
  21. else
  22. CMAKE := cmake -DCMAKE_INSTALL_PREFIX="$(DEP_PATH)"
  23. endif
  24. # Some platforms try to install to lib64
  25. CMAKE += -DCMAKE_INSTALL_LIBDIR=lib
  26. ifdef ARCH_MAC
  27. SHA256SUM := shasum -a 256
  28. else
  29. SHA256SUM := sha256sum
  30. endif
  31. SHA256 := sha256check() { echo "$$2 $$1" | $(SHA256SUM) -c; }; sha256check
  32. SED := perl -pi -e
  33. # Export environment for all dependency targets
  34. $(DEPS): export CFLAGS = $(DEP_CFLAGS)
  35. $(DEPS): export CXXFLAGS = $(DEP_CXXFLAGS)
  36. $(DEPS): export LDFLAGS = $(DEP_LDFLAGS)
  37. dep: $(DEPS)
  38. cleandep:
  39. ifeq ($(DEP_LOCAL), .)
  40. $(error Refusing to clean cwd)
  41. endif
  42. rm -rfv $(DEP_LOCAL)
  43. .PHONY: dep