]>
Commit | Line | Data |
---|---|---|
39236c6e A |
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 | |
b0d623f7 | 7 | |
39236c6e | 8 | CC:=xcrun -sdk "$(SDKROOT)" cc |
b0d623f7 | 9 | |
39236c6e | 10 | SYMROOT?=$(shell /bin/pwd) |
b0d623f7 | 11 | |
39236c6e | 12 | CFLAGS := -g -O2 |
b0d623f7 | 13 | |
39236c6e A |
14 | ifdef RC_ARCHS |
15 | ARCHS:=$(RC_ARCHS) | |
16 | else | |
17 | ifeq "$(Embedded)" "YES" | |
18 | ARCHS:=armv7 armv7s | |
19 | else | |
20 | ARCHS:=x86_64 i386 | |
21 | endif | |
22 | endif | |
b0d623f7 | 23 | |
39236c6e A |
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)) | |
b0d623f7 | 28 | |
39236c6e | 29 | DSTROOT?=$(shell /bin/pwd) |
b0d623f7 | 30 | |
39236c6e A |
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)) | |
b0d623f7 | 34 | |
39236c6e A |
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 | |
b0d623f7 A |
60 | |
61 | clean: | |
39236c6e | 62 | rm -rf $(addprefix $(DSTROOT)/,$(TARGETS)) $(addprefix $(SYMROOT)/,$(TARGETS)) $(SYMROOT)/*.dSYM |