]> git.saurik.com Git - apple/xnu.git/blame_incremental - tools/tests/MPMMTest/Makefile
xnu-2782.1.97.tar.gz
[apple/xnu.git] / tools / tests / MPMMTest / Makefile
... / ...
CommitLineData
1SDKROOT ?= /
2ifeq "$(RC_TARGET_CONFIG)" "iPhone"
3Embedded?=YES
4else
5Embedded?=$(shell echo $(SDKROOT) | grep -iq iphoneos && echo YES || echo NO)
6endif
7
8CC:=$(shell xcrun -sdk "$(SDKROOT)" -find cc)
9
10SYMROOT?=$(shell /bin/pwd)
11
12CFLAGS := -g -O2 -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
13
14ifdef RC_ARCHS
15 ARCHS:=$(RC_ARCHS)
16 else
17 ifeq "$(Embedded)" "YES"
18 ARCHS:=armv7 armv7s arm64
19 else
20 ARCHS:=x86_64 i386
21 endif
22endif
23
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))
28
29DSTROOT?=$(shell /bin/pwd)
30
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))
34
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
60
61clean:
62 rm -rf $(addprefix $(DSTROOT)/,$(TARGETS)) $(addprefix $(SYMROOT)/,$(TARGETS)) $(SYMROOT)/*.dSYM