]> git.saurik.com Git - apple/xnu.git/blame - tools/tests/Makefile
xnu-7195.101.1.tar.gz
[apple/xnu.git] / tools / tests / Makefile
CommitLineData
3e170ce0 1include Makefile.common
39236c6e 2
3e170ce0
A
3ifndef SRCROOT
4export SRCROOT := $(shell /bin/pwd)
5endif
6ifndef OBJROOT
7export OBJROOT = $(SRCROOT)/BUILD/obj
8endif
9ifndef DSTROOT
10export DSTROOT = $(SRCROOT)/BUILD/dst
11endif
12ifndef SYMROOT
13export SYMROOT = $(SRCROOT)/BUILD/sym
fe8ab488 14endif
fe8ab488 15
3e170ce0
A
16ifdef RC_ProjectName
17DSTSUBPATH = $(DSTROOT)/AppleInternal/CoreOS/tests/xnu
18BATS_CONFIG_PATH = $(DSTROOT)/AppleInternal/CoreOS
39236c6e 19else
3e170ce0
A
20DSTSUBPATH = $(DSTROOT)
21BATS_CONFIG_PATH = $(DSTROOT)
39236c6e
A
22endif
23
f427ee49
A
24DSTSUBPATH_KEXTS = $(DSTROOT)/System/AppleInternal/Library/AuxiliaryExtensions
25
3e170ce0 26COMMON_TARGETS = unit_tests \
39236c6e 27 MPMMTest \
39037602 28 packetdrill \
39236c6e 29 affinity \
39236c6e
A
30 superpages \
31 zero-to-n \
32 jitter \
39037602 33 perf_index \
d9a64523 34 personas \
813fb2f6 35 unixconf \
c3c9b80d 36 kernpost_test_report \
f427ee49
A
37
38KEXT_TARGETS = pgokext.kext
39236c6e 39
39037602 40IPHONE_TARGETS =
39236c6e 41
39037602 42MAC_TARGETS =
3e170ce0
A
43
44BATS_TARGET = $(BATS_CONFIG_PATH)/BATS
45
39236c6e 46ifeq "$(Embedded)" "YES"
f427ee49 47TARGETS = $(addprefix $(DSTSUBPATH)/, $(COMMON_TARGETS) $(IPHONE_TARGETS)) $(addprefix $(DSTSUBPATH_KEXTS)/, $(KEXT_TARGETS))
39236c6e 48else
f427ee49 49TARGETS = $(addprefix $(DSTSUBPATH)/, $(COMMON_TARGETS) $(MAC_TARGETS)) $(addprefix $(DSTSUBPATH_KEXTS)/, $(KEXT_TARGETS))
39236c6e
A
50endif
51
3e170ce0 52all: $(BATS_TARGET) $(TARGETS)
39236c6e 53
39037602
A
54.PHONY: always
55
56always:
57
813fb2f6
A
58# NOTE: RC_ARCHES nonsense is here because code signing will fail on kexts if we include a i386 slice
59# <rdar://problem/29878263> CoreOSLobo: xnu_tests-4026 fails to codesign
60
f427ee49
A
61$(DSTSUBPATH_KEXTS)/pgokext.kext: always
62 xcodebuild -configuration Debug -project $(SRCROOT)/testkext/testkext.xcodeproj -target pgokext DSTROOT=$(DSTSUBPATH_KEXTS) SYMROOT=$(SYMROOT)/testkext SRCROOT=$(SRCROOT)/testkext OBJROOT=$(OBJROOT)/testkext SDKROOT=$(SDKROOT) RC_ARCHS="$(subst i386,,$(RC_ARCHS))" install
813fb2f6 63
39037602
A
64$(DSTSUBPATH)/%: always
65 $(_v)echo Building $@
66 $(_v)mkdir -p $@
67 $(_v)mkdir -p $(OBJROOT)/$(notdir $@)
68 $(_v)mkdir -p $(SYMROOT)/$(notdir $@)
69 $(_v)$(MAKE) -C $(SRCROOT)/$(notdir $@) SRCROOT=$(SRCROOT)/$(notdir $@) DSTROOT=$@ OBJROOT=$(OBJROOT)/$(notdir $@) SYMROOT=$(SYMROOT)/$(notdir $@) SDKROOT=$(SDKROOT) BASEDSTROOT=$(DSTROOT)
5ba3f43e 70 $(_v)find $@ -type d -name "*.dSYM" -exec cp -a {} $(SYMROOT)/ ';'
39037602
A
71
72$(BATS_TARGET): $(TARGETS)
73 $(_v)mkdir -p $@
74 $(_v)mkdir -p $(OBJROOT)/$(notdir $@)
75 $(_v)mkdir -p $(SYMROOT)
5ba3f43e 76 $(_v)$(MAKE) -C $(SRCROOT)/$(notdir $@) SRCROOT=$(SRCROOT)/$(notdir $@) DSTROOT=$@ OBJROOT=$(OBJROOT)/$(notdir $@) SDKROOT=$(SDKROOT) BASEDSTROOT=$(DSTROOT) BASEDSTSUBPATH=$(DSTSUBPATH)