]>
Commit | Line | Data |
---|---|---|
3e170ce0 | 1 | include Makefile.common |
39236c6e | 2 | |
3e170ce0 A |
3 | ifndef SRCROOT |
4 | export SRCROOT := $(shell /bin/pwd) | |
5 | endif | |
6 | ifndef OBJROOT | |
7 | export OBJROOT = $(SRCROOT)/BUILD/obj | |
8 | endif | |
9 | ifndef DSTROOT | |
10 | export DSTROOT = $(SRCROOT)/BUILD/dst | |
11 | endif | |
12 | ifndef SYMROOT | |
13 | export SYMROOT = $(SRCROOT)/BUILD/sym | |
fe8ab488 | 14 | endif |
fe8ab488 | 15 | |
3e170ce0 A |
16 | ifdef RC_ProjectName |
17 | DSTSUBPATH = $(DSTROOT)/AppleInternal/CoreOS/tests/xnu | |
18 | BATS_CONFIG_PATH = $(DSTROOT)/AppleInternal/CoreOS | |
39236c6e | 19 | else |
3e170ce0 A |
20 | DSTSUBPATH = $(DSTROOT) |
21 | BATS_CONFIG_PATH = $(DSTROOT) | |
39236c6e A |
22 | endif |
23 | ||
f427ee49 A |
24 | DSTSUBPATH_KEXTS = $(DSTROOT)/System/AppleInternal/Library/AuxiliaryExtensions |
25 | ||
3e170ce0 | 26 | COMMON_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 | |
38 | KEXT_TARGETS = pgokext.kext | |
39236c6e | 39 | |
39037602 | 40 | IPHONE_TARGETS = |
39236c6e | 41 | |
39037602 | 42 | MAC_TARGETS = |
3e170ce0 A |
43 | |
44 | BATS_TARGET = $(BATS_CONFIG_PATH)/BATS | |
45 | ||
39236c6e | 46 | ifeq "$(Embedded)" "YES" |
f427ee49 | 47 | TARGETS = $(addprefix $(DSTSUBPATH)/, $(COMMON_TARGETS) $(IPHONE_TARGETS)) $(addprefix $(DSTSUBPATH_KEXTS)/, $(KEXT_TARGETS)) |
39236c6e | 48 | else |
f427ee49 | 49 | TARGETS = $(addprefix $(DSTSUBPATH)/, $(COMMON_TARGETS) $(MAC_TARGETS)) $(addprefix $(DSTSUBPATH_KEXTS)/, $(KEXT_TARGETS)) |
39236c6e A |
50 | endif |
51 | ||
3e170ce0 | 52 | all: $(BATS_TARGET) $(TARGETS) |
39236c6e | 53 | |
39037602 A |
54 | .PHONY: always |
55 | ||
56 | always: | |
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) |