]> git.saurik.com Git - apple/xnu.git/blob - tools/tests/darwintests/Makefile
xnu-3789.70.16.tar.gz
[apple/xnu.git] / tools / tests / darwintests / Makefile
1 PROJECT := xnu/darwintests
2
3 # When building as part of xnu_tests, we get passed a DSTROOT that's got the
4 # unit test path in it already. But, BASEDSTROOT doesn't, so use that instead.
5 ifdef BASEDSTROOT
6 override DSTROOT = $(BASEDSTROOT)
7 endif
8
9 DEVELOPER_DIR ?= /Applications/Xcode.app/Contents/Developer/
10
11 # the xnu build system will only ever call us with the default target
12 .DEFAULT_GOAL := install
13
14 include $(DEVELOPER_DIR)/AppleInternal/Makefiles/darwintest/Makefile.common
15
16 OTHER_CFLAGS = -Weverything -Wno-gnu-union-cast -Wno-missing-field-initializers -Wno-partial-availability
17 OTHER_CFLAGS += -Wno-missing-noreturn -Wno-vla -Wno-reserved-id-macro -Wno-documentation-unknown-command
18 OTHER_CFLAGS += -Wno-padded -Wno-used-but-marked-unused -Wno-covered-switch-default
19 OTHER_CFLAGS += --std=gnu11 -isystem $(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
20 OTHER_CFLAGS += -DT_NAMESPACE=xnu
21
22 CODESIGN:=$(shell xcrun -sdk "$(TARGETSDK)" -find codesign)
23 CODESIGN_ALLOCATE:=$(shell xcrun -sdk "$(TARGETSDK)" -find codesign_allocate)
24
25 # to have custom compiler flags to
26 # target: OTHER_CFLAGS += <my flags>
27
28 backtracing: OTHER_CFLAGS += -F $(SDKROOT)/System/Library/PrivateFrameworks
29 backtracing: OTHER_LDFLAGS += -framework CoreSymbolication
30
31 data_protection: OTHER_LDFLAGS += -framework IOKit
32
33 kdebug: INVALID_ARCHS = i386
34 kdebug: OTHER_LDFLAGS = -lktrace
35
36 EXCLUDED_SOURCES += kperf_helpers.c
37
38 ifeq ($(PLATFORM),iPhoneOS)
39 CONFIG_FREEZE_DEFINE:= -DCONFIG_FREEZE
40 else
41 CONFIG_FREEZE_DEFINE:=
42 EXCLUDED_SOURCES += jumbo_va_spaces_28530648.c
43 endif
44
45 perf_compressor: OTHER_CFLAGS += $(CONFIG_FREEZE_DEFINE)
46
47 kperf: INVALID_ARCHS = i386
48 kperf: OTHER_CFLAGS += kperf_helpers.c
49 kperf: OTHER_CFLAGS += -F $(SDKROOT)/System/Library/PrivateFrameworks
50 kperf: OTHER_LDFLAGS += -framework kperf -framework kperfdata -lktrace
51
52 kperf_backtracing: INVALID_ARCHS = i386
53 kperf_backtracing: OTHER_CFLAGS += kperf_helpers.c
54 kperf_backtracing: OTHER_CFLAGS += -F $(SDKROOT)/System/Library/PrivateFrameworks
55 kperf_backtracing: OTHER_LDFLAGS += -framework kperf -framework kperfdata -lktrace
56 kperf_backtracing: OTHER_LDFLAGS += -framework CoreSymbolication
57
58 mach_get_times: OTHER_LDFLAGS += -ldarwintest_utils
59
60 perf_exit: OTHER_LDFLAGS = -lktrace
61 perf_exit: INVALID_ARCHS = i386
62
63 task_inspect: CODE_SIGN_ENTITLEMENTS = task_inspect.entitlements
64 task_inspect: OTHER_CFLAGS += -DENTITLED=1
65
66 CUSTOM_TARGETS += perf_exit_proc
67
68 perf_exit_proc:
69 $(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) perf_exit_proc.c -o $(SYMROOT)/perf_exit_proc
70
71 install-perf_exit_proc: perf_exit_proc
72 mkdir -p $(INSTALLDIR)
73 cp $(SYMROOT)/perf_exit_proc $(INSTALLDIR)/
74
75 perf_kdebug: INVALID_ARCHS = i386
76
77 stackshot_idle_25570396: INVALID_ARCHS = i386
78 stackshot_idle_25570396: OTHER_LDFLAGS += -lkdd -framework Foundation
79
80 stackshot_block_owner_14362384: INVALID_ARCHS = i386
81 stackshot_block_owner_14362384: OTHER_LDFLAGS += -framework Foundation -lpthread -lkdd
82
83 ifeq ($(PLATFORM),iPhoneOS)
84 OTHER_TEST_TARGETS += jumbo_va_spaces_28530648_unentitled
85 jumbo_va_spaces_28530648: CODE_SIGN_ENTITLEMENTS = jumbo_va_spaces_28530648.entitlements
86 jumbo_va_spaces_28530648: OTHER_CFLAGS += -DENTITLED=1
87 jumbo_va_spaces_28530648: OTHER_LDFLAGS += -ldarwintest_utils
88
89 jumbo_va_spaces_28530648_unentitled: OTHER_LDFLAGS += -ldarwintest_utils
90 jumbo_va_spaces_28530648_unentitled: jumbo_va_spaces_28530648.c
91 $(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
92 endif
93
94 include $(DEVELOPER_DIR)/AppleInternal/Makefiles/darwintest/Makefile.targets