1 include ../Makefile.common
3 CC:=$(shell xcrun -sdk "$(SDKROOT)" -find cc)
5 SYMROOT?=$(shell /bin/pwd)
7 CFLAGS := -g -O2 -isysroot $(SDKROOT) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
8 CFLAGS += -Wno-deprecated-declarations
13 ifeq "$(Embedded)" "YES"
14 ARCHS:=armv7 armv7s arm64
20 # These are convenience functions for filtering based on substrings, as the
21 # normal filter functions only accept one wildcard.
22 FILTER_OUT_SUBSTRING=$(strip $(foreach string,$(2),$(if $(findstring $(1),$(string)),,$(string))))
23 FILTER_SUBSTRING=$(strip $(foreach string,$(2),$(if $(findstring $(1),$(string)),$(string),)))
25 ARCH_32:=$(call FILTER_OUT_SUBSTRING,64,$(ARCHS))
26 ARCH_64:=$(call FILTER_SUBSTRING,64,$(ARCHS))
28 ARCH_32_FLAGS := $(patsubst %, -arch %, $(ARCH_32))
29 ARCH_64_FLAGS := $(patsubst %, -arch %, $(ARCH_64))
31 DSTROOT?=$(shell /bin/pwd)
33 ARCH_32_TARGETS := MPMMtest KQMPMMtest KQMPMMtestD
34 ARCH_64_TARGETS := MPMMtest_64 KQMPMMtest_64 KQMPMMtest_64D
35 TARGETS := MPMMtest_perf.sh $(if $(ARCH_64), $(ARCH_64_TARGETS)) $(if $(ARCH_32), $(ARCH_32_TARGETS))
37 all: $(addprefix $(DSTROOT)/, $(TARGETS))
39 $(DSTROOT)/MPMMtest: MPMMtest.c
40 ${CC} ${CFLAGS} ${ARCH_32_FLAGS} -o $(SYMROOT)/$(notdir $@) $?
41 if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi
43 $(DSTROOT)/MPMMtest_64: MPMMtest.c
44 ${CC} ${CFLAGS} ${ARCH_64_FLAGS} -o $(SYMROOT)/$(notdir $@) $?
45 if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi
47 $(DSTROOT)/KQMPMMtest: KQMPMMtest.c
48 ${CC} ${CFLAGS} ${ARCH_32_FLAGS} -o $(SYMROOT)/$(notdir $@) $?
49 if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi
51 $(DSTROOT)/KQMPMMtest_64: KQMPMMtest.c
52 ${CC} ${CFLAGS} ${ARCH_64_FLAGS} -o $(SYMROOT)/$(notdir $@) $?
53 if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi
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
59 $(DSTROOT)/KQMPMMtest_64D: KQMPMMtest.c
60 ${CC} ${CFLAGS} ${ARCH_64_FLAGS} -DDIRECT_MSG_RCV=1 -o $(SYMROOT)/$(notdir $@) $?
61 if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi
63 $(DSTROOT)/MPMMtest_perf.sh: MPMMtest_run.sh
68 rm -rf $(addprefix $(DSTROOT)/,$(TARGETS)) $(addprefix $(SYMROOT)/,$(TARGETS)) $(SYMROOT)/*.dSYM