]>
Commit | Line | Data |
---|---|---|
39236c6e A |
1 | #!/usr/bin/make |
2 | ||
3 | DSTROOT?=$(shell /bin/pwd) | |
4 | CC:=clang | |
5 | CFLAGS:=-I. | |
6 | ||
7 | ifdef RC_ARCHS | |
8 | ARCH:=$(RC_ARCHS) | |
9 | else | |
10 | ifeq "$(Embedded)" "YES" | |
11 | ARCH:=armv7 armv7s | |
12 | else | |
13 | ARCH:=x86_64 i386 | |
14 | endif | |
15 | endif | |
16 | ||
17 | ifeq "$(RC_TARGET_CONFIG)" "iPhone" | |
18 | Embedded?=YES | |
19 | else | |
20 | Embedded?=$(shell echo $(SDKROOT) | grep -iq iphoneos && echo YES || echo NO) | |
21 | endif | |
22 | ||
23 | ifeq "$(Embedded)" "NO" | |
24 | SDKROOT:=$(shell xcodebuild -sdk macosx.internal -version Path) | |
25 | else | |
26 | SDKROOT:=$(shell xcodebuild -sdk iphoneos.internal -version Path) | |
27 | endif | |
28 | ||
29 | MY_ARCH := $(patsubst %, -arch %, $(ARCH)) # allows building multiple archs. | |
30 | ||
31 | all: $(DSTROOT)/memorystatus | |
32 | ||
33 | $(DSTROOT)/memorystatus: memorystatus.c | |
34 | xcrun -sdk $(SDKROOT) $(CC) $(MY_ARCH) -framework CoreFoundation -framework ServiceManagement -F $(SDKROOT)/System/Library/PrivateFrameworks/ -isystem $(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders -o $@ memorystatus.c $(CFLAGS) | |
35 | codesign -f -s - $@ | |
36 | ||
37 | clean: | |
38 | rm -f $(DSTROOT)/memorystatus |