diff --git a/Makefile b/Makefile index b5eace445b416d706bf8622c4c5867e7bba07053..447878688186aaa6e20a719e41386c70b45c491a 100644 --- a/Makefile +++ b/Makefile @@ -77,6 +77,12 @@ .PHONY: all incremental checkout clean realclean dist +# Target platform (OSX/macOS only): On Mojave (10.14 with Xcode 10) this needs +# to be at least 10.9, which is the default now. With older Xcode versions you +# can try earlier versions (>= 10.4) if you need to compile for legacy OSX +# versions. +export macos_target = 10.9 + # Installation prefix under which Pd-l2ork is installed (Linux only). If this # isn't set, a default location will be used (usually /usr/local). NOTE: We # *always* assume that this variable is set properly in the install targets diff --git a/packages/darwin_app/Makefile b/packages/darwin_app/Makefile index 631b88f72e84cdeb2ebf284d9e5e45aa96d0e3d4..a18daf17b95ac263559b8c93f131e7957ec66fb6 100644 --- a/packages/darwin_app/Makefile +++ b/packages/darwin_app/Makefile @@ -1,7 +1,14 @@ current: darwin_app +# Target platform: On Mojave (10.14 with Xcode 10) this needs to be at least +# 10.9, which is the default now. With older Xcode versions you can try +# earlier versions (>= 10.4) if you need to compile for legacy OSX versions. +ifeq ($(macos_target),) +macos_target = 10.9 +endif + # turn on weak linking and dlopen support -export MACOSX_DEPLOYMENT_TARGET = 10.4 +export MACOSX_DEPLOYMENT_TARGET = $(macos_target) CWD := $(shell pwd) BUILD_BASE = $(CWD)/build @@ -23,20 +30,15 @@ include $(BUILDLAYOUT_DIR)/Makefile.buildlayout # http://hpc.sourceforge.net/ OPT_CFLAGS = -fast -fPIC -ftree-vectorize -FAT_FLAGS = -mmacosx-version-min=10.4 -CFLAGS = -mmacosx-version-min=10.4 -LDFLAGS = -mmacosx-version-min=10.4 +FAT_FLAGS = -mmacosx-version-min=$(macos_target) +CFLAGS = -mmacosx-version-min=$(macos_target) +LDFLAGS = -mmacosx-version-min=$(macos_target) # which CPU to compile for TARGET_PLATFORM := $(shell uname -p) ifeq ($(TARGET_PLATFORM),i386) - # if on 10.6/Intel, then build as 64-bit with core2 as minimum CPU - ifeq ($(shell uname -r | sed 's|\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*|\1|'), 10) - OPT_CFLAGS += -march=core2 -msse3 -mssse3 -mfpmath=sse - FAT_FLAGS = -mmacosx-version-min=10.6 - else - OPT_CFLAGS += -msse3 -mfpmath=sse - endif + # assume Intel 64-bit with core2 as minimum CPU + OPT_CFLAGS += -march=core2 -msse3 -mssse3 -mfpmath=sse else OPT_CFLAGS += -mcpu=7450 -mtune=7450 endif diff --git a/pd/src/makefile.in b/pd/src/makefile.in index 59e0bc88d06f1c0cc486af582451f269eac96bc9..4f30df23848e853a7d826f49143c4a851d2d615e 100644 --- a/pd/src/makefile.in +++ b/pd/src/makefile.in @@ -2,7 +2,10 @@ # support. Its safe on other platforms since gcc only checks this env var on # Apple's gcc. <hans@at.or.at> ifeq ($(shell uname -s),Darwin) -export MACOSX_DEPLOYMENT_TARGET = 10.4 +ifeq ($(macos_target),) +macos_target = 10.9 +endif +export MACOSX_DEPLOYMENT_TARGET = $(macos_target) endif VPATH = ../obj:./