]> git.saurik.com Git - apple/xnu.git/blame - tools/tests/personas/Makefile
xnu-7195.101.1.tar.gz
[apple/xnu.git] / tools / tests / personas / Makefile
CommitLineData
490019cf
A
1include ../Makefile.common
2
3CC:=$(shell xcrun -sdk "$(SDKROOT)" -find cc)
cb323159
A
4CODESIGN:=$(shell xcrun -sdk "$(SDKROOT)" -find codesign)
5CODESIGN_ALLOCATE:=$(shell xcrun -sdk "$(SDKROOT)" -find codesign_allocate)
490019cf
A
6
7SYMROOT?=$(shell /bin/pwd)
8
9CFLAGS := -g -O2 -isysroot $(SDKROOT) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
f427ee49 10CFLAGS += -Wl,-sectcreate,__INFO_FILTER,__disable,/dev/null
490019cf 11
f427ee49
A
12# $(ARCH_CONFIGS) is set my Makefile.common
13ARCH_FLAGS := $(if $(ARCH_CONFIGS_64), $(ARCH_FLAGS_64)) $(if $(ARCH_CONFIGS_32), $(ARCH_FLAGS_32))
490019cf
A
14
15DSTROOT?=$(shell /bin/pwd)
16
cb323159 17TARGETS := persona_mgr persona_spawn persona_test_run.sh persona_spawn_unentitled
490019cf
A
18
19all: $(addprefix $(DSTROOT)/, $(TARGETS))
20
cb323159 21$(DSTROOT)/persona_%: persona_%.c persona_test.h Makefile persona-entitlements.plist
490019cf 22 ${CC} ${CFLAGS} ${ARCH_FLAGS} -o $(SYMROOT)/$(notdir $@) $<
cb323159
A
23 env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) \
24 $(CODESIGN) -s - --entitlements persona-entitlements.plist $(SYMROOT)/$(notdir $@)
490019cf
A
25 if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi
26
cb323159
A
27$(DSTROOT)/persona_spawn_unentitled: persona_spawn.c persona_test.h Makefile
28 ${CC} ${CFLAGS} ${ARCH_FLAGS} -o $(SYMROOT)/$(notdir $@) $<
29 if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi
30
31$(DSTROOT)/persona_test_run.sh: persona_test_run_src.sh
d9a64523
A
32 cp $? $@
33 chmod +x $@
34
490019cf
A
35clean:
36 rm -rf $(addprefix $(DSTROOT)/,$(TARGETS)) $(addprefix $(SYMROOT)/,$(TARGETS)) $(SYMROOT)/*.dSYM