1 include ../Makefile.common
3 CC:=$(shell xcrun -sdk "$(SDKROOT)" -find cc)
4 CODESIGN:=$(shell xcrun -sdk "$(SDKROOT)" -find codesign)
5 CODESIGN_ALLOCATE:=$(shell xcrun -sdk "$(SDKROOT)" -find codesign_allocate)
7 SYMROOT?=$(shell /bin/pwd)
9 CFLAGS := -g -O2 -isysroot $(SDKROOT) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
10 CFLAGS += -Wl,-sectcreate,__INFO_FILTER,__disable,/dev/null
12 # $(ARCH_CONFIGS) is set my Makefile.common
13 ARCH_FLAGS := $(if $(ARCH_CONFIGS_64), $(ARCH_FLAGS_64)) $(if $(ARCH_CONFIGS_32), $(ARCH_FLAGS_32))
15 DSTROOT?=$(shell /bin/pwd)
17 TARGETS := persona_mgr persona_spawn persona_test_run.sh persona_spawn_unentitled
19 all: $(addprefix $(DSTROOT)/, $(TARGETS))
21 $(DSTROOT)/persona_%: persona_%.c persona_test.h Makefile persona-entitlements.plist
22 ${CC} ${CFLAGS} ${ARCH_FLAGS} -o $(SYMROOT)/$(notdir $@) $<
23 env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) \
24 $(CODESIGN) -s - --entitlements persona-entitlements.plist $(SYMROOT)/$(notdir $@)
25 if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi
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
31 $(DSTROOT)/persona_test_run.sh: persona_test_run_src.sh
36 rm -rf $(addprefix $(DSTROOT)/,$(TARGETS)) $(addprefix $(SYMROOT)/,$(TARGETS)) $(SYMROOT)/*.dSYM