]> git.saurik.com Git - apple/xnu.git/blame - tests/Makefile
xnu-7195.101.1.tar.gz
[apple/xnu.git] / tests / Makefile
CommitLineData
39037602
A
1PROJECT := 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.
5ifdef BASEDSTROOT
6override DSTROOT = $(BASEDSTROOT)
7endif
8
f427ee49 9INVALID_ARCHS = i386
5ba3f43e
A
10ENABLE_LTE_TESTS=YES
11
12OTHER_LTE_INCLUDE_FILES += \
13 /System/Library/PrivateFrameworks/LoggingSupport.framework, \
14 /System/Library/PrivateFrameworks/MobileKeyBag.framework, \
cb323159 15 /System/Library/Frameworks/IOSurface.framework, \
5ba3f43e
A
16 /usr/local/lib/libdarwintest_utils.dylib, \
17 /usr/lib/libapple_crypto.dylib,
18
d9a64523 19DEVELOPER_DIR ?= $(shell xcode-select -p)
39037602
A
20
21# the xnu build system will only ever call us with the default target
22.DEFAULT_GOAL := install
23
24include $(DEVELOPER_DIR)/AppleInternal/Makefiles/darwintest/Makefile.common
25
26OTHER_CFLAGS = -Weverything -Wno-gnu-union-cast -Wno-missing-field-initializers -Wno-partial-availability
27OTHER_CFLAGS += -Wno-missing-noreturn -Wno-vla -Wno-reserved-id-macro -Wno-documentation-unknown-command
5ba3f43e 28OTHER_CFLAGS += -Wno-padded -Wno-used-but-marked-unused -Wno-covered-switch-default -Wno-nullability-extension
cb323159 29OTHER_CFLAGS += -Wno-gnu-empty-initializer -Wno-unused-macros -Wno-undef -Wno-fixed-enum-extension
f427ee49 30OTHER_CFLAGS += -Wno-gnu-auto-type -Wno-switch-enum -Wno-variadic-macros
39037602 31OTHER_CFLAGS += --std=gnu11 -isystem $(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
d9a64523 32OTHER_CFLAGS += -UT_NAMESPACE_PREFIX -DT_NAMESPACE_PREFIX=xnu
5ba3f43e 33OTHER_CFLAGS += -F $(SDKROOT)/System/Library/PrivateFrameworks
813fb2f6 34
f427ee49
A
35OTHER_CFLAGS += -Wl,-sectcreate,__INFO_FILTER,__disable,/dev/null
36
37
813fb2f6 38CODESIGN:=$(shell xcrun -sdk "$(TARGETSDK)" -find codesign)
f427ee49 39CODESIGN_HARDENED_RUNTIME:=$(CODESIGN) -o runtime
813fb2f6 40CODESIGN_ALLOCATE:=$(shell xcrun -sdk "$(TARGETSDK)" -find codesign_allocate)
39037602
A
41
42# to have custom compiler flags to
43# target: OTHER_CFLAGS += <my flags>
44
a39ff7e2
A
45atm_diagnostic_flag: OTHER_CFLAGS += drop_priv.c
46
c6bf4f31
A
47atm_diagnostic_flag_entitled: CODE_SIGN_ENTITLEMENTS = atm_diagnostic_flag.entitlements
48atm_diagnostic_flag_entitled: OTHER_CFLAGS += drop_priv.c
49
f427ee49 50avx: INVALID_ARCHS = $(filter arm%,$(ARCH_CONFIGS))
5ba3f43e
A
51avx: OTHER_CFLAGS += -mavx512f -mavx512bw -mavx512vl
52avx: OTHER_CFLAGS += -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
53avx: CONFIG_FLAGS := $(filter-out -O%,$(CONFIG_FLAGS))
54# Level 2 optimization must be used to prevent compiler from generating
55# invalid instructions when compiling with AVX-512 flags.
56avx: CONFIG_FLAGS += -O2
a39ff7e2
A
57# Disable vzeroupper insertion to work around rdar://problem/35035096
58avx: CONFIG_FLAGS += -mllvm -x86-use-vzeroupper=0
5ba3f43e
A
59ifneq (osx,$(TARGET_NAME))
60EXCLUDED_SOURCES += avx.c
61endif
62
f427ee49
A
63CUSTOM_TARGETS = sr_entitlement_helper
64
65sr_entitlement_helper: sr_entitlement_helper.c
66 mkdir -p $(SYMROOT)
67 $(CC) -I $(OBJROOT) $(CFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) sr_entitlement_helper.c -o $(SYMROOT)/$@
68 echo $(CODESIGN) --force --sign - --timestamp=none --entitlements sr_entitlement.entitlements $(SYMROOT)/$@; \
69 env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements sr_entitlement.entitlements $(SYMROOT)/$@;
70
71install-sr_entitlement_helper: sr_entitlement_helper
72 mkdir -p $(INSTALLDIR)
73 cp $(SYMROOT)/sr_entitlement_helper $(INSTALLDIR)
74
75sr_entitlement: OTHER_LDFLAGS += -ldarwintest_utils
76
c3c9b80d
A
77restrict_jit: CODE_SIGN_ENTITLEMENTS = restrict_jit.entitlements
78
39037602 79backtracing: OTHER_LDFLAGS += -framework CoreSymbolication
f427ee49 80backtracing: CODE_SIGN_ENTITLEMENTS = kernel_symbolication_entitlements.plist
39037602 81
a39ff7e2 82data_protection: OTHER_LDFLAGS += -ldarwintest_utils -framework IOKit
813fb2f6 83
c3c9b80d
A
84CUSTOM_TARGETS += immovable_send_client vm_spawn_tool
85
86exception_tests: excserver exc_helpers.c
87exception_tests: CODE_SIGN_ENTITLEMENTS = exception_tests.entitlements
88exception_tests: OTHER_CFLAGS += $(OBJROOT)/excserver.c
89exception_tests: OTHER_CFLAGS += -I $(OBJROOT)
90exception_tests: OTHER_CFLAGS += -DENTITLED=1
91
cb323159
A
92immovable_send: excserver
93immovable_send: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
94immovable_send: OTHER_LDFLAGS += -ldarwintest_utils -lpthread -framework IOKit
cb323159
A
95immovable_send: immovable_send_client
96
c3c9b80d
A
97immovable_send_client: immovable_send_client.c
98 $(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) immovable_send_client.c -o $(SYMROOT)/immovable_send_client
99
100install-immovable_send_client: immovable_send_client
101 mkdir -p $(INSTALLDIR)
102 cp $(SYMROOT)/immovable_send_client $(INSTALLDIR)/
103
f427ee49
A
104vm_spawn_tool: INVALID_ARCHS = i386
105vm_spawn_tool: vm_spawn_tool.c
106 $(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) vm_spawn_tool.c -o $(SYMROOT)/vm_spawn_tool
107
108install-vm_spawn_tool: vm_spawn_tool
109 mkdir -p $(INSTALLDIR)/tools
110 cp $(SYMROOT)/vm_spawn_tool $(INSTALLDIR)/tools/
111
c3c9b80d 112CUSTOM_TARGETS += imm_pinned_control_port_crasher
cb323159 113
c3c9b80d
A
114imm_pinned_control_port: excserver
115imm_pinned_control_port: CODE_SIGN_ENTITLEMENTS = task_for_pid_entitlement.plist
116imm_pinned_control_port: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
117imm_pinned_control_port: OTHER_LDFLAGS += -ldarwintest_utils -lpthread
118imm_pinned_control_port: imm_pinned_control_port_crasher
cb323159 119
c3c9b80d
A
120imm_pinned_control_port_crasher: imm_pinned_control_port_crasher.c
121 $(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) imm_pinned_control_port_crasher.c -o $(SYMROOT)/imm_pinned_control_port_crasher
122 $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@
123
124install-imm_pinned_control_port_crasher: imm_pinned_control_port_crasher
f427ee49 125 mkdir -p $(INSTALLDIR)
c3c9b80d 126 cp $(SYMROOT)/imm_pinned_control_port_crasher $(INSTALLDIR)/
f427ee49
A
127
128kas_info: OTHER_LDFLAGS += -framework CoreSymbolication
129kas_info: CODE_SIGN_ENTITLEMENTS = kernel_symbolication_entitlements.plist
130
39037602 131kdebug: INVALID_ARCHS = i386
d9a64523 132kdebug: OTHER_LDFLAGS = -framework ktrace -ldarwintest_utils -framework kperf
c3c9b80d 133kdebug: OTHER_CFLAGS += test_utils.c
39037602 134
c3c9b80d 135EXCLUDED_SOURCES += drop_priv.c kperf_helpers.c xnu_quick_test_helpers.c memorystatus_assertion_helpers.c bpflib.c in_cksum.c test_utils.c
39037602 136
0a7de745 137ifneq ($(PLATFORM),iPhoneOS)
f427ee49 138EXCLUDED_SOURCES += jumbo_va_spaces_28530648.c perf_compressor.c memorystatus_freeze_test.c vm/entitlement_increased_memory_limit.c
813fb2f6
A
139endif
140
a39ff7e2 141perf_compressor: OTHER_LDFLAGS += -ldarwintest_utils
5ba3f43e
A
142perf_compressor: CODE_SIGN_ENTITLEMENTS=./private_entitlement.plist
143
f427ee49 144
cb323159 145memorystatus_freeze_test: CODE_SIGN_ENTITLEMENTS=./task_for_pid_entitlement.plist
d9a64523 146memorystatus_freeze_test: OTHER_LDFLAGS += -ldarwintest_utils
cb323159 147memorystatus_freeze_test: OTHER_CFLAGS += -ldarwintest_utils memorystatus_assertion_helpers.c
d9a64523 148
cb323159
A
149memorystatus_is_assertion: OTHER_LDFLAGS += -ldarwintest_utils
150memorystatus_is_assertion: OTHER_CFLAGS += memorystatus_assertion_helpers.c
151
c3c9b80d
A
152memorystatus_vm_map_fork: OTHER_CFLAGS += test_utils.c
153
cb323159
A
154shared_cache_tests: OTHER_LDFLAGS += -ldarwintest_utils
155
156stackshot_tests: OTHER_CFLAGS += -Wno-objc-messaging-id
f427ee49 157stackshot_tests: OTHER_LDFLAGS += -lkdd -lz -ldarwintest_utils -framework Foundation
5ba3f43e 158
4ba76501
A
159stackshot_accuracy: OTHER_CFLAGS += -ldarwintest_utils -Wno-objc-messaging-id
160stackshot_accuracy: OTHER_LDFLAGS += -lkdd -ldarwintest_utils -framework Foundation
161stackshot_accuracy: INVALID_ARCHS = i386
162
f427ee49
A
163ifeq ($(PLATFORM),MacOSX)
164CUSTOM_TARGETS += stackshot_translated_child
165
166stackshot_translated_child: INVALID_ARCHS = arm64 arm64e
167stackshot_translated_child: stackshot_translated_child.c
168 $(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) stackshot_translated_child.c -o $(SYMROOT)/stackshot_translated_child
169
170install-stackshot_translated_child: stackshot_translated_child
171 mkdir -p $(INSTALLDIR)
172 cp $(SYMROOT)/stackshot_translated_child $(INSTALLDIR)/
173else
174EXCLUDED_SOURCES += stackshot_translated_child.c
175endif
176
177telemetry: OTHER_LDFLAGS = -framework ktrace -framework kperf -framework CoreFoundation
d9a64523 178
5ba3f43e
A
179memorystatus_zone_test: OTHER_CFLAGS += -isystem $(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
180memorystatus_zone_test: OTHER_LDFLAGS += -framework ktrace
181memorystatus_zone_test: OTHER_LDFLAGS += -ldarwintest_utils
182
f427ee49
A
183ifeq ($(PLATFORM),BridgeOS)
184EXCLUDED_SOURCES += dirtiness_tracking.c
185endif
186
187dirtiness_tracking: OTHER_CFLAGS += -Wno-cast-align
188
ea3f0419
A
189kpc: OTHER_LDFLAGS += -framework kperf -framework ktrace
190kpc: INVALID_ARCHS = i386
813fb2f6 191
39037602 192kperf: OTHER_CFLAGS += kperf_helpers.c
5ba3f43e 193kperf: OTHER_LDFLAGS += -framework kperf -framework kperfdata -framework ktrace -ldarwintest_utils
39037602 194
f427ee49
A
195memcmp_zero: OTHER_CFLAGS += ../osfmk/arm64/memcmp_zero.s
196
39037602 197kperf_backtracing: OTHER_CFLAGS += kperf_helpers.c
5ba3f43e 198kperf_backtracing: OTHER_LDFLAGS += -framework kperf -framework kperfdata -framework ktrace
39037602 199kperf_backtracing: OTHER_LDFLAGS += -framework CoreSymbolication
f427ee49 200kperf_backtracing: CODE_SIGN_ENTITLEMENTS = kernel_symbolication_entitlements.plist
39037602 201
c3c9b80d
A
202text_corruption: OTHER_LDFLAGS += -ldarwintest_utils
203CUSTOM_TARGETS += text_corruption_helper
204
205text_corruption_helper:
206 $(CC) $(LDFLAGS) $(CFLAGS) text_corruption_helper.c -lm -o $(SYMROOT)/$@;
207 env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
208
209install-text_corruption_helper:
210 mkdir -p $(INSTALLDIR)
211 cp $(SYMROOT)/text_corruption_helper $(INSTALLDIR)/
212
5ba3f43e
A
213kevent_qos: OTHER_CFLAGS += -Wno-unused-macros
214kevent_qos: OTHER_CFLAGS += -I $(OBJROOT)/
215
39037602
A
216mach_get_times: OTHER_LDFLAGS += -ldarwintest_utils
217
5ba3f43e 218monotonic_core: OTHER_LDFLAGS += -framework ktrace
5ba3f43e 219
d9a64523 220perf_exit: perf_exit_proc
0a7de745 221perf_exit: OTHER_LDFLAGS = -framework ktrace -ldarwintest_utils
5ba3f43e
A
222perf_exit: CODE_SIGN_ENTITLEMENTS=./private_entitlement.plist
223
cb323159
A
224CUSTOM_TARGETS += prioritize_process_launch_helper
225prioritize_process_launch: prioritize_process_launch_helper
226
227prioritize_process_launch_helper: prioritize_process_launch_helper.c
228 $(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) prioritize_process_launch_helper.c -o $(SYMROOT)/prioritize_process_launch_helper
229 echo $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@; \
230 env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
231
232install-prioritize_process_launch_helper: prioritize_process_launch_helper
233 mkdir -p $(INSTALLDIR)
234 cp $(SYMROOT)/prioritize_process_launch_helper $(INSTALLDIR)/
235
236
5ba3f43e
A
237perf_spawn_fork: CODE_SIGN_ENTITLEMENTS=./private_entitlement.plist
238
cb323159
A
239mach_exception_reply: OTHER_CFLAGS += -Wno-cast-align
240
5ba3f43e
A
241os_thread_self_restrict: os_thread_self_restrict.c os_thread_self_restrict-entitlements.plist
242os_thread_self_restrict: CODE_SIGN_ENTITLEMENTS=os_thread_self_restrict-entitlements.plist
39037602 243
f427ee49
A
244subsystem_root_path: subsystem_root_path.c subsystem_root_path-entitlements.plist
245subsystem_root_path: CODE_SIGN_ENTITLEMENTS=subsystem_root_path-entitlements.plist
cb323159 246
f427ee49
A
247EXCLUDED_SOURCES += $(wildcard bounded_ptr_src/*.cpp)
248bounded_ptr: OTHER_CXXFLAGS += -Werror=implicit-int-conversion -Werror=shorten-64-to-32 -I$(SRCROOT)/../libkern -std=c++17
249bounded_ptr: $(wildcard bounded_ptr_src/*.cpp) bounded_ptr.cpp
cb323159 250
f427ee49
A
251EXCLUDED_SOURCES += bounded_ptr_03.cpp
252bounded_ptr_03: OTHER_CXXFLAGS += -Werror=implicit-int-conversion -Werror=shorten-64-to-32 -I$(SRCROOT)/../libkern -std=c++03
253bounded_ptr_03: bounded_ptr_03.cpp
254
255EXCLUDED_SOURCES += $(wildcard bounded_array_src/*.cpp)
256bounded_array: OTHER_CXXFLAGS += -Werror=implicit-int-conversion -Werror=shorten-64-to-32 -I$(SRCROOT)/../libkern -std=c++17
257bounded_array: $(wildcard bounded_array_src/*.cpp) bounded_array.cpp
cb323159 258
f427ee49
A
259EXCLUDED_SOURCES += $(wildcard bounded_array_ref_src/*.cpp)
260bounded_array_ref: OTHER_CXXFLAGS += -Werror=implicit-int-conversion -Werror=shorten-64-to-32 -I$(SRCROOT)/../libkern -std=c++17
261bounded_array_ref: $(wildcard bounded_array_ref_src/*.cpp) bounded_array_ref.cpp
262
263EXCLUDED_SOURCES += $(wildcard intrusive_shared_ptr_src/*.cpp)
264intrusive_shared_ptr: OTHER_CXXFLAGS += -Werror=implicit-int-conversion -Werror=shorten-64-to-32 -I$(SRCROOT)/../libkern -std=c++17
265intrusive_shared_ptr: $(wildcard intrusive_shared_ptr_src/*.cpp) intrusive_shared_ptr.cpp
266
267EXCLUDED_SOURCES += $(wildcard safe_allocation_src/*.cpp)
268safe_allocation: OTHER_CXXFLAGS += -Werror=implicit-int-conversion -Werror=shorten-64-to-32 -I$(SRCROOT)/../libkern -std=c++17
269safe_allocation: $(wildcard safe_allocation_src/*.cpp) safe_allocation.cpp
270
271EXCLUDED_SOURCES += osptr_compat.cpp
272osptr_98: OTHER_CXXFLAGS += -I$(SRCROOT)/../libkern -std=c++98 -DOSPTR_STD="98"
273osptr_98: osptr_compat.cpp
274 $(CXX) $(DT_CXXFLAGS) $(OTHER_CXXFLAGS) $(CXXFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
275osptr_11: OTHER_CXXFLAGS += -I$(SRCROOT)/../libkern -std=c++11 -DOSPTR_STD="11"
276osptr_11: osptr_compat.cpp
277 $(CXX) $(DT_CXXFLAGS) $(OTHER_CXXFLAGS) $(CXXFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
278osptr_14: OTHER_CXXFLAGS += -I$(SRCROOT)/../libkern -std=c++14 -DOSPTR_STD="14"
279osptr_14: osptr_compat.cpp
280 $(CXX) $(DT_CXXFLAGS) $(OTHER_CXXFLAGS) $(CXXFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
281osptr_17: OTHER_CXXFLAGS += -I$(SRCROOT)/../libkern -std=c++17 -DOSPTR_STD="17"
282osptr_17: osptr_compat.cpp
cb323159
A
283 $(CXX) $(DT_CXXFLAGS) $(OTHER_CXXFLAGS) $(CXXFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
284
f427ee49 285priority_queue: OTHER_CXXFLAGS += -std=c++17
c3c9b80d 286zalloc_buddy: OTHER_CFLAGS += -Wno-format-pedantic
cb323159
A
287
288os_refcnt: OTHER_CFLAGS += -I$(SRCROOT)/../libkern/ -Wno-gcc-compat -Wno-undef -O3 -flto
289
c3c9b80d
A
290kernel_inspection: CODE_SIGN_ENTITLEMENTS = ./task_for_pid_entitlement.plist
291kernel_inspection: OTHER_CFLAGS += -DENTITLED=1
813fb2f6 292
d9a64523
A
293turnstile_multihop: OTHER_CFLAGS += -Wno-unused-macros
294turnstile_multihop: OTHER_CFLAGS += -I $(OBJROOT)/
295
813fb2f6
A
296CUSTOM_TARGETS += perf_exit_proc
297
298perf_exit_proc:
299 $(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) perf_exit_proc.c -o $(SYMROOT)/perf_exit_proc
300
301install-perf_exit_proc: perf_exit_proc
302 mkdir -p $(INSTALLDIR)
303 cp $(SYMROOT)/perf_exit_proc $(INSTALLDIR)/
304
39037602
A
305stackshot_idle_25570396: OTHER_LDFLAGS += -lkdd -framework Foundation
306
813fb2f6 307stackshot_block_owner_14362384: OTHER_LDFLAGS += -framework Foundation -lpthread -lkdd
a39ff7e2
A
308ifeq ($(PLATFORM),MacOSX)
309stackshot_block_owner_14362384: OTHER_LDFLAGS += -lpcre
310endif
311
312all: $(DSTROOT)/usr/local/bin/kcdata
313
d9a64523 314$(DSTROOT)/usr/local/bin/kcdata: $(SRCROOT)/../tools/lldbmacros/kcdata.py
a39ff7e2
A
315 mkdir -p $(dir $@)
316 cp $< $@
317 chmod a+x $@
813fb2f6 318
5ba3f43e 319xnu_quick_test: OTHER_CFLAGS += xnu_quick_test_helpers.c
a39ff7e2 320
d9a64523
A
321CUSTOM_TARGETS += vm_set_max_addr_helper
322
323vm_set_max_addr_helper: vm_set_max_addr_helper.c
324 $(CC) $(OTHER_CFLAGS) $(CFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) vm_set_max_addr_helper.c -o $(SYMROOT)/vm_set_max_addr_helper; \
325 echo $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@; \
326 env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
327
328install-vm_set_max_addr_helper: vm_set_max_addr_helper
329 mkdir -p $(INSTALLDIR)
330 cp $(SYMROOT)/vm_set_max_addr_helper $(INSTALLDIR)/
331
f427ee49
A
332CUSTOM_TARGETS += subsystem_root_path_helper_entitled
333CUSTOM_TARGETS += subsystem_root_path_helper
334
335subsystem_root_path_helper_entitled: subsystem_root_path_helper.c subsystem_root_path-entitlements.plist
336 $(CC) $(OTHER_CFLAGS) $(CFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) subsystem_root_path_helper.c -o $(SYMROOT)/subsystem_root_path_helper_entitled; \
337 echo $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@; \
338 env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements subsystem_root_path-entitlements.plist $(SYMROOT)/$@;
339
340install-subsystem_root_path_helper_entitled: subsystem_root_path_helper_entitled
341 mkdir -p $(INSTALLDIR)
342 cp $(SYMROOT)/subsystem_root_path_helper_entitled $(INSTALLDIR)/
343
344subsystem_root_path_helper: subsystem_root_path_helper.c
345 $(CC) $(OTHER_CFLAGS) $(CFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) subsystem_root_path_helper.c -o $(SYMROOT)/subsystem_root_path_helper; \
346 echo $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@; \
347 env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
348
349install-subsystem_root_path_helper: subsystem_root_path_helper
350 mkdir -p $(INSTALLDIR)
351 cp $(SYMROOT)/subsystem_root_path_helper $(INSTALLDIR)/
352
353CUSTOM_TARGETS += vm_test_code_signing_helper
354
355vm_test_code_signing_helper: vm_test_code_signing_helper.c
356 $(CC) $(OTHER_CFLAGS) $(CFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) vm_test_code_signing_helper.c -o $(SYMROOT)/vm_test_code_signing_helper; \
357 echo $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@; \
358 env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
359
360install-vm_test_code_signing_helper: vm_test_code_signing_helper
361 mkdir -p $(INSTALLDIR)
362 cp $(SYMROOT)/vm_test_code_signing_helper $(INSTALLDIR)/
363
364vm_test_code_signing: OTHER_LDFLAGS += -ldarwintest_utils
365
366INCLUDED_TEST_SOURCE_DIRS += vm
367
368# Revert to legacy vm_test suite until <rdar://problem/56675212> gets solved
369EXCLUDED_SOURCES += vm/vm_allocation.c
370
813fb2f6 371ifeq ($(PLATFORM),iPhoneOS)
f427ee49 372OTHER_TEST_TARGETS += jumbo_va_spaces_28530648_unentitled jumbo_va_spaces_52551256 vm_phys_footprint_legacy vm/entitlement_increased_memory_limit vm/entitlement_increased_memory_limit_unentitled
813fb2f6 373jumbo_va_spaces_28530648: CODE_SIGN_ENTITLEMENTS = jumbo_va_spaces_28530648.entitlements
f427ee49 374jumbo_va_spaces_28530648: OTHER_CFLAGS += -DENTITLED=1 -DTESTNAME=jumbo_va_spaces_28530648
813fb2f6
A
375jumbo_va_spaces_28530648: OTHER_LDFLAGS += -ldarwintest_utils
376
f427ee49
A
377jumbo_va_spaces_52551256: CODE_SIGN_ENTITLEMENTS = jumbo_va_spaces_52551256.entitlements
378jumbo_va_spaces_52551256: OTHER_CFLAGS += -DENTITLED=1 -DTESTNAME=jumbo_va_spaces_52551256
379jumbo_va_spaces_52551256: OTHER_LDFLAGS += -ldarwintest_utils
380jumbo_va_spaces_52551256: jumbo_va_spaces_28530648.c
381 $(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
382 env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements $(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@;
383
813fb2f6 384jumbo_va_spaces_28530648_unentitled: OTHER_LDFLAGS += -ldarwintest_utils
f427ee49 385jumbo_va_spaces_28530648_unentitled: OTHER_CFLAGS += -DTESTNAME=jumbo_va_spaces_28530648_unentitled
813fb2f6
A
386jumbo_va_spaces_28530648_unentitled: jumbo_va_spaces_28530648.c
387 $(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
cb323159 388
f427ee49
A
389vm/entitlement_increased_memory_limit: CODE_SIGN_ENTITLEMENTS = vm/entitlement_increased_memory_limit.entitlements
390vm/entitlement_increased_memory_limit: OTHER_CFLAGS += -DENTITLED=1
391vm/entitlement_increased_memory_limit: OTHER_LDFLAGS += -ldarwintest_utils memorystatus_assertion_helpers.c
392vm/entitlement_increased_memory_limit: vm/entitlement_increased_memory_limit.c
393 $(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
394 env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements $(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@;
395
396vm/entitlement_increased_memory_limit_unentitled: OTHER_LDFLAGS += -ldarwintest_utils memorystatus_assertion_helpers.c
397vm/entitlement_increased_memory_limit_unentitled: vm/entitlement_increased_memory_limit.c
398 $(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
399
cb323159
A
400vm_phys_footprint_legacy: OTHER_LDFLAGS += -framework CoreFoundation -framework IOSurface
401vm_phys_footprint_legacy: OTHER_CFLAGS += -DLEGACY_FOOTPRINT_ENTITLED=1
402vm_phys_footprint_legacy: CODE_SIGN_ENTITLEMENTS=./legacy_footprint.entitlement
403vm_phys_footprint_legacy: vm_phys_footprint.c
404 $(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
405
813fb2f6
A
406endif
407
5ba3f43e
A
408task_info_28439149: CODE_SIGN_ENTITLEMENTS = ./task_for_pid_entitlement.plist
409
c3c9b80d 410read_inspect: CODE_SIGN_ENTITLEMENTS = ./task_for_pid_entitlement.plist
f427ee49 411
a39ff7e2
A
412proc_info: CODE_SIGN_ENTITLEMENTS = ./task_for_pid_entitlement.plist
413proc_info: OTHER_LDFLAGS += -ldarwintest_utils
414
d9a64523
A
415proc_info_list_kthreads: CODE_SIGN_ENTITLEMENTS = ./proc_info_list_kthreads.entitlements
416
cb323159
A
417proc_info_44873309: CODE_SIGN_ENTITLEMENTS = ./proc_info_44873309.entitlements
418
5ba3f43e
A
419disk_mount_conditioner: disk_mount_conditioner*
420disk_mount_conditioner: CODE_SIGN_ENTITLEMENTS=./disk_mount_conditioner-entitlements.plist
421disk_mount_conditioner: OTHER_LDFLAGS += -ldarwintest_utils
422
cb323159 423disk_mount_conditioner: OTHER_TEST_TARGETS += disk_mount_conditioner_unentitled
5ba3f43e
A
424disk_mount_conditioner_unentitled: OTHER_CFLAGS += -DTEST_UNENTITLED
425disk_mount_conditioner_unentitled: OTHER_LDFLAGS += -ldarwintest_utils
426disk_mount_conditioner_unentitled: disk_mount_conditioner.c
427 $(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
428
429work_interval_test: CODE_SIGN_ENTITLEMENTS = work_interval_test.entitlements
430work_interval_test: OTHER_CFLAGS += -DENTITLED=1
431
a39ff7e2
A
432settimeofday_29193041: OTHER_CFLAGS += drop_priv.c
433
5ba3f43e 434settimeofday_29193041_entitled: CODE_SIGN_ENTITLEMENTS = settimeofday_29193041.entitlements
a39ff7e2
A
435settimeofday_29193041_entitled: OTHER_CFLAGS += drop_priv.c
436
5ba3f43e 437thread_group_set_32261625: OTHER_LDFLAGS = -framework ktrace
5ba3f43e
A
438
439task_info: CODE_SIGN_ENTITLEMENTS = task_for_pid_entitlement.plist
c3c9b80d
A
440task_info: OTHER_CFLAGS += test_utils.c
441
442extract_right_soft_fail: CODE_SIGN_ENTITLEMENTS = task_for_pid_entitlement.plist
5ba3f43e 443
f427ee49
A
444ifneq ($(PLATFORM),iPhoneOS)
445 EXCLUDED_SOURCES += task_vm_info_decompressions.c
446endif
cb323159 447
a39ff7e2
A
448socket_bind_35243417: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
449socket_bind_35685803: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
450
d9a64523
A
451net_tuntests: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
452
ea3f0419
A
453net_bridge: OTHER_CFLAGS += bpflib.c in_cksum.c
454net_bridge: OTHER_LDFLAGS += -ldarwintest_utils
455
f427ee49 456CUSTOM_TARGETS += posix_spawn_archpref_helper
94ff46dc 457
f427ee49
A
458posix_spawn_archpref_helper:
459 $(CC) $(LDFLAGS) $(CFLAGS) posix_spawn_archpref_helper.c -o $(SYMROOT)/$@;
94ff46dc
A
460 env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
461
f427ee49 462install-posix_spawn_archpref_helper:
94ff46dc 463 mkdir -p $(INSTALLDIR)
f427ee49 464 cp $(SYMROOT)/posix_spawn_archpref_helper $(INSTALLDIR)/
a39ff7e2 465
d9a64523
A
466MIG:=SDKROOT=$(SDKROOT) $(shell xcrun -sdk "$(TARGETSDK)" -find mig)
467
468CUSTOM_TARGETS += excserver
469
470excserver:
471 $(MIG) $(CFLAGS) \
472 -sheader $(OBJROOT)/excserver.h \
473 -server $(OBJROOT)/excserver.c \
474 -header /dev/null -user /dev/null \
475 excserver.defs
476install-excserver: ;
477
f427ee49
A
478EXCLUDED_SOURCES += exc_helpers.c
479
480
481x18: OTHER_CFLAGS += -Wno-language-extension-token
482
d9a64523
A
483exc_resource_threads: excserver
484exc_resource_threads: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
485
f427ee49 486fp_exception: excserver exc_helpers.c
cb323159
A
487fp_exception: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
488
f427ee49
A
489ptrauth_failure: excserver exc_helpers.c
490ptrauth_failure: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT) -Wno-language-extension-token
491ptrauth_failure: CODESIGN = $(CODESIGN_HARDENED_RUNTIME)
492
493# This test currently relies on pid_hibernate(), which is only available on embedded platforms.
494ifeq ($(PLATFORM),MacOSX)
495EXCLUDED_SOURCES += decompression_failure.c
0a7de745 496else
f427ee49
A
497decompression_failure: excserver exc_helpers.c
498decompression_failure: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
499endif
500
501ifeq ($(findstring x86_64,$(ARCH_CONFIGS)),)
502EXCLUDED_SOURCES += ldt_code32.s ldt.c
503else # target = osx
0a7de745
A
504$(OBJROOT)/ldt_mach_exc_server.c:
505 $(MIG) $(CFLAGS) \
506 -user /dev/null \
507 -server $(OBJROOT)/ldt_mach_exc_server.c \
508 -header $(OBJROOT)/ldt_mach_exc.h \
509 mach_exc.defs
510
f427ee49 511ldt: INVALID_ARCHS = $(ARCH_CONFIGS)
0a7de745 512ldt: $(OBJROOT)/ldt_mach_exc_server.c
f427ee49 513ldt: OTHER_CFLAGS += -arch x86_64 -I $(OBJROOT) $(SRCROOT)/ldt_code32.s -Wl,-pagezero_size,0x1000 -Wno-missing-variable-declarations
cb323159 514ldt: CODE_SIGN_ENTITLEMENTS=ldt_entitlement.plist
0a7de745
A
515endif
516
d26ffc64
A
517ifneq ($(PLATFORM),BridgeOS)
518EXCLUDED_SOURCES += remote_time.c
519else
520remote_time: INVALID_ARCHS = armv7 armv7s arm64_32
521endif
522
0a7de745 523vm_phys_footprint: OTHER_LDFLAGS += -framework CoreFoundation -framework IOSurface
cb323159 524
f427ee49
A
525vm_kern_count_wired_kernelcache: OTHER_CFLAGS += -I$(SDKROOT)/System/Library/Frameworks/Kernel.framework/PrivateHeaders/mach
526
cb323159
A
527debug_control_port_for_pid: CODE_SIGN_ENTITLEMENTS = ./debug_control_port_for_pid_entitlement.plist
528
529prng: OTHER_LDFLAGS += -ldarwintest_utils
0a7de745 530
f427ee49 531preoslog: OTHER_LDFLAGS += -ldarwintest_utils
c3c9b80d 532preoslog: OTHER_CFLAGS += test_utils.c
f427ee49
A
533
534task_policy: CODE_SIGN_ENTITLEMENTS = ./task_policy_entitlement.plist
535
536OTHER_TEST_TARGETS += task_policy_unentitled
537task_policy_unentitled: CODE_SIGN_ENTITLEMENTS = task_for_pid_entitlement.plist
538task_policy_unentitled: OTHER_CFLAGS += -DUNENTITLED
539task_policy_unentitled: task_policy.c
540 $(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
541 $(CODESIGN) --force --sign - --timestamp=none --entitlements $(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@
542
543
544EXCLUDED_SOURCES += get_shared_cache_address.c
545ifeq ($(PLATFORM),iPhoneOS)
546CUSTOM_TARGETS += get_shared_cache_address
547get_shared_cache_address: INVALID_ARCHS = arm64
548get_shared_cache_address: get_shared_cache_address.c
549 $(CC) $(OTHER_CFLAGS) $(CFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/get_shared_cache_address
550
551install-get_shared_cache_address: get_shared_cache_address
552 $(CODESIGN) --force --sign - --timestamp=none --identifier=com.apple.get_shared_cache_address $(SYMROOT)/get_shared_cache_address
553 mkdir -p $(INSTALLDIR)
554 cp $(SYMROOT)/get_shared_cache_address $(INSTALLDIR)/
555endif
556
557ifneq ($(PLATFORM),MacOSX)
558EXCLUDED_SOURCES += hvtest_x86.m hvtest_x86_guest.c hvtest_x86_asm.s
559else
560EXCLUDED_SOURCES += hvtest_x86_guest.c hvtest_x86_asm.s
561hvtest_x86: CODE_SIGN_ENTITLEMENTS = hv_public.entitlements
562hvtest_x86: INVALID_ARCHS += arm64e arm64 i386
563hvtest_x86: OTHER_CFLAGS += hvtest_x86_guest.c hvtest_x86_asm.s -framework Hypervisor -framework Foundation
564endif
565
566OTHER_TEST_TARGETS += io_catalog_send_data vm_memory_share_tests
567
568vm_memory_share_tests: INVALID_ARCHS = i386
569vm_memory_share_tests: CODE_SIGN_ENTITLEMENTS = ./task_for_pid_entitlement.plist
570vm_memory_share_tests: vm_memory_tests_src/main.c vm_memory_tests_src/common.c vm_memory_tests_src/vm_tests.c
571 $(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
572 echo $(CODESIGN) --force --sign - --timestamp=none --entitlements $(SRCROOT)/$(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@;
573 env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements "$(SRCROOT)/$(CODE_SIGN_ENTITLEMENTS)" $(SYMROOT)/$@;
574
575# build the mach server as individual helper which does not use libdarwintest
576CUSTOM_TARGETS += vm_memory_share_tests_server
577vm_memory_share_tests_server: CODE_SIGN_ENTITLEMENTS = ./task_for_pid_entitlement.plist
578vm_memory_share_tests_server: vm_memory_tests_src/server.c vm_memory_tests_src/common.c vm_memory_tests_src/vm_tests.c
579 $(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/vm_memory_share_tests_server
580 echo $(CODESIGN) --force --sign - --timestamp=none --entitlements $(SRCROOT)/$(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@;
581 env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements "$(SRCROOT)/$(CODE_SIGN_ENTITLEMENTS)" $(SYMROOT)/$@;
582
583install-vm_memory_share_tests_server: vm_memory_share_tests_server
584 mkdir -p $(INSTALLDIR)
585 cp $(SYMROOT)/vm_memory_share_tests_server $(INSTALLDIR)/
ea3f0419
A
586
587io_catalog_send_data: INVALID_ARCHS = i386
588io_catalog_send_data: OTHER_CFLAGS += -DTEST_UNENTITLED -framework IOKit -framework CoreFoundation -framework Foundation
f427ee49 589
ea3f0419
A
590io_catalog_send_data: iokit/io_catalog_send_data.m
591 $(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
592
f427ee49
A
593ifeq ($(PLATFORM),MacOSX)
594EXCLUDED_SOURCES += vm/kern_max_task_pmem.c
595endif
596
c3c9b80d
A
597EXCLUDED_SOURCES += benchmark/helpers.c
598
599perf_vmfault: OTHER_CFLAGS += benchmark/helpers.c
f427ee49
A
600
601fault_throughput: vm/fault_throughput.c
602 mkdir -p $(SYMROOT)/vm
603 $(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/vm/$@
c3c9b80d 604fault_throughput: OTHER_CFLAGS += benchmark/helpers.c
f427ee49
A
605
606install-fault_throughput: fault_throughput
607 mkdir -p $(INSTALLDIR)/vm
608 cp $(SYMROOT)/vm/fault_throughput $(INSTALLDIR)/vm/
609
610BATS_PLISTS += $(SRCROOT)/vm/fault_throughput.plist
611
612fault_throughput_benchrun:
613 mkdir -p $(SYMROOT)/vm
614 cp $(SRCROOT)/vm/fault_throughput.lua $(SYMROOT)/vm/fault_throughput.lua
615 chmod +x $(SYMROOT)/vm/fault_throughput.lua
616
617install-fault_throughput_benchrun: fault_throughput_benchrun
618 mkdir -p $(INSTALLDIR)/vm
619 cp $(SYMROOT)/vm/fault_throughput.lua $(INSTALLDIR)/vm
620 chmod +x $(INSTALLDIR)/vm/fault_throughput.lua
621
622CUSTOM_TARGETS += fault_throughput fault_throughput_benchrun
623EXCLUDED_SOURCES += vm/fault_throughput.plist vm/fault_throughput.c
624
625perf_madvise: vm/perf_madvise.c
626 mkdir -p $(SYMROOT)/vm
627 $(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/vm/$@
c3c9b80d 628perf_madvise: OTHER_CFLAGS += benchmark/helpers.c
f427ee49
A
629install-perf_madvise: perf_madvise
630 mkdir -p $(INSTALLDIR)/vm
631 cp $(SYMROOT)/vm/perf_madvise $(INSTALLDIR)/vm/
632perf_madvise_benchrun:
633 mkdir -p $(SYMROOT)/vm
634 cp $(SRCROOT)/vm/perf_madvise.lua $(SYMROOT)/vm/perf_madvise.lua
635 chmod +x $(SYMROOT)/vm/perf_madvise.lua
636install-perf_madvise_benchrun: perf_madvise_benchrun
637 mkdir -p $(INSTALLDIR)/vm
638 cp $(SYMROOT)/vm/perf_madvise.lua $(INSTALLDIR)/vm
639 chmod +x $(INSTALLDIR)/vm/perf_madvise.lua
640
641CUSTOM_TARGETS += perf_madvise perf_madvise_benchrun
642EXCLUDED_SOURCES += vm/perf_madvise.c
643
ea3f0419
A
644task_create_suid_cred: CODE_SIGN_ENTITLEMENTS = ./task_create_suid_cred_entitlement.plist
645
646OTHER_TEST_TARGETS += task_create_suid_cred_unentitled
647task_create_suid_cred_unentitled: OTHER_CFLAGS += -DUNENTITLED
648task_create_suid_cred_unentitled: task_create_suid_cred.c
649 $(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
650
f427ee49
A
651ioconnectasyncmethod_57641955: OTHER_LDFLAGS += -framework IOKit
652
653ifeq ($(PLATFORM),BridgeOS)
654EXCLUDED_SOURCES += ipsec.m
655else
656ipsec: OTHER_LDFLAGS += -framework Foundation -framework CoreFoundation -framework NetworkExtension
657ipsec: CODE_SIGN_ENTITLEMENTS = ipsec.entitlements
658endif
659
660test_sysctl_kern_procargs_25397314: OTHER_LDFLAGS += -framework Foundation -ldarwintest_utils
661
c3c9b80d
A
662INCLUDED_TEST_SOURCE_DIRS += counter
663
664EXCLUDED_SOURCES += counter/common.c
665counter/counter: OTHER_CFLAGS += counter/common.c test_utils.c
666counter/counter: OTHER_LDFLAGS += -ldarwintest_utils -ldarwintest
667
668counter/benchmark: counter/benchmark.c
669 mkdir -p $(SYMROOT)/counter
670 $(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
671 env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
672
673counter/benchmark: OTHER_CFLAGS += counter/common.c benchmark/helpers.c
674
675install-counter/benchmark: counter/benchmark
676 mkdir -p $(INSTALLDIR)/counter
677 cp $(SYMROOT)/counter/benchmark $(INSTALLDIR)/counter/
678
679counter/benchmark_benchrun:
680 mkdir -p $(SYMROOT)/counter
681 cp $(SRCROOT)/counter/benchmark.lua $(SYMROOT)/counter/benchmark.lua
682 chmod +x $(SYMROOT)/counter/benchmark.lua
683
684install-counter/benchmark_benchrun: counter/benchmark_benchrun
685 mkdir -p $(INSTALLDIR)/counter
686 cp $(SYMROOT)/counter/benchmark.lua $(INSTALLDIR)/counter/
687 chmod +x $(INSTALLDIR)/counter/benchmark.lua
688
689CUSTOM_TARGETS += counter/benchmark counter/benchmark_benchrun
690EXCLUDED_SOURCES += counter/benchmark.c
691
692ifneq ($(PLATFORM),MacOSX)
693EXCLUDED_SOURCES += vm/page_size_globals.c
694else
695vm/page_size_globals: INVALID_ARCHS = arm64 arm64e
696endif
697
698INCLUDED_TEST_SOURCE_DIRS += lockf_uaf_poc
699
39037602 700include $(DEVELOPER_DIR)/AppleInternal/Makefiles/darwintest/Makefile.targets
c3c9b80d
A
701
702trial_experiments: CODE_SIGN_ENTITLEMENTS = trial_experiments.entitlements
703trial_experiments: OTHER_CFLAGS += -DENTITLED=1 test_utils.c drop_priv.c
704trial_experiments: trial_experiments.c
705 $(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
706 env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements $(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@;
707
708trial_experiments_unentitled: OTHER_CFLAGS += drop_priv.c test_utils.c
709trial_experiments_unentitled: trial_experiments.c
710 $(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@