]> git.saurik.com Git - apple/xnu.git/blame - tools/tests/personas/Makefile
xnu-3248.60.10.tar.gz
[apple/xnu.git] / tools / tests / personas / Makefile
CommitLineData
490019cf
A
1include ../Makefile.common
2
3CC:=$(shell xcrun -sdk "$(SDKROOT)" -find cc)
4
5SYMROOT?=$(shell /bin/pwd)
6
7CFLAGS := -g -O2 -isysroot $(SDKROOT) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
8
9ifdef RC_ARCHS
10 ARCHS:=$(RC_ARCHS)
11 else
12 ifeq "$(Embedded)" "YES"
13 ARCHS:=armv7 armv7s arm64
14 else
15 ARCHS:=x86_64 i386
16 endif
17endif
18
19ARCH_32 := $(filter-out %64, $(ARCHS))
20ARCH_64 := $(filter %64, $(ARCHS))
21
22ARCH_32_FLAGS := $(patsubst %, -arch %, $(ARCH_32))
23ARCH_64_FLAGS := $(patsubst %, -arch %, $(ARCH_64))
24ARCH_FLAGS := $(if $(ARCH_64), $(ARCH_64_FLAGS)) $(if $(ARCH_32), $(ARCH_32_FLAGS))
25
26DSTROOT?=$(shell /bin/pwd)
27
28TARGETS := persona_mgr persona_spawn
29
30all: $(addprefix $(DSTROOT)/, $(TARGETS))
31
32$(DSTROOT)/persona_%: persona_%.c persona_test.h Makefile
33 ${CC} ${CFLAGS} ${ARCH_FLAGS} -o $(SYMROOT)/$(notdir $@) $<
34 if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi
35
36clean:
37 rm -rf $(addprefix $(DSTROOT)/,$(TARGETS)) $(addprefix $(SYMROOT)/,$(TARGETS)) $(SYMROOT)/*.dSYM