]>
Commit | Line | Data |
---|---|---|
490019cf A |
1 | include ../Makefile.common |
2 | ||
3 | CC:=$(shell xcrun -sdk "$(SDKROOT)" -find cc) | |
cb323159 A |
4 | CODESIGN:=$(shell xcrun -sdk "$(SDKROOT)" -find codesign) |
5 | CODESIGN_ALLOCATE:=$(shell xcrun -sdk "$(SDKROOT)" -find codesign_allocate) | |
490019cf A |
6 | |
7 | SYMROOT?=$(shell /bin/pwd) | |
8 | ||
9 | CFLAGS := -g -O2 -isysroot $(SDKROOT) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders | |
f427ee49 | 10 | CFLAGS += -Wl,-sectcreate,__INFO_FILTER,__disable,/dev/null |
490019cf | 11 | |
f427ee49 A |
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)) | |
490019cf A |
14 | |
15 | DSTROOT?=$(shell /bin/pwd) | |
16 | ||
cb323159 | 17 | TARGETS := persona_mgr persona_spawn persona_test_run.sh persona_spawn_unentitled |
490019cf A |
18 | |
19 | all: $(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 |
35 | clean: |
36 | rm -rf $(addprefix $(DSTROOT)/,$(TARGETS)) $(addprefix $(SYMROOT)/,$(TARGETS)) $(SYMROOT)/*.dSYM |