]> git.saurik.com Git - apple/xnu.git/blob - tools/tests/Makefile
xnu-2782.20.48.tar.gz
[apple/xnu.git] / tools / tests / Makefile
1 ifdef RC_ProjectName
2 DSTSUBPATH = $(DSTROOT)/AppleInternal/CoreOS
3 else
4 DSTSUBPATH = $(DSTROOT)
5 endif
6
7 OBJROOT?=$(shell /bin/pwd)
8
9 SDKROOT ?= macosx.internal
10
11 # SDKROOT may be passed as a shorthand like "iphoneos.internal". We
12 # must resolve these to a full path and override SDKROOT.
13
14 SDKROOT_RESOLVED := $(shell xcrun -sdk $(SDKROOT) -show-sdk-path)
15 ifeq ($(strip $(SDKROOT)_$(SDKROOT_RESOLVED)),/_)
16 SDKROOT_RESOLVED := /
17 endif
18 override SDKROOT = $(SDKROOT_RESOLVED)
19
20
21 ifeq "$(RC_TARGET_CONFIG)" "iPhone"
22 Embedded?=YES
23 else
24 Embedded?=$(shell echo $(SDKROOT) | grep -iq iphoneos && echo YES || echo NO)
25 endif
26
27 COMMON_TARGETS = xnu_quick_test \
28 MPMMTest \
29 affinity \
30 execperf \
31 kqueue_tests \
32 superpages \
33 zero-to-n \
34 jitter \
35 perf_index \
36 unit_tests
37
38 IPHONE_TARGETS = memorystatus
39
40 MAC_TARGETS =
41
42 ifeq "$(Embedded)" "YES"
43 TARGETS = $(addprefix $(DSTSUBPATH)/, $(COMMON_TARGETS) $(IPHONE_TARGETS))
44 else
45 TARGETS = $(addprefix $(DSTSUBPATH)/, $(COMMON_TARGETS) $(MAC_TARGETS))
46 endif
47
48 all: $(TARGETS)
49
50 $(DSTSUBPATH)/%:
51 mkdir -p $@
52 mkdir -p $(OBJROOT)/$(notdir $@)
53 $(MAKE) -C $(SRCROOT)/$(notdir $@) SRCROOT=$(SRCROOT)/$(notdir $@) DSTROOT=$@ OBJROOT=$(OBJROOT)/$(notdir $@) SDKROOT=$(SDKROOT)