]>
Commit | Line | Data |
---|---|---|
3e170ce0 | 1 | include ../Makefile.common |
2d21ac55 | 2 | |
fe8ab488 | 3 | CC:=$(shell xcrun -sdk "$(SDKROOT)" -find cc) |
2d21ac55 | 4 | |
39236c6e | 5 | SYMROOT?=$(shell /bin/pwd) |
2d21ac55 | 6 | |
39236c6e A |
7 | ifdef RC_ARCHS |
8 | ARCHS:=$(RC_ARCHS) | |
9 | else | |
10 | ifeq "$(Embedded)" "YES" | |
fe8ab488 | 11 | ARCHS:=armv7 armv7s arm64 |
39236c6e A |
12 | else |
13 | ARCHS:=x86_64 i386 | |
14 | endif | |
15 | endif | |
2d21ac55 | 16 | |
d9a64523 A |
17 | # These are convenience functions for filtering based on substrings, as the |
18 | # normal filter functions only accept one wildcard. | |
19 | FILTER_OUT_SUBSTRING=$(strip $(foreach string,$(2),$(if $(findstring $(1),$(string)),,$(string)))) | |
20 | FILTER_SUBSTRING=$(strip $(foreach string,$(2),$(if $(findstring $(1),$(string)),$(string),))) | |
21 | ||
22 | ARCH_32:=$(call FILTER_OUT_SUBSTRING,64,$(ARCHS)) | |
23 | ARCH_64:=$(call FILTER_SUBSTRING,64,$(ARCHS)) | |
24 | ||
39236c6e | 25 | ARCH_32_FLAGS := $(patsubst %, -arch %, $(ARCH_32)) |
39236c6e A |
26 | ARCH_64_FLAGS := $(patsubst %, -arch %, $(ARCH_64)) |
27 | ||
39037602 | 28 | CFLAGS :=-g -isysroot $(SDKROOT) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders |
39236c6e A |
29 | |
30 | DSTROOT?=$(shell /bin/pwd) | |
31 | SRCROOT?=$(shell /bin/pwd) | |
32 | ||
33 | SOURCES := sets.c pool.c tags.c | |
34 | ARCH_32_TARGETS := $(addprefix $(DSTROOT)/, sets pool tags) | |
35 | ARCH_64_TARGETS := $(addprefix $(DSTROOT)/, sets64 pool64 tags64) | |
36 | ||
37 | TARGETS := $(if $(ARCH_64), $(ARCH_64_TARGETS)) $(if $(ARCH_32), $(ARCH_32_TARGETS)) | |
38 | ||
39 | ||
40 | all: $(TARGETS) | |
41 | ||
42 | $(ARCH_32_TARGETS): $(DSTROOT)/%: $(SRCROOT)/%.c | |
39037602 | 43 | $(CC) $(CFLAGS) $(ARCH_32_FLAGS) $< -o $(SYMROOT)/$(notdir $@) # 32-bit fat |
39236c6e A |
44 | if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi |
45 | ||
46 | .SECONDEXPANSION: | |
47 | $(ARCH_64_TARGETS): $(DSTROOT)/%: $(SRCROOT)/$$(subst 64,,%).c | |
48 | $(CC) $(CFLAGS) $(ARCH_64_FLAGS) $< -o $(SYMROOT)/$(notdir $@) # 64-bit fat | |
49 | if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi | |
2d21ac55 A |
50 | |
51 | clean: | |
39037602 | 52 | rm -f $(TARGETS) |
39236c6e | 53 | rm -rf $(SYMROOT)/*.dSYM |