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

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