]> git.saurik.com Git - apple/xnu.git/blame - tools/tests/MPMMTest/Makefile
xnu-2782.1.97.tar.gz
[apple/xnu.git] / tools / tests / MPMMTest / Makefile
CommitLineData
39236c6e
A
1SDKROOT ?= /
2ifeq "$(RC_TARGET_CONFIG)" "iPhone"
3Embedded?=YES
4else
5Embedded?=$(shell echo $(SDKROOT) | grep -iq iphoneos && echo YES || echo NO)
6endif
b0d623f7 7
fe8ab488 8CC:=$(shell xcrun -sdk "$(SDKROOT)" -find cc)
b0d623f7 9
39236c6e 10SYMROOT?=$(shell /bin/pwd)
b0d623f7 11
fe8ab488 12CFLAGS := -g -O2 -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
b0d623f7 13
39236c6e
A
14ifdef RC_ARCHS
15 ARCHS:=$(RC_ARCHS)
16 else
17 ifeq "$(Embedded)" "YES"
fe8ab488 18 ARCHS:=armv7 armv7s arm64
39236c6e
A
19 else
20 ARCHS:=x86_64 i386
21 endif
22endif
b0d623f7 23
39236c6e
A
24ARCH_32 := $(filter-out %64, $(ARCHS))
25ARCH_32_FLAGS := $(patsubst %, -arch %, $(ARCH_32))
26ARCH_64 := $(filter %64, $(ARCHS))
27ARCH_64_FLAGS := $(patsubst %, -arch %, $(ARCH_64))
b0d623f7 28
39236c6e 29DSTROOT?=$(shell /bin/pwd)
b0d623f7 30
39236c6e
A
31ARCH_32_TARGETS := MPMMtest KQMPMMtest KQMPMMtestD
32ARCH_64_TARGETS := MPMMtest_64 KQMPMMtest_64 KQMPMMtest_64D
33TARGETS := $(if $(ARCH_64), $(ARCH_64_TARGETS)) $(if $(ARCH_32), $(ARCH_32_TARGETS))
b0d623f7 34
39236c6e
A
35all: $(addprefix $(DSTROOT)/, $(TARGETS))
36
37$(DSTROOT)/MPMMtest: MPMMtest.c
38 ${CC} ${CFLAGS} ${ARCH_32_FLAGS} -o $(SYMROOT)/$(notdir $@) $?
39 if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi
40
41$(DSTROOT)/MPMMtest_64: MPMMtest.c
42 ${CC} ${CFLAGS} ${ARCH_64_FLAGS} -o $(SYMROOT)/$(notdir $@) $?
43 if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi
44
45$(DSTROOT)/KQMPMMtest: KQMPMMtest.c
46 ${CC} ${CFLAGS} ${ARCH_32_FLAGS} -o $(SYMROOT)/$(notdir $@) $?
47 if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi
48
49$(DSTROOT)/KQMPMMtest_64: KQMPMMtest.c
50 ${CC} ${CFLAGS} ${ARCH_64_FLAGS} -o $(SYMROOT)/$(notdir $@) $?
51 if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi
52
53$(DSTROOT)/KQMPMMtestD: KQMPMMtest.c
54 ${CC} ${CFLAGS} ${ARCH_32_FLAGS} -DDIRECT_MSG_RCV=1 -o $(SYMROOT)/$(notdir $@) $?
55 if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi
56
57$(DSTROOT)/KQMPMMtest_64D: KQMPMMtest.c
58 ${CC} ${CFLAG} ${ARCH_64_FLAGS} -DDIRECT_MSG_RCV=1 -o $(SYMROOT)/$(notdir $@) $?
59 if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi
b0d623f7
A
60
61clean:
39236c6e 62 rm -rf $(addprefix $(DSTROOT)/,$(TARGETS)) $(addprefix $(SYMROOT)/,$(TARGETS)) $(SYMROOT)/*.dSYM