]>
Commit | Line | Data |
---|---|---|
39037602 A |
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 | ||
5ba3f43e A |
9 | ENABLE_LTE_TESTS=YES |
10 | ||
11 | OTHER_LTE_INCLUDE_FILES += \ | |
12 | /System/Library/PrivateFrameworks/LoggingSupport.framework, \ | |
13 | /System/Library/PrivateFrameworks/MobileKeyBag.framework, \ | |
14 | /usr/local/lib/libdarwintest_utils.dylib, \ | |
15 | /usr/lib/libapple_crypto.dylib, | |
16 | ||
39037602 A |
17 | DEVELOPER_DIR ?= /Applications/Xcode.app/Contents/Developer/ |
18 | ||
19 | # the xnu build system will only ever call us with the default target | |
20 | .DEFAULT_GOAL := install | |
21 | ||
22 | include $(DEVELOPER_DIR)/AppleInternal/Makefiles/darwintest/Makefile.common | |
23 | ||
24 | OTHER_CFLAGS = -Weverything -Wno-gnu-union-cast -Wno-missing-field-initializers -Wno-partial-availability | |
25 | OTHER_CFLAGS += -Wno-missing-noreturn -Wno-vla -Wno-reserved-id-macro -Wno-documentation-unknown-command | |
5ba3f43e | 26 | OTHER_CFLAGS += -Wno-padded -Wno-used-but-marked-unused -Wno-covered-switch-default -Wno-nullability-extension |
39037602 | 27 | OTHER_CFLAGS += --std=gnu11 -isystem $(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders |
5ba3f43e A |
28 | OTHER_CFLAGS += -DT_NAMESPACE_PREFIX=xnu |
29 | OTHER_CFLAGS += -F $(SDKROOT)/System/Library/PrivateFrameworks | |
813fb2f6 A |
30 | |
31 | CODESIGN:=$(shell xcrun -sdk "$(TARGETSDK)" -find codesign) | |
32 | CODESIGN_ALLOCATE:=$(shell xcrun -sdk "$(TARGETSDK)" -find codesign_allocate) | |
39037602 A |
33 | |
34 | # to have custom compiler flags to | |
35 | # target: OTHER_CFLAGS += <my flags> | |
36 | ||
5ba3f43e A |
37 | avx: INVALID_ARCHS = i386 |
38 | avx: OTHER_CFLAGS += -mavx512f -mavx512bw -mavx512vl | |
39 | avx: OTHER_CFLAGS += -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders | |
40 | avx: CONFIG_FLAGS := $(filter-out -O%,$(CONFIG_FLAGS)) | |
41 | # Level 2 optimization must be used to prevent compiler from generating | |
42 | # invalid instructions when compiling with AVX-512 flags. | |
43 | avx: CONFIG_FLAGS += -O2 | |
44 | ifneq (osx,$(TARGET_NAME)) | |
45 | EXCLUDED_SOURCES += avx.c | |
46 | endif | |
47 | ||
39037602 A |
48 | backtracing: OTHER_LDFLAGS += -framework CoreSymbolication |
49 | ||
813fb2f6 A |
50 | data_protection: OTHER_LDFLAGS += -framework IOKit |
51 | ||
39037602 | 52 | kdebug: INVALID_ARCHS = i386 |
5ba3f43e | 53 | kdebug: OTHER_LDFLAGS = -framework ktrace |
39037602 | 54 | |
5ba3f43e | 55 | EXCLUDED_SOURCES += kperf_helpers.c xnu_quick_test_helpers.c |
39037602 | 56 | |
813fb2f6 A |
57 | ifeq ($(PLATFORM),iPhoneOS) |
58 | CONFIG_FREEZE_DEFINE:= -DCONFIG_FREEZE | |
59 | else | |
60 | CONFIG_FREEZE_DEFINE:= | |
61 | EXCLUDED_SOURCES += jumbo_va_spaces_28530648.c | |
62 | endif | |
63 | ||
64 | perf_compressor: OTHER_CFLAGS += $(CONFIG_FREEZE_DEFINE) | |
5ba3f43e A |
65 | perf_compressor: CODE_SIGN_ENTITLEMENTS=./private_entitlement.plist |
66 | ||
67 | stackshot: OTHER_LDFLAGS += -lkdd -framework Foundation | |
68 | stackshot: INVALID_ARCHS = i386 | |
69 | ||
70 | memorystatus_zone_test: INVALID_ARCHS = i386 | |
71 | memorystatus_zone_test: OTHER_CFLAGS += -isystem $(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders | |
72 | memorystatus_zone_test: OTHER_LDFLAGS += -framework ktrace | |
73 | memorystatus_zone_test: OTHER_LDFLAGS += -ldarwintest_utils | |
74 | ||
75 | kpc: OTHER_LDFLAGS += -framework kperf | |
813fb2f6 | 76 | |
39037602 A |
77 | kperf: INVALID_ARCHS = i386 |
78 | kperf: OTHER_CFLAGS += kperf_helpers.c | |
5ba3f43e | 79 | kperf: OTHER_LDFLAGS += -framework kperf -framework kperfdata -framework ktrace -ldarwintest_utils |
39037602 A |
80 | |
81 | kperf_backtracing: INVALID_ARCHS = i386 | |
82 | kperf_backtracing: OTHER_CFLAGS += kperf_helpers.c | |
5ba3f43e | 83 | kperf_backtracing: OTHER_LDFLAGS += -framework kperf -framework kperfdata -framework ktrace |
39037602 A |
84 | kperf_backtracing: OTHER_LDFLAGS += -framework CoreSymbolication |
85 | ||
5ba3f43e A |
86 | kevent_qos: OTHER_CFLAGS += -Wno-unused-macros |
87 | kevent_qos: OTHER_CFLAGS += -I $(OBJROOT)/ | |
88 | ||
39037602 A |
89 | mach_get_times: OTHER_LDFLAGS += -ldarwintest_utils |
90 | ||
5ba3f43e A |
91 | monotonic_core: OTHER_LDFLAGS += -framework ktrace |
92 | monotonic_core: INVALID_ARCHS = i386 | |
93 | ||
94 | perf_exit: OTHER_LDFLAGS = -framework ktrace | |
39037602 | 95 | perf_exit: INVALID_ARCHS = i386 |
5ba3f43e A |
96 | perf_exit: CODE_SIGN_ENTITLEMENTS=./private_entitlement.plist |
97 | ||
98 | perf_spawn_fork: CODE_SIGN_ENTITLEMENTS=./private_entitlement.plist | |
99 | ||
100 | os_thread_self_restrict: os_thread_self_restrict.c os_thread_self_restrict-entitlements.plist | |
101 | os_thread_self_restrict: CODE_SIGN_ENTITLEMENTS=os_thread_self_restrict-entitlements.plist | |
39037602 | 102 | |
813fb2f6 A |
103 | task_inspect: CODE_SIGN_ENTITLEMENTS = task_inspect.entitlements |
104 | task_inspect: OTHER_CFLAGS += -DENTITLED=1 | |
105 | ||
106 | CUSTOM_TARGETS += perf_exit_proc | |
107 | ||
108 | perf_exit_proc: | |
109 | $(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) perf_exit_proc.c -o $(SYMROOT)/perf_exit_proc | |
110 | ||
111 | install-perf_exit_proc: perf_exit_proc | |
112 | mkdir -p $(INSTALLDIR) | |
113 | cp $(SYMROOT)/perf_exit_proc $(INSTALLDIR)/ | |
114 | ||
115 | perf_kdebug: INVALID_ARCHS = i386 | |
116 | ||
39037602 A |
117 | stackshot_idle_25570396: INVALID_ARCHS = i386 |
118 | stackshot_idle_25570396: OTHER_LDFLAGS += -lkdd -framework Foundation | |
119 | ||
813fb2f6 A |
120 | stackshot_block_owner_14362384: INVALID_ARCHS = i386 |
121 | stackshot_block_owner_14362384: OTHER_LDFLAGS += -framework Foundation -lpthread -lkdd | |
122 | ||
5ba3f43e A |
123 | xnu_quick_test: OTHER_CFLAGS += xnu_quick_test_helpers.c |
124 | ||
813fb2f6 A |
125 | ifeq ($(PLATFORM),iPhoneOS) |
126 | OTHER_TEST_TARGETS += jumbo_va_spaces_28530648_unentitled | |
127 | jumbo_va_spaces_28530648: CODE_SIGN_ENTITLEMENTS = jumbo_va_spaces_28530648.entitlements | |
128 | jumbo_va_spaces_28530648: OTHER_CFLAGS += -DENTITLED=1 | |
129 | jumbo_va_spaces_28530648: OTHER_LDFLAGS += -ldarwintest_utils | |
130 | ||
131 | jumbo_va_spaces_28530648_unentitled: OTHER_LDFLAGS += -ldarwintest_utils | |
132 | jumbo_va_spaces_28530648_unentitled: jumbo_va_spaces_28530648.c | |
133 | $(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@ | |
134 | endif | |
135 | ||
5ba3f43e A |
136 | task_info_28439149: CODE_SIGN_ENTITLEMENTS = ./task_for_pid_entitlement.plist |
137 | ||
138 | disk_mount_conditioner: disk_mount_conditioner* | |
139 | disk_mount_conditioner: CODE_SIGN_ENTITLEMENTS=./disk_mount_conditioner-entitlements.plist | |
140 | disk_mount_conditioner: OTHER_LDFLAGS += -ldarwintest_utils | |
141 | ||
142 | OTHER_TEST_TARGETS += disk_mount_conditioner_unentitled | |
143 | disk_mount_conditioner_unentitled: OTHER_CFLAGS += -DTEST_UNENTITLED | |
144 | disk_mount_conditioner_unentitled: OTHER_LDFLAGS += -ldarwintest_utils | |
145 | disk_mount_conditioner_unentitled: disk_mount_conditioner.c | |
146 | $(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@ | |
147 | ||
148 | work_interval_test: CODE_SIGN_ENTITLEMENTS = work_interval_test.entitlements | |
149 | work_interval_test: OTHER_CFLAGS += -DENTITLED=1 | |
150 | ||
151 | settimeofday_29193041_entitled: CODE_SIGN_ENTITLEMENTS = settimeofday_29193041.entitlements | |
152 | thread_group_set_32261625: OTHER_LDFLAGS = -framework ktrace | |
153 | thread_group_set_32261625: INVALID_ARCHS = i386 | |
154 | ||
155 | task_info: CODE_SIGN_ENTITLEMENTS = task_for_pid_entitlement.plist | |
156 | ||
39037602 | 157 | include $(DEVELOPER_DIR)/AppleInternal/Makefiles/darwintest/Makefile.targets |