-SDKROOT ?= /
-ifeq "$(RC_TARGET_CONFIG)" "iPhone"
-Embedded?=YES
-else
-Embedded?=$(shell echo $(SDKROOT) | grep -iq iphoneos && echo YES || echo NO)
-endif
+include ../Makefile.common
-CC:=xcrun -sdk "$(SDKROOT)" cc
+CC:=$(shell xcrun -sdk "$(SDKROOT)" -find cc)
SYMROOT?=$(shell /bin/pwd)
ARCHS:=$(RC_ARCHS)
else
ifeq "$(Embedded)" "YES"
- ARCHS:=armv7 armv7s
+ ARCHS:=armv7 armv7s arm64
else
ARCHS:=x86_64 i386
endif
ARCH_64 := $(filter %64, $(ARCHS))
ARCH_64_FLAGS := $(patsubst %, -arch %, $(ARCH_64))
-CFLAGS :=-g
+CFLAGS :=-g -isysroot $(SDKROOT) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
DSTROOT?=$(shell /bin/pwd)
SRCROOT?=$(shell /bin/pwd)
all: $(TARGETS)
$(ARCH_32_TARGETS): $(DSTROOT)/%: $(SRCROOT)/%.c
- $(CC) $(CFLAGS) $(ARCH_32_FLAGS) $< -o $(SYMROOT)/$(notdir $@) # 32-bit fat
+ $(CC) $(CFLAGS) $(ARCH_32_FLAGS) $< -o $(SYMROOT)/$(notdir $@) # 32-bit fat
if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi
.SECONDEXPANSION:
if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi
clean:
- rm -f $(TARGETS)
+ rm -f $(TARGETS)
rm -rf $(SYMROOT)/*.dSYM