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

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