]> git.saurik.com Git - apple/xnu.git/blob - tools/tests/memorystatus/Makefile
xnu-2782.1.97.tar.gz
[apple/xnu.git] / tools / tests / memorystatus / Makefile
1 #!/usr/bin/make
2
3 DSTROOT?=$(shell /bin/pwd)
4 CC:=$(shell xcrun -sdk "$(SDKROOT)" -find clang)
5 CFLAGS:=-I. -g
6
7 ifdef RC_ARCHS
8 ARCH:=$(RC_ARCHS)
9 else
10 ifeq "$(Embedded)" "YES"
11 ARCH:=armv7 armv7s arm64
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 $(DSTROOT)/memorystatus_groups
33
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 $@) $@
37 codesign -f -s - $@
38
39
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 $@) $@
43 codesign -f -s - $@
44
45 clean:
46 rm -f $(DSTROOT)/memorystatus
47 rm -f $(DSTROOT)/memorystatus_groups