]> git.saurik.com Git - apple/xnu.git/blame - tools/tests/Makefile
xnu-3789.1.32.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
3e170ce0 24COMMON_TARGETS = unit_tests \
39236c6e 25 MPMMTest \
39037602 26 packetdrill \
39236c6e 27 affinity \
fe8ab488 28 execperf \
39236c6e
A
29 kqueue_tests \
30 superpages \
31 zero-to-n \
32 jitter \
39037602
A
33 perf_index \
34 darwintests \
35 unixconf
39236c6e 36
39037602 37IPHONE_TARGETS =
39236c6e 38
39037602 39MAC_TARGETS =
3e170ce0
A
40
41BATS_TARGET = $(BATS_CONFIG_PATH)/BATS
42
39236c6e 43ifeq "$(Embedded)" "YES"
39037602 44TARGETS = $(addprefix $(DSTSUBPATH)/, $(COMMON_TARGETS) $(IPHONE_TARGETS))
39236c6e 45else
39037602 46TARGETS = $(addprefix $(DSTSUBPATH)/, $(COMMON_TARGETS) $(MAC_TARGETS))
39236c6e
A
47endif
48
3e170ce0 49all: $(BATS_TARGET) $(TARGETS)
39236c6e 50
39037602
A
51.PHONY: always
52
53always:
54
55$(DSTSUBPATH)/%: always
56 $(_v)echo Building $@
57 $(_v)mkdir -p $@
58 $(_v)mkdir -p $(OBJROOT)/$(notdir $@)
59 $(_v)mkdir -p $(SYMROOT)/$(notdir $@)
60 $(_v)$(MAKE) -C $(SRCROOT)/$(notdir $@) SRCROOT=$(SRCROOT)/$(notdir $@) DSTROOT=$@ OBJROOT=$(OBJROOT)/$(notdir $@) SYMROOT=$(SYMROOT)/$(notdir $@) SDKROOT=$(SDKROOT) BASEDSTROOT=$(DSTROOT)
61
62$(BATS_TARGET): $(TARGETS)
63 $(_v)mkdir -p $@
64 $(_v)mkdir -p $(OBJROOT)/$(notdir $@)
65 $(_v)mkdir -p $(SYMROOT)
66 $(_v)$(MAKE) -C $(SRCROOT)/$(notdir $@) SRCROOT=$(SRCROOT)/$(notdir $@) DSTROOT=$@ OBJROOT=$(OBJROOT)/$(notdir $@) SDKROOT=$(SDKROOT) BASEDSTROOT=$(DSTROOT)