3 DSTROOT?=$(shell /bin/pwd)
4 CC:=$(shell xcrun -sdk "$(SDKROOT)" -find clang)
10 ifeq "$(Embedded)" "YES"
11 ARCH:=armv7 armv7s arm64
17 ifeq "$(RC_TARGET_CONFIG)" "iPhone"
20 Embedded?=$(shell echo $(SDKROOT) | grep -iq iphoneos && echo YES || echo NO)
23 ifeq "$(Embedded)" "NO"
24 SDKROOT:=$(shell xcodebuild -sdk macosx.internal -version Path)
26 SDKROOT:=$(shell xcodebuild -sdk iphoneos.internal -version Path)
29 MY_ARCH := $(patsubst %, -arch %, $(ARCH)) # allows building multiple archs.
31 all: $(DSTROOT)/memorystatus \
32 $(DSTROOT)/memorystatus_groups
34 $(DSTROOT)/memorystatus_groups: memorystatus_groups.c
35 $(CC) $(MY_ARCH) -isystem $(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders -o $(SYMROOT)/$(notdir $@) memorystatus_groups.c $(CFLAGS)
36 ditto $(SYMROOT)/$(notdir $@) $@
40 $(DSTROOT)/memorystatus: memorystatus.c
41 $(CC) $(MY_ARCH) -framework CoreFoundation -framework ServiceManagement -F $(SDKROOT)/System/Library/PrivateFrameworks/ -isystem $(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders -o $(SYMROOT)/$(notdir $@) memorystatus.c $(CFLAGS)
42 ditto $(SYMROOT)/$(notdir $@) $@
46 rm -f $(DSTROOT)/memorystatus
47 rm -f $(DSTROOT)/memorystatus_groups