]> git.saurik.com Git - apple/xnu.git/blame - tools/tests/memorystatus/Makefile
xnu-2422.1.72.tar.gz
[apple/xnu.git] / tools / tests / memorystatus / Makefile
CommitLineData
39236c6e
A
1#!/usr/bin/make
2
3DSTROOT?=$(shell /bin/pwd)
4CC:=clang
5CFLAGS:=-I.
6
7ifdef 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
15endif
16
17ifeq "$(RC_TARGET_CONFIG)" "iPhone"
18Embedded?=YES
19else
20Embedded?=$(shell echo $(SDKROOT) | grep -iq iphoneos && echo YES || echo NO)
21endif
22
23ifeq "$(Embedded)" "NO"
24 SDKROOT:=$(shell xcodebuild -sdk macosx.internal -version Path)
25else
26 SDKROOT:=$(shell xcodebuild -sdk iphoneos.internal -version Path)
27endif
28
29MY_ARCH := $(patsubst %, -arch %, $(ARCH)) # allows building multiple archs.
30
31all: $(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
37clean:
38 rm -f $(DSTROOT)/memorystatus