X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/bd504ef0e0b883cdd7917b73b3574eb9ce669905..39236c6e673c41db228275375ab7fdb0f837b292:/tools/tests/zero-to-n/Makefile diff --git a/tools/tests/zero-to-n/Makefile b/tools/tests/zero-to-n/Makefile index 30a82361b..4c3b62c8e 100644 --- a/tools/tests/zero-to-n/Makefile +++ b/tools/tests/zero-to-n/Makefile @@ -1,5 +1,32 @@ -DEBUG=0 -CC=/usr/bin/llvm-gcc-4.2 +SDKROOT ?= / +ifeq "$(RC_TARGET_CONFIG)" "iPhone" +Embedded?=YES +else +Embedded?=$(shell echo $(SDKROOT) | grep -iq iphoneos && echo YES || echo NO) +endif -zn: zero-to-n.c - $(CC) -Wall -arch i386 -arch x86_64 zero-to-n.c -o zn -DDEBUG=$(DEBUG) -ggdb +CC:=xcrun -sdk "$(SDKROOT)" cc + +ifdef RC_ARCHS + ARCHS:=$(RC_ARCHS) + else + ifeq "$(Embedded)" "YES" + ARCHS:=armv7 armv7s + else + ARCHS:=x86_64 i386 + endif +endif + +CFLAGS := -g $(patsubst %, -arch %, $(ARCHS)) + +DSTROOT?=$(shell /bin/pwd) +SYMROOT?=$(shell /bin/pwd) + +DEBUG:=0 + +$(DSTROOT)/zn: zero-to-n.c + $(CC) $(CFLAGS) -Wall zero-to-n.c -o $(SYMROOT)/$(notdir $@) -DDEBUG=$(DEBUG) -ggdb + if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi + +clean: + rm -rf $(DSTROOT)/zn $(SYMROOT)/*.dSYM $(SYMROOT)/zn