]>
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 \ |
f427ee49 A |
36 | |
37 | KEXT_TARGETS = pgokext.kext | |
39236c6e | 38 | |
39037602 | 39 | IPHONE_TARGETS = |
39236c6e | 40 | |
39037602 | 41 | MAC_TARGETS = |
3e170ce0 A |
42 | |
43 | BATS_TARGET = $(BATS_CONFIG_PATH)/BATS | |
44 | ||
39236c6e | 45 | ifeq "$(Embedded)" "YES" |
f427ee49 | 46 | TARGETS = $(addprefix $(DSTSUBPATH)/, $(COMMON_TARGETS) $(IPHONE_TARGETS)) $(addprefix $(DSTSUBPATH_KEXTS)/, $(KEXT_TARGETS)) |
39236c6e | 47 | else |
f427ee49 | 48 | TARGETS = $(addprefix $(DSTSUBPATH)/, $(COMMON_TARGETS) $(MAC_TARGETS)) $(addprefix $(DSTSUBPATH_KEXTS)/, $(KEXT_TARGETS)) |
39236c6e A |
49 | endif |
50 | ||
3e170ce0 | 51 | all: $(BATS_TARGET) $(TARGETS) |
39236c6e | 52 | |
39037602 A |
53 | .PHONY: always |
54 | ||
55 | always: | |
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) |