]>
Commit | Line | Data |
---|---|---|
1 | SDKROOT ?= / | |
2 | ifeq "$(RC_TARGET_CONFIG)" "iPhone" | |
3 | Embedded?=YES | |
4 | else | |
5 | Embedded?=$(shell echo $(SDKROOT) | grep -iq iphoneos && echo YES || echo NO) | |
6 | endif | |
7 | ||
8 | CC:=$(shell xcrun -sdk "$(SDKROOT)" -find cc) | |
9 | ||
10 | SYMROOT?=$(shell /bin/pwd) | |
11 | ||
12 | CFLAGS := -g -O2 -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders | |
13 | ||
14 | ifdef 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 | |
22 | endif | |
23 | ||
24 | ARCH_32 := $(filter-out %64, $(ARCHS)) | |
25 | ARCH_32_FLAGS := $(patsubst %, -arch %, $(ARCH_32)) | |
26 | ARCH_64 := $(filter %64, $(ARCHS)) | |
27 | ARCH_64_FLAGS := $(patsubst %, -arch %, $(ARCH_64)) | |
28 | ||
29 | DSTROOT?=$(shell /bin/pwd) | |
30 | ||
31 | ARCH_32_TARGETS := MPMMtest KQMPMMtest KQMPMMtestD | |
32 | ARCH_64_TARGETS := MPMMtest_64 KQMPMMtest_64 KQMPMMtest_64D | |
33 | TARGETS := $(if $(ARCH_64), $(ARCH_64_TARGETS)) $(if $(ARCH_32), $(ARCH_32_TARGETS)) | |
34 | ||
35 | all: $(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 | ||
61 | clean: | |
62 | rm -rf $(addprefix $(DSTROOT)/,$(TARGETS)) $(addprefix $(SYMROOT)/,$(TARGETS)) $(SYMROOT)/*.dSYM |