]> git.saurik.com Git - apple/xnu.git/blame - tools/tests/Makefile
xnu-7195.50.7.100.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 \
f427ee49
A
36
37KEXT_TARGETS = pgokext.kext
39236c6e 38
39037602 39IPHONE_TARGETS =
39236c6e 40
39037602 41MAC_TARGETS =
3e170ce0
A
42
43BATS_TARGET = $(BATS_CONFIG_PATH)/BATS
44
39236c6e 45ifeq "$(Embedded)" "YES"
f427ee49 46TARGETS = $(addprefix $(DSTSUBPATH)/, $(COMMON_TARGETS) $(IPHONE_TARGETS)) $(addprefix $(DSTSUBPATH_KEXTS)/, $(KEXT_TARGETS))
39236c6e 47else
f427ee49 48TARGETS = $(addprefix $(DSTSUBPATH)/, $(COMMON_TARGETS) $(MAC_TARGETS)) $(addprefix $(DSTSUBPATH_KEXTS)/, $(KEXT_TARGETS))
39236c6e
A
49endif
50
3e170ce0 51all: $(BATS_TARGET) $(TARGETS)
39236c6e 52
39037602
A
53.PHONY: always
54
55always:
56
813fb2f6
A
57# NOTE: RC_ARCHES nonsense is here because code signing will fail on kexts if we include a i386 slice
58# <rdar://problem/29878263> CoreOSLobo: xnu_tests-4026 fails to codesign
59
f427ee49
A
60$(DSTSUBPATH_KEXTS)/pgokext.kext: always
61 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 62
39037602
A
63$(DSTSUBPATH)/%: always
64 $(_v)echo Building $@
65 $(_v)mkdir -p $@
66 $(_v)mkdir -p $(OBJROOT)/$(notdir $@)
67 $(_v)mkdir -p $(SYMROOT)/$(notdir $@)
68 $(_v)$(MAKE) -C $(SRCROOT)/$(notdir $@) SRCROOT=$(SRCROOT)/$(notdir $@) DSTROOT=$@ OBJROOT=$(OBJROOT)/$(notdir $@) SYMROOT=$(SYMROOT)/$(notdir $@) SDKROOT=$(SDKROOT) BASEDSTROOT=$(DSTROOT)
5ba3f43e 69 $(_v)find $@ -type d -name "*.dSYM" -exec cp -a {} $(SYMROOT)/ ';'
39037602
A
70
71$(BATS_TARGET): $(TARGETS)
72 $(_v)mkdir -p $@
73 $(_v)mkdir -p $(OBJROOT)/$(notdir $@)
74 $(_v)mkdir -p $(SYMROOT)
5ba3f43e 75 $(_v)$(MAKE) -C $(SRCROOT)/$(notdir $@) SRCROOT=$(SRCROOT)/$(notdir $@) DSTROOT=$@ OBJROOT=$(OBJROOT)/$(notdir $@) SDKROOT=$(SDKROOT) BASEDSTROOT=$(DSTROOT) BASEDSTSUBPATH=$(DSTSUBPATH)