]> git.saurik.com Git - apple/xnu.git/blob - tools/tests/zero-to-n/Makefile
e848436012155a62c4cbd8ba5056e72fc38b839c
[apple/xnu.git] / tools / tests / zero-to-n / Makefile
1 SDKROOT ?= /
2 ifeq "$(RC_TARGET_CONFIG)" "iPhone"
3 Embedded?=YES
4 else
5 Embedded?=$(shell echo $(SDKROOT) | grep -iq iphoneos && echo YES || echo NO)
6 endif
7
8 CC:=$(shell xcrun -sdk "$(SDKROOT)" -find cc)
9
10 ifdef RC_ARCHS
11 ARCHS:=$(RC_ARCHS)
12 else
13 ifeq "$(Embedded)" "YES"
14 ARCHS:=armv7 armv7s arm64
15 else
16 ARCHS:=x86_64 i386
17 endif
18 endif
19
20 CFLAGS := -g $(patsubst %, -arch %, $(ARCHS)) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
21
22 DSTROOT?=$(shell /bin/pwd)
23 SYMROOT?=$(shell /bin/pwd)
24
25 DEBUG:=0
26
27 $(DSTROOT)/zn: zero-to-n.c
28 $(CC) $(CFLAGS) -Wall zero-to-n.c -o $(SYMROOT)/$(notdir $@) -DDEBUG=$(DEBUG) -ggdb
29 if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi
30
31 clean:
32 rm -rf $(DSTROOT)/zn $(SYMROOT)/*.dSYM $(SYMROOT)/zn