]> git.saurik.com Git - apple/xnu.git/blame - tools/tests/MPMMTest/Makefile
xnu-4903.221.2.tar.gz
[apple/xnu.git] / tools / tests / MPMMTest / Makefile
CommitLineData
3e170ce0 1include ../Makefile.common
b0d623f7 2
fe8ab488 3CC:=$(shell xcrun -sdk "$(SDKROOT)" -find cc)
b0d623f7 4
39236c6e 5SYMROOT?=$(shell /bin/pwd)
b0d623f7 6
3e170ce0
A
7CFLAGS := -g -O2 -isysroot $(SDKROOT) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
8CFLAGS += -Wno-deprecated-declarations
b0d623f7 9
39236c6e
A
10ifdef RC_ARCHS
11 ARCHS:=$(RC_ARCHS)
12 else
13 ifeq "$(Embedded)" "YES"
fe8ab488 14 ARCHS:=armv7 armv7s arm64
39236c6e
A
15 else
16 ARCHS:=x86_64 i386
17 endif
18endif
b0d623f7 19
d9a64523
A
20# These are convenience functions for filtering based on substrings, as the
21# normal filter functions only accept one wildcard.
22FILTER_OUT_SUBSTRING=$(strip $(foreach string,$(2),$(if $(findstring $(1),$(string)),,$(string))))
23FILTER_SUBSTRING=$(strip $(foreach string,$(2),$(if $(findstring $(1),$(string)),$(string),)))
24
25ARCH_32:=$(call FILTER_OUT_SUBSTRING,64,$(ARCHS))
26ARCH_64:=$(call FILTER_SUBSTRING,64,$(ARCHS))
27
39236c6e 28ARCH_32_FLAGS := $(patsubst %, -arch %, $(ARCH_32))
39236c6e 29ARCH_64_FLAGS := $(patsubst %, -arch %, $(ARCH_64))
b0d623f7 30
39236c6e 31DSTROOT?=$(shell /bin/pwd)
b0d623f7 32
39236c6e
A
33ARCH_32_TARGETS := MPMMtest KQMPMMtest KQMPMMtestD
34ARCH_64_TARGETS := MPMMtest_64 KQMPMMtest_64 KQMPMMtest_64D
490019cf 35TARGETS := MPMMtest_perf.sh $(if $(ARCH_64), $(ARCH_64_TARGETS)) $(if $(ARCH_32), $(ARCH_32_TARGETS))
b0d623f7 36
39236c6e
A
37all: $(addprefix $(DSTROOT)/, $(TARGETS))
38
39$(DSTROOT)/MPMMtest: MPMMtest.c
40 ${CC} ${CFLAGS} ${ARCH_32_FLAGS} -o $(SYMROOT)/$(notdir $@) $?
41 if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi
42
43$(DSTROOT)/MPMMtest_64: MPMMtest.c
44 ${CC} ${CFLAGS} ${ARCH_64_FLAGS} -o $(SYMROOT)/$(notdir $@) $?
45 if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi
46
47$(DSTROOT)/KQMPMMtest: KQMPMMtest.c
48 ${CC} ${CFLAGS} ${ARCH_32_FLAGS} -o $(SYMROOT)/$(notdir $@) $?
49 if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi
50
51$(DSTROOT)/KQMPMMtest_64: KQMPMMtest.c
52 ${CC} ${CFLAGS} ${ARCH_64_FLAGS} -o $(SYMROOT)/$(notdir $@) $?
53 if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi
54
55$(DSTROOT)/KQMPMMtestD: KQMPMMtest.c
56 ${CC} ${CFLAGS} ${ARCH_32_FLAGS} -DDIRECT_MSG_RCV=1 -o $(SYMROOT)/$(notdir $@) $?
57 if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi
58
59$(DSTROOT)/KQMPMMtest_64D: KQMPMMtest.c
3e170ce0 60 ${CC} ${CFLAGS} ${ARCH_64_FLAGS} -DDIRECT_MSG_RCV=1 -o $(SYMROOT)/$(notdir $@) $?
39236c6e 61 if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi
b0d623f7 62
490019cf
A
63$(DSTROOT)/MPMMtest_perf.sh: MPMMtest_run.sh
64 cp $? $@
65 chmod +x $@
66
b0d623f7 67clean:
39236c6e 68 rm -rf $(addprefix $(DSTROOT)/,$(TARGETS)) $(addprefix $(SYMROOT)/,$(TARGETS)) $(SYMROOT)/*.dSYM