]>
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 | |
39236c6e A |
17 | ARCH_32 := $(filter-out %64, $(ARCHS)) |
18 | ARCH_32_FLAGS := $(patsubst %, -arch %, $(ARCH_32)) | |
19 | ARCH_64 := $(filter %64, $(ARCHS)) | |
20 | ARCH_64_FLAGS := $(patsubst %, -arch %, $(ARCH_64)) | |
21 | ||
3e170ce0 | 22 | CFLAGS :=-g -isysroot $(SDKROOT) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders |
39236c6e A |
23 | |
24 | DSTROOT?=$(shell /bin/pwd) | |
25 | SRCROOT?=$(shell /bin/pwd) | |
26 | ||
27 | SOURCES := sets.c pool.c tags.c | |
28 | ARCH_32_TARGETS := $(addprefix $(DSTROOT)/, sets pool tags) | |
29 | ARCH_64_TARGETS := $(addprefix $(DSTROOT)/, sets64 pool64 tags64) | |
30 | ||
31 | TARGETS := $(if $(ARCH_64), $(ARCH_64_TARGETS)) $(if $(ARCH_32), $(ARCH_32_TARGETS)) | |
32 | ||
33 | ||
34 | all: $(TARGETS) | |
35 | ||
36 | $(ARCH_32_TARGETS): $(DSTROOT)/%: $(SRCROOT)/%.c | |
37 | $(CC) $(CFLAGS) $(ARCH_32_FLAGS) $< -o $(SYMROOT)/$(notdir $@) # 32-bit fat | |
38 | if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi | |
39 | ||
40 | .SECONDEXPANSION: | |
41 | $(ARCH_64_TARGETS): $(DSTROOT)/%: $(SRCROOT)/$$(subst 64,,%).c | |
42 | $(CC) $(CFLAGS) $(ARCH_64_FLAGS) $< -o $(SYMROOT)/$(notdir $@) # 64-bit fat | |
43 | if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi | |
2d21ac55 A |
44 | |
45 | clean: | |
39236c6e A |
46 | rm -f $(TARGETS) |
47 | rm -rf $(SYMROOT)/*.dSYM |