]> git.saurik.com Git - apple/xnu.git/blame - tools/tests/Makefile.common
xnu-3248.40.184.tar.gz
[apple/xnu.git] / tools / tests / Makefile.common
CommitLineData
3e170ce0
A
1#
2# Common definitions for test directories
3#
4
5XCRUN := /usr/bin/xcrun
6SDKROOT ?= macosx.internal
7
8# SDKROOT may be passed as a shorthand like "iphoneos.internal". We
9# must resolve these to a full path and override SDKROOT.
10
11SDKROOT_RESOLVED := $(shell xcrun -sdk $(SDKROOT) -show-sdk-path)
12ifeq ($(strip $(SDKROOT)_$(SDKROOT_RESOLVED)),/_)
13SDKROOT_RESOLVED := /
14endif
15override SDKROOT = $(SDKROOT_RESOLVED)
16
17SDKVERSION := $(shell $(XCRUN) -sdk $(SDKROOT) -show-sdk-version)
18
19PLATFORMPATH := $(shell xcrun -sdk $(SDKROOT) -show-sdk-platform-path)
20PLATFORM := $(shell echo $(PLATFORMPATH) | sed 's,^.*/\([^/]*\)\.platform$$,\1,')
21
22ifeq ($(PLATFORM),watchOS)
23 PLATFORM := WatchOS
24endif
25
26SUPPORTED_EMBEDDED_PLATFORMS := iPhoneOS iPhoneOSNano tvOS AppleTVOS WatchOS
27Embedded = $(if $(filter $(SUPPORTED_EMBEDDED_PLATFORMS),$(PLATFORM)),YES,NO)
28
29#
30# Deployment target flag
31#
32ifeq ($(PLATFORM),MacOSX)
33 DEPLOYMENT_TARGET_FLAGS = -mmacosx-version-min=$(SDKVERSION)
34else ifeq ($(PLATFORM),WatchOS)
35 DEPLOYMENT_TARGET_FLAGS = -mwatchos-version-min=$(SDKVERSION)
36else ifeq ($(PLATFORM),tvOS)
37 DEPLOYMENT_TARGET_FLAGS = -mtvos-version-min=$(SDKVERSION)
38else ifeq ($(PLATFORM),AppleTVOS)
39 DEPLOYMENT_TARGET_FLAGS = -mtvos-version-min=$(SDKVERSION)
40else ifneq ($(filter $(SUPPORTED_EMBEDDED_PLATFORMS),$(PLATFORM)),)
41 DEPLOYMENT_TARGET_FLAGS = -miphoneos-version-min=$(SDKVERSION)
42else ifneq ($(filter $(SUPPORTED_SIMULATOR_PLATFORMS),$(PLATFORM)),)
43 DEPLOYMENT_TARGET_FLAGS =
44else
45 DEPLOYMENT_TARGET_FLAGS =
46endif
47
48DEPLOYMENT_TARGET_DEFINES = -DPLATFORM_$(PLATFORM)
490019cf
A
49
50ifeq ($(RC_XBS),YES)
51_v =
52else ifeq ($(VERBOSE),YES)
53_v =
54else
55_v = @
56endif