]>
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 | |
2d21ac55 | 7 | |
fe8ab488 | 8 | CC:=$(shell xcrun -sdk "$(SDKROOT)" -find cc) |
2d21ac55 | 9 | |
39236c6e | 10 | SYMROOT?=$(shell /bin/pwd) |
2d21ac55 | 11 | |
39236c6e A |
12 | ifdef RC_ARCHS |
13 | ARCHS:=$(RC_ARCHS) | |
14 | else | |
15 | ifeq "$(Embedded)" "YES" | |
fe8ab488 | 16 | ARCHS:=armv7 armv7s arm64 |
39236c6e A |
17 | else |
18 | ARCHS:=x86_64 i386 | |
19 | endif | |
20 | endif | |
2d21ac55 | 21 | |
39236c6e A |
22 | ARCH_32 := $(filter-out %64, $(ARCHS)) |
23 | ARCH_32_FLAGS := $(patsubst %, -arch %, $(ARCH_32)) | |
24 | ARCH_64 := $(filter %64, $(ARCHS)) | |
25 | ARCH_64_FLAGS := $(patsubst %, -arch %, $(ARCH_64)) | |
26 | ||
fe8ab488 | 27 | CFLAGS :=-g -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders |
39236c6e A |
28 | |
29 | DSTROOT?=$(shell /bin/pwd) | |
30 | SRCROOT?=$(shell /bin/pwd) | |
31 | ||
32 | SOURCES := sets.c pool.c tags.c | |
33 | ARCH_32_TARGETS := $(addprefix $(DSTROOT)/, sets pool tags) | |
34 | ARCH_64_TARGETS := $(addprefix $(DSTROOT)/, sets64 pool64 tags64) | |
35 | ||
36 | TARGETS := $(if $(ARCH_64), $(ARCH_64_TARGETS)) $(if $(ARCH_32), $(ARCH_32_TARGETS)) | |
37 | ||
38 | ||
39 | all: $(TARGETS) | |
40 | ||
41 | $(ARCH_32_TARGETS): $(DSTROOT)/%: $(SRCROOT)/%.c | |
42 | $(CC) $(CFLAGS) $(ARCH_32_FLAGS) $< -o $(SYMROOT)/$(notdir $@) # 32-bit fat | |
43 | if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi | |
44 | ||
45 | .SECONDEXPANSION: | |
46 | $(ARCH_64_TARGETS): $(DSTROOT)/%: $(SRCROOT)/$$(subst 64,,%).c | |
47 | $(CC) $(CFLAGS) $(ARCH_64_FLAGS) $< -o $(SYMROOT)/$(notdir $@) # 64-bit fat | |
48 | if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi | |
2d21ac55 A |
49 | |
50 | clean: | |
39236c6e A |
51 | rm -f $(TARGETS) |
52 | rm -rf $(SYMROOT)/*.dSYM |