2 # Common definitions for test directories
5 XCRUN := /usr/bin/xcrun
6 SDKROOT ?= macosx.internal
8 # SDKROOT may be passed as a shorthand like "iphoneos.internal". We
9 # must resolve these to a full path and override SDKROOT.
11 SDKROOT_RESOLVED := $(shell xcrun -sdk $(SDKROOT) -show-sdk-path)
12 ifeq ($(strip $(SDKROOT)_$(SDKROOT_RESOLVED)),/_)
15 override SDKROOT = $(SDKROOT_RESOLVED)
17 SDKVERSION := $(shell $(XCRUN) -sdk $(SDKROOT) -show-sdk-version)
19 PLATFORMPATH := $(shell xcrun -sdk $(SDKROOT) -show-sdk-platform-path)
20 PLATFORM := $(shell echo $(PLATFORMPATH) | sed 's,^.*/\([^/]*\)\.platform$$,\1,')
22 ifeq ($(PLATFORM),watchOS)
26 SUPPORTED_EMBEDDED_PLATFORMS := iPhoneOS iPhoneOSNano tvOS AppleTVOS WatchOS
27 Embedded = $(if $(filter $(SUPPORTED_EMBEDDED_PLATFORMS),$(PLATFORM)),YES,NO)
30 # Deployment target flag
32 ifeq ($(PLATFORM),MacOSX)
33 DEPLOYMENT_TARGET_FLAGS = -mmacosx-version-min=$(SDKVERSION)
34 else ifeq ($(PLATFORM),WatchOS)
35 DEPLOYMENT_TARGET_FLAGS = -mwatchos-version-min=$(SDKVERSION)
36 else ifeq ($(PLATFORM),tvOS)
37 DEPLOYMENT_TARGET_FLAGS = -mtvos-version-min=$(SDKVERSION)
38 else ifeq ($(PLATFORM),AppleTVOS)
39 DEPLOYMENT_TARGET_FLAGS = -mtvos-version-min=$(SDKVERSION)
40 else ifneq ($(filter $(SUPPORTED_EMBEDDED_PLATFORMS),$(PLATFORM)),)
41 DEPLOYMENT_TARGET_FLAGS = -miphoneos-version-min=$(SDKVERSION)
42 else ifneq ($(filter $(SUPPORTED_SIMULATOR_PLATFORMS),$(PLATFORM)),)
43 DEPLOYMENT_TARGET_FLAGS =
45 DEPLOYMENT_TARGET_FLAGS =
48 DEPLOYMENT_TARGET_DEFINES = -DPLATFORM_$(PLATFORM)
52 else ifeq ($(VERBOSE),YES)