xref: /xnu-11417.140.69/tests/Makefile (revision 43a90889846e00bfb5cf1d255cdc0a701a1e05a4)
1*43a90889SApple OSS DistributionsPROJECT := xnu/darwintests
2*43a90889SApple OSS Distributions
3*43a90889SApple OSS Distributionsinclude disabled.mk
4*43a90889SApple OSS Distributions
5*43a90889SApple OSS Distributions# When building as part of xnu_tests, we get passed a DSTROOT that's got the
6*43a90889SApple OSS Distributions# unit test path in it already.  But, BASEDSTROOT doesn't, so use that instead.
7*43a90889SApple OSS Distributionsifdef BASEDSTROOT
8*43a90889SApple OSS Distributionsoverride DSTROOT = $(BASEDSTROOT)
9*43a90889SApple OSS Distributionsendif
10*43a90889SApple OSS Distributions
11*43a90889SApple OSS DistributionsINVALID_ARCHS = i386 $(filter armv7%,$(ARCH_CONFIGS))
12*43a90889SApple OSS DistributionsENABLE_LTE_TESTS=YES
13*43a90889SApple OSS Distributions
14*43a90889SApple OSS DistributionsOTHER_LTE_INCLUDE_FILES += \
15*43a90889SApple OSS Distributions	/System/Library/PrivateFrameworks/LoggingSupport.framework, \
16*43a90889SApple OSS Distributions	/System/Library/PrivateFrameworks/MobileKeyBag.framework, \
17*43a90889SApple OSS Distributions	/System/Library/Frameworks/IOSurface.framework, \
18*43a90889SApple OSS Distributions	/usr/local/lib/libdarwintest_utils.dylib, \
19*43a90889SApple OSS Distributions	/usr/lib/libapple_crypto.dylib,
20*43a90889SApple OSS Distributions
21*43a90889SApple OSS DistributionsENV = /usr/bin/env
22*43a90889SApple OSS Distributions
23*43a90889SApple OSS DistributionsDEVELOPER_DIR ?= $(shell xcode-select -p)
24*43a90889SApple OSS Distributions
25*43a90889SApple OSS Distributions
26*43a90889SApple OSS Distributionsifeq ($(origin TIGHTBEAM_MODULE_DIR),undefined)
27*43a90889SApple OSS Distributions	export TIGHTBEAM_MODULE_DIR := $(shell /usr/bin/xcrun --show-sdk-path -sdk $(SDKROOT))/usr/local/lib/kernel/tightbeam
28*43a90889SApple OSS Distributionsendif
29*43a90889SApple OSS Distributions
30*43a90889SApple OSS DistributionsUSE_WERROR := 1
31*43a90889SApple OSS Distributionsifneq ($(BUILD_WERROR),)
32*43a90889SApple OSS DistributionsUSE_WERROR := $(BUILD_WERROR)
33*43a90889SApple OSS Distributionsendif
34*43a90889SApple OSS Distributions
35*43a90889SApple OSS Distributionsifeq ($(USE_WERROR),1)
36*43a90889SApple OSS DistributionsWERROR := -Werror
37*43a90889SApple OSS Distributionsendif
38*43a90889SApple OSS Distributions
39*43a90889SApple OSS Distributions# the xnu build system will only ever call us with the default target
40*43a90889SApple OSS Distributions.DEFAULT_GOAL := install
41*43a90889SApple OSS Distributions
42*43a90889SApple OSS Distributionsinclude $(DEVELOPER_DIR)/AppleInternal/Makefiles/darwintest/Makefile.common
43*43a90889SApple OSS Distributions
44*43a90889SApple OSS DistributionsOTHER_CFLAGS  = -Wall
45*43a90889SApple OSS DistributionsOTHER_CFLAGS += -Wno-deprecated-declarations
46*43a90889SApple OSS DistributionsOTHER_CFLAGS += -Wno-c2x-extensions
47*43a90889SApple OSS DistributionsOTHER_CFLAGS += --std=gnu17 -isystem $(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
48*43a90889SApple OSS DistributionsOTHER_CFLAGS += -UT_NAMESPACE_PREFIX -DT_NAMESPACE_PREFIX=xnu -DT_LEAKS_DISABLE=1
49*43a90889SApple OSS DistributionsOTHER_CFLAGS += -F $(SDKROOT)/System/Library/PrivateFrameworks
50*43a90889SApple OSS Distributions
51*43a90889SApple OSS Distributions
52*43a90889SApple OSS DistributionsCODESIGN:=$(shell xcrun -sdk "$(TARGETSDK)" -find codesign)
53*43a90889SApple OSS DistributionsCODESIGN_HARDENED_RUNTIME:=$(CODESIGN) -o runtime
54*43a90889SApple OSS DistributionsCODESIGN_ALLOCATE:=$(shell xcrun -sdk "$(TARGETSDK)" -find codesign_allocate)
55*43a90889SApple OSS Distributions
56*43a90889SApple OSS DistributionsLIPO:=$(shell xcrun -sdk "$(TARGETSDK)" -find lipo)
57*43a90889SApple OSS Distributions
58*43a90889SApple OSS Distributionsifeq ($(PLATFORM),iPhoneOS)
59*43a90889SApple OSS Distributions  IOS_TEST_COMPAT = YES
60*43a90889SApple OSS Distributionselse
61*43a90889SApple OSS Distributions  IOS_TEST_COMPAT = NO
62*43a90889SApple OSS Distributionsendif
63*43a90889SApple OSS Distributions
64*43a90889SApple OSS Distributions# Generate tightbeam header for ExclavesCHelloServer from tbmodule in the SDK
65*43a90889SApple OSS Distributionsifneq ($(wildcard $(SDKROOT)/System/Library/PrivateFrameworks/Tightbeam.framework/Headers/tightbeam.h),)
66*43a90889SApple OSS DistributionsTIGHTBEAM_MODULES := \
67*43a90889SApple OSS Distributions	ExclavesCHelloServer.tbmodule
68*43a90889SApple OSS Distributions
69*43a90889SApple OSS DistributionsTIGHTBEAM_MODULE_HEADERS := $(patsubst %.tbmodule,%.tightbeam.h,$(TIGHTBEAM_MODULES))
70*43a90889SApple OSS DistributionsTIGHTBEAM_MODULE_IMPL := $(patsubst %.tbmodule,%.tightbeam.c,$(TIGHTBEAM_MODULES))
71*43a90889SApple OSS Distributions
72*43a90889SApple OSS Distributions# This makes sure to not include any tbmodules which don't exist in the SDK and
73*43a90889SApple OSS Distributions# expand the modules listed above to their full path in the SDK. The modules
74*43a90889SApple OSS Distributions# should only be needed when actually building with CONFIG_EXCLAVES
75*43a90889SApple OSS Distributions# (which can't easily be checked here).
76*43a90889SApple OSS DistributionsTIGHTBEAM_MODULES := $(patsubst %.tbmodule,$(TIGHTBEAM_MODULE_DIR)/%.tbmodule,$(TIGHTBEAM_MODULES))
77*43a90889SApple OSS DistributionsTIGHTBEAM_MODULES := $(wildcard $(TIGHTBEAM_MODULES))
78*43a90889SApple OSS DistributionsTIGHTBEAM_MODULE_IMPL_PATH := $(addprefix $(OBJROOT)/, $(TIGHTBEAM_MODULE_IMPL))
79*43a90889SApple OSS Distributions
80*43a90889SApple OSS Distributions$(TIGHTBEAM_MODULE_IMPL) : \
81*43a90889SApple OSS Distributions	%.tightbeam.c : $(TIGHTBEAM_MODULES)
82*43a90889SApple OSS Distributions	$(TIGHTBEAMC) build generate-c --output-base $(OBJROOT)/$*.tightbeam.c --codegen-version 2 $<
83*43a90889SApple OSS Distributions
84*43a90889SApple OSS Distributions$(TIGHTBEAM_MODULE_HEADERS) : $(TIGHTBEAM_MODULE_IMPL)
85*43a90889SApple OSS Distributionsendif
86*43a90889SApple OSS Distributions
87*43a90889SApple OSS Distributions# Subsystems
88*43a90889SApple OSS Distributions
89*43a90889SApple OSS Distributionsinclude ktrace/Makefile
90*43a90889SApple OSS Distributions
91*43a90889SApple OSS DistributionsINCLUDED_TEST_SOURCE_DIRS += recount
92*43a90889SApple OSS Distributionsinclude recount/Makefile
93*43a90889SApple OSS DistributionsINCLUDED_TEST_SOURCE_DIRS += cpu_counters
94*43a90889SApple OSS Distributionsinclude cpu_counters/Makefile
95*43a90889SApple OSS Distributions
96*43a90889SApple OSS DistributionsINCLUDED_TEST_SOURCE_DIRS += sched
97*43a90889SApple OSS Distributionsinclude sched/Makefile
98*43a90889SApple OSS Distributions
99*43a90889SApple OSS Distributions# Miscellaneous Tests
100*43a90889SApple OSS Distributions
101*43a90889SApple OSS Distributionssignal_exit_reason: CODE_SIGN_ENTITLEMENTS = signal_exit_reason.entitlements
102*43a90889SApple OSS Distributions
103*43a90889SApple OSS Distributionsatm_diagnostic_flag: OTHER_CFLAGS += drop_priv.c
104*43a90889SApple OSS Distributions
105*43a90889SApple OSS Distributionsatm_diagnostic_flag_entitled: CODE_SIGN_ENTITLEMENTS = atm_diagnostic_flag.entitlements
106*43a90889SApple OSS Distributionsatm_diagnostic_flag_entitled: OTHER_CFLAGS += drop_priv.c
107*43a90889SApple OSS Distributions
108*43a90889SApple OSS Distributionsavx: INVALID_ARCHS = $(filter arm%,$(ARCH_CONFIGS))
109*43a90889SApple OSS Distributionsavx: OTHER_CFLAGS += -mavx512f -mavx512bw -mavx512vl
110*43a90889SApple OSS Distributionsavx: OTHER_CFLAGS += -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
111*43a90889SApple OSS Distributionsavx: CONFIG_FLAGS := $(filter-out -O%,$(CONFIG_FLAGS))
112*43a90889SApple OSS Distributions# Add -mno-implicit-float to prevent the compiler from touching SIMD regs
113*43a90889SApple OSS Distributions# unexpectedly
114*43a90889SApple OSS Distributionsavx: CONFIG_FLAGS += -mno-implicit-float
115*43a90889SApple OSS Distributions# Disable vzeroupper insertion to work around rdar://problem/35035096
116*43a90889SApple OSS Distributionsavx: CONFIG_FLAGS += -mllvm -x86-use-vzeroupper=0
117*43a90889SApple OSS Distributionsifneq (osx,$(TARGET_NAME))
118*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += avx.c
119*43a90889SApple OSS Distributionsendif
120*43a90889SApple OSS Distributions
121*43a90889SApple OSS DistributionsCUSTOM_TARGETS = sr_entitlement_helper
122*43a90889SApple OSS Distributions
123*43a90889SApple OSS Distributionssr_entitlement_helper: sr_entitlement_helper.c
124*43a90889SApple OSS Distributions	mkdir -p $(SYMROOT)
125*43a90889SApple OSS Distributions	$(CC) -I $(OBJROOT) $(CFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) sr_entitlement_helper.c -o $(SYMROOT)/$@
126*43a90889SApple OSS Distributions	echo $(CODESIGN) --force --sign - --timestamp=none --entitlements sr_entitlement.entitlements $(SYMROOT)/$@; \
127*43a90889SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements sr_entitlement.entitlements $(SYMROOT)/$@;
128*43a90889SApple OSS Distributions
129*43a90889SApple OSS Distributionsinstall-sr_entitlement_helper: sr_entitlement_helper
130*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
131*43a90889SApple OSS Distributions	cp $(SYMROOT)/sr_entitlement_helper $(INSTALLDIR)
132*43a90889SApple OSS Distributions
133*43a90889SApple OSS Distributionssr_entitlement: OTHER_LDFLAGS += -ldarwintest_utils
134*43a90889SApple OSS Distributions
135*43a90889SApple OSS Distributionsrestrict_jit: CODE_SIGN_ENTITLEMENTS = restrict_jit.entitlements
136*43a90889SApple OSS Distributions
137*43a90889SApple OSS Distributionsbacktracing_tests: OTHER_LDFLAGS += -framework CoreSymbolication
138*43a90889SApple OSS Distributionsbacktracing_tests: CODE_SIGN_ENTITLEMENTS = kernel_symbolication_entitlements.plist
139*43a90889SApple OSS Distributions
140*43a90889SApple OSS DistributionsCUSTOM_TARGETS += corpse_backtrace2
141*43a90889SApple OSS Distributions
142*43a90889SApple OSS Distributionscorpse_backtrace2:
143*43a90889SApple OSS Distributions		$(MIG) $(CFLAGS) \
144*43a90889SApple OSS Distributions		-DMACH_EXC_SERVER_TASKIDTOKEN \
145*43a90889SApple OSS Distributions		-DMACH_EXC_SERVER_BACKTRACE \
146*43a90889SApple OSS Distributions		-sheader $(OBJROOT)/excserver_backtrace.h \
147*43a90889SApple OSS Distributions		-server $(OBJROOT)/excserver_backtrace.c \
148*43a90889SApple OSS Distributions		-header /dev/null -user /dev/null \
149*43a90889SApple OSS Distributions		excserver_backtrace.defs
150*43a90889SApple OSS Distributions
151*43a90889SApple OSS Distributionsinstall-corpse_backtrace2: ;
152*43a90889SApple OSS Distributions
153*43a90889SApple OSS Distributionscorpse_backtrace: corpse_backtrace2 exc_helpers.c
154*43a90889SApple OSS Distributionscorpse_backtrace: OTHER_CFLAGS += $(OBJROOT)/excserver_backtrace.c
155*43a90889SApple OSS Distributionscorpse_backtrace: OTHER_CFLAGS += -I $(OBJROOT)
156*43a90889SApple OSS Distributionscorpse_backtrace: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
157*43a90889SApple OSS Distributions
158*43a90889SApple OSS Distributionsvm/corpse_owned_vmobjects: excserver_protect_state
159*43a90889SApple OSS Distributionsvm/corpse_owned_vmobjects: OTHER_CFLAGS += $(OBJROOT)/excserver_protect_state.c -I $(OBJROOT)
160*43a90889SApple OSS Distributionsvm/corpse_owned_vmobjects: CODE_SIGN_ENTITLEMENTS += vm/corpse_owned_vmobjects.entitlements
161*43a90889SApple OSS Distributions
162*43a90889SApple OSS DistributionsOTHER_TEST_TARGETS += vm/vm_parameter_validation
163*43a90889SApple OSS Distributions
164*43a90889SApple OSS Distributions# vm_parameter_validation builds each arch as a separate build command
165*43a90889SApple OSS Distributions# so we can pass architecture-specific linker flags.
166*43a90889SApple OSS Distributions# and generate arch-specific MIG files.
167*43a90889SApple OSS Distributions
168*43a90889SApple OSS Distributions# libdarwintest.a doesn't have an arm64 slice on watchOS
169*43a90889SApple OSS Distributionsifeq ($(PLATFORM),WatchOS)
170*43a90889SApple OSS DistributionsVM_PARAMETER_VALIDATION_INVALID_ARCHS = arm64
171*43a90889SApple OSS Distributionsvm/vm_parameter_validation: INVALID_ARCHS += arm64
172*43a90889SApple OSS Distributionsendif
173*43a90889SApple OSS Distributions
174*43a90889SApple OSS DistributionsVM_PARAMETER_VALIDATION_ARCHS = $(filter-out $(VM_PARAMETER_VALIDATION_INVALID_ARCHS),$(ARCH_CONFIGS))
175*43a90889SApple OSS Distributions
176*43a90889SApple OSS Distributions# Some tests map-overwrite wildly at addresses near 0.
177*43a90889SApple OSS Distributions# Use a large PAGEZERO so our executable and other data do not land there.
178*43a90889SApple OSS Distributions# (This is 32-bit only. 64-bit uses 4GB PAGEZERO by default which is fine.)
179*43a90889SApple OSS DistributionsVM_PARAMETER_VALIDATION_LDFLAGS_i386     = -Xlinker -pagezero_size -Xlinker 0x1000000
180*43a90889SApple OSS DistributionsVM_PARAMETER_VALIDATION_LDFLAGS_armv7    = -Xlinker -pagezero_size -Xlinker 0x1000000
181*43a90889SApple OSS DistributionsVM_PARAMETER_VALIDATION_LDFLAGS_armv7s   = -Xlinker -pagezero_size -Xlinker 0x1000000
182*43a90889SApple OSS DistributionsVM_PARAMETER_VALIDATION_LDFLAGS_armv7k   = -Xlinker -pagezero_size -Xlinker 0x1000000
183*43a90889SApple OSS DistributionsVM_PARAMETER_VALIDATION_LDFLAGS_arm64_32 = -Xlinker -pagezero_size -Xlinker 0x1000000
184*43a90889SApple OSS Distributions
185*43a90889SApple OSS DistributionsVM_PARAMETER_VALIDATION_SLICES=$(addprefix $(SYMROOT)/vm/vm_parameter_validation_,$(VM_PARAMETER_VALIDATION_ARCHS))
186*43a90889SApple OSS Distributions
187*43a90889SApple OSS Distributionsvm/vm_parameter_validation: assets $(VM_PARAMETER_VALIDATION_SLICES)
188*43a90889SApple OSS Distributions	$(LIPO) -create $(VM_PARAMETER_VALIDATION_SLICES) -output $(SYMROOT)/$@
189*43a90889SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@
190*43a90889SApple OSS Distributions
191*43a90889SApple OSS Distributions$(SYMROOT)/vm/vm_parameter_validation_%: ../osfmk/tests/vm_parameter_validation.h \
192*43a90889SApple OSS Distributions                                         $(OBJROOT)/vm_parameter_validation_%_vm32_map_user.c \
193*43a90889SApple OSS Distributions                                         $(OBJROOT)/vm_parameter_validation_%_mach_vm_user.c \
194*43a90889SApple OSS Distributions                                         $(OBJROOT)/vm_parameter_validation_%_replacement_mach_host.c \
195*43a90889SApple OSS Distributions                                         $(OBJROOT)/vm_parameter_validation_%_replacement_host_priv.c \
196*43a90889SApple OSS Distributions                                         vm/vm_parameter_validation.c
197*43a90889SApple OSS Distributions	mkdir -p $(SYMROOT)/vm
198*43a90889SApple OSS Distributions	$(CC) -I $(OBJROOT) \
199*43a90889SApple OSS Distributions	    $(DT_CFLAGS) $(OTHER_CFLAGS) $(filter-out $(ARCH_FLAGS),$(CFLAGS)) -arch $* \
200*43a90889SApple OSS Distributions	    $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $(VM_PARAMETER_VALIDATION_LDFLAGS_$*) \
201*43a90889SApple OSS Distributions	    -DVM32_SUPPORT=1 -DKERNEL_VM_TEST=1 \
202*43a90889SApple OSS Distributions	    $(OBJROOT)/vm_parameter_validation_$*_vm32_map_user.c \
203*43a90889SApple OSS Distributions	    $(OBJROOT)/vm_parameter_validation_$*_mach_vm_user.c \
204*43a90889SApple OSS Distributions	    $(OBJROOT)/vm_parameter_validation_$*_replacement_mach_host.c \
205*43a90889SApple OSS Distributions	    $(OBJROOT)/vm_parameter_validation_$*_replacement_host_priv.c \
206*43a90889SApple OSS Distributions	    vm/vm_parameter_validation.c -o $@
207*43a90889SApple OSS Distributions
208*43a90889SApple OSS Distributions# xnu/libsyscall/mach/mach_vm.c intercepts some VM calls from userspace,
209*43a90889SApple OSS Distributions# sometimes doing something other than the expected MIG call.
210*43a90889SApple OSS Distributions# And on 64-bit platforms libsystem has no interface to reach the 32-bit entrypoints.
211*43a90889SApple OSS Distributions# We generate our own MIG userspace call sites to call the kernel entrypoints directly.
212*43a90889SApple OSS Distributions$(OBJROOT)/vm_parameter_validation_%_vm32_map_user.c: ../osfmk/mach/vm32_map.defs
213*43a90889SApple OSS Distributions	$(MIG) $(filter-out $(ARCH_FLAGS),$(CFLAGS)) -arch $* \
214*43a90889SApple OSS Distributions	 -I../osfmk -novouchers -DKERNEL_USER=1 -DKOBJECT_SERVER -DKERNEL_VM_TEST=1 \
215*43a90889SApple OSS Distributions	 -user $@ -header $(subst _$*_,_,$(@:.c=.h)) \
216*43a90889SApple OSS Distributions	 -server /dev/null -sheader /dev/null \
217*43a90889SApple OSS Distributions	 $<
218*43a90889SApple OSS Distributions$(OBJROOT)/vm_parameter_validation_%_mach_vm_user.c: ../osfmk/mach/mach_vm.defs
219*43a90889SApple OSS Distributions	$(MIG) $(filter-out $(ARCH_FLAGS),$(CFLAGS)) -arch $* \
220*43a90889SApple OSS Distributions	 -I../osfmk -novouchers -DKERNEL_USER=1 -DKOBJECT_SERVER -DKERNEL_VM_TEST=1 \
221*43a90889SApple OSS Distributions	 -user $@ -header $(subst _$*_,_,$(@:.c=.h)) \
222*43a90889SApple OSS Distributions	 -server /dev/null -sheader /dev/null \
223*43a90889SApple OSS Distributions	 $<
224*43a90889SApple OSS Distributions# The declaration of mach_memory_object_memory_entry is buggy on U32.
225*43a90889SApple OSS Distributions# We compile in our own MIG user stub for it with a "replacement_" prefix.
226*43a90889SApple OSS Distributions# rdar://117927965
227*43a90889SApple OSS Distributions$(OBJROOT)/vm_parameter_validation_%_replacement_mach_host.c: vm/vm_parameter_validation_replacement_mach_host.defs
228*43a90889SApple OSS Distributions	$(MIG) $(filter-out $(ARCH_FLAGS),$(CFLAGS)) -arch $* \
229*43a90889SApple OSS Distributions	 -I../osfmk -novouchers -DKERNEL_USER=1 -DKOBJECT_SERVER -DKERNEL_VM_TEST=1 \
230*43a90889SApple OSS Distributions	 -user $@ -header $(subst _$*_,_,$(@:.c=.h)) \
231*43a90889SApple OSS Distributions	 -server /dev/null -sheader /dev/null \
232*43a90889SApple OSS Distributions	 $<
233*43a90889SApple OSS Distributions# The declaration of vm_wire is buggy on U32.
234*43a90889SApple OSS Distributions# We compile in our own MIG user stub for it with a "replacement_" prefix.
235*43a90889SApple OSS Distributions# rdar://118258929
236*43a90889SApple OSS Distributions$(OBJROOT)/vm_parameter_validation_%_replacement_host_priv.c: vm/vm_parameter_validation_replacement_host_priv.defs
237*43a90889SApple OSS Distributions	$(MIG) $(filter-out $(ARCH_FLAGS),$(CFLAGS)) -arch $* \
238*43a90889SApple OSS Distributions	 -I../osfmk -novouchers -DKERNEL_USER=1 -DKOBJECT_SERVER -DKERNEL_VM_TEST=1 \
239*43a90889SApple OSS Distributions	 -user $@ -header $(subst _$*_,_,$(@:.c=.h)) \
240*43a90889SApple OSS Distributions	 -server /dev/null -sheader /dev/null \
241*43a90889SApple OSS Distributions	 $<
242*43a90889SApple OSS Distributions
243*43a90889SApple OSS Distributions
244*43a90889SApple OSS DistributionsCUSTOM_TARGETS += immovable_send_client vm_spawn_tool port_exhaustion_client port_table_limits_client fd_table_limits_client posix_spawnattr_set_crash_behavior_np_child kqworkloop_limits_client
245*43a90889SApple OSS DistributionsCUSTOM_TARGETS += ipc/hardened_exceptions_entitled_debugger ipc/hardened_exceptions_entitled
246*43a90889SApple OSS DistributionsCUSTOM_TARGETS += excserver_protect
247*43a90889SApple OSS DistributionsCUSTOM_TARGETS += excserver_protect_state
248*43a90889SApple OSS Distributions
249*43a90889SApple OSS Distributionsexception_tests: excserver_protect exc_helpers.c
250*43a90889SApple OSS Distributionsexception_tests: CODE_SIGN_ENTITLEMENTS = exception_tests.entitlements
251*43a90889SApple OSS Distributionsexception_tests: OTHER_CFLAGS += $(OBJROOT)/excserver_protect.c
252*43a90889SApple OSS Distributionsexception_tests: OTHER_CFLAGS += -I $(OBJROOT)
253*43a90889SApple OSS Distributionsexception_tests: OTHER_CFLAGS += -DENTITLED=1
254*43a90889SApple OSS Distributions
255*43a90889SApple OSS Distributionsipc/hardened_exceptions: excserver_protect_state exc_helpers.c
256*43a90889SApple OSS Distributionsipc/hardened_exceptions: ipc/hardened_exceptions_entitled ipc/hardened_exceptions_entitled_debugger
257*43a90889SApple OSS Distributionsipc/hardened_exceptions: OTHER_CFLAGS += $(OBJROOT)/excserver_protect_state.c -I $(OBJROOT)
258*43a90889SApple OSS Distributions
259*43a90889SApple OSS Distributionsipc/hardened_exceptions_entitled: excserver_protect_state
260*43a90889SApple OSS Distributionsipc/hardened_exceptions_entitled: CODE_SIGN_ENTITLEMENTS = entitlements/only_one_exception_port.entitlement
261*43a90889SApple OSS Distributionsipc/hardened_exceptions_entitled: OTHER_CFLAGS += -I $(OBJROOT)
262*43a90889SApple OSS Distributionsipc/hardened_exceptions_entitled: exc_helpers.c ipc/hardened_exceptions.c
263*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(OTHER_CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \
264*43a90889SApple OSS Distributions	$(filter-out $(CUSTOM_TARGETS), $^) -o $(SYMROOT)/$@
265*43a90889SApple OSS Distributions	$(CODESIGN) --force --sign - --entitlements $(CODE_SIGN_ENTITLEMENTS) --timestamp=none $(SYMROOT)/$@
266*43a90889SApple OSS Distributions
267*43a90889SApple OSS Distributionsipc/hardened_exceptions_entitled_debugger: excserver_protect_state
268*43a90889SApple OSS Distributionsipc/hardened_exceptions_entitled_debugger: CODE_SIGN_ENTITLEMENTS = entitlements/only_one_exception_port_debugger.entitlement
269*43a90889SApple OSS Distributionsipc/hardened_exceptions_entitled_debugger: OTHER_CFLAGS += -I $(OBJROOT)
270*43a90889SApple OSS Distributionsipc/hardened_exceptions_entitled_debugger: exc_helpers.c ipc/hardened_exceptions.c
271*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(OTHER_CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \
272*43a90889SApple OSS Distributions	$(filter-out $(CUSTOM_TARGETS), $^) -o $(SYMROOT)/$@
273*43a90889SApple OSS Distributions	$(CODESIGN) --force --sign -  --entitlements $(CODE_SIGN_ENTITLEMENTS) --timestamp=none $(SYMROOT)/$@
274*43a90889SApple OSS Distributions
275*43a90889SApple OSS Distributionsinstall-ipc/hardened_exceptions_entitled_debugger: ipc/hardened_exceptions_entitled_debugger
276*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
277*43a90889SApple OSS Distributions	cp $(SYMROOT)/$< $(INSTALLDIR)/
278*43a90889SApple OSS Distributions
279*43a90889SApple OSS Distributionsinstall-ipc/hardened_exceptions_entitled: ipc/hardened_exceptions_entitled
280*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
281*43a90889SApple OSS Distributions	cp $(SYMROOT)/$< $(INSTALLDIR)/
282*43a90889SApple OSS Distributions
283*43a90889SApple OSS Distributionsinstall-reply_port_defense_client: reply_port_defense_client
284*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
285*43a90889SApple OSS Distributions	cp $(SYMROOT)/$< $(INSTALLDIR)/
286*43a90889SApple OSS Distributions
287*43a90889SApple OSS Distributionsimmovable_send: excserver
288*43a90889SApple OSS Distributionsimmovable_send: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
289*43a90889SApple OSS Distributionsimmovable_send: OTHER_LDFLAGS += -ldarwintest_utils -lpthread -framework IOKit
290*43a90889SApple OSS Distributionsimmovable_send: immovable_send_client
291*43a90889SApple OSS Distributionsimmovable_send: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
292*43a90889SApple OSS Distributions
293*43a90889SApple OSS Distributionslocks: OTHER_LDFLAGS += -ldarwintest_utils
294*43a90889SApple OSS Distributions
295*43a90889SApple OSS Distributionsimmovable_send_client: immovable_send_client.c
296*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) immovable_send_client.c -o $(SYMROOT)/immovable_send_client
297*43a90889SApple OSS Distributions
298*43a90889SApple OSS Distributionsinstall-immovable_send_client: immovable_send_client
299*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
300*43a90889SApple OSS Distributions	cp $(SYMROOT)/immovable_send_client $(INSTALLDIR)/
301*43a90889SApple OSS Distributions
302*43a90889SApple OSS Distributionsipc/sys_perf_notify_test: excserver_protect_state
303*43a90889SApple OSS Distributionsipc/sys_perf_notify_test: OTHER_CFLAGS += $(OBJROOT)/excserver_protect_state.c -I $(OBJROOT)
304*43a90889SApple OSS Distributionsipc/sys_perf_notify_test: CODE_SIGN_ENTITLEMENTS=entitlements/sys_perf_notify_test.entitlements
305*43a90889SApple OSS Distributions
306*43a90889SApple OSS Distributions
307*43a90889SApple OSS Distributionsposix_spawnattr_set_crash_behavior_np: posix_spawnattr_set_crash_behavior_np_child
308*43a90889SApple OSS Distributionsposix_spawnattr_set_crash_behavior_np: CODE_SIGN_ENTITLEMENTS = posix_spawnattr_set_crash_behavior_np_entitlements.plist
309*43a90889SApple OSS Distributions
310*43a90889SApple OSS Distributionsposix_spawnattr_set_crash_behavior_np_child: posix_spawnattr_set_crash_behavior_np_child.c
311*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) posix_spawnattr_set_crash_behavior_np_child.c -o $(SYMROOT)/posix_spawnattr_set_crash_behavior_np_child
312*43a90889SApple OSS Distributions	$(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@
313*43a90889SApple OSS Distributions
314*43a90889SApple OSS Distributionsinstall-posix_spawnattr_set_crash_behavior_np_child: posix_spawnattr_set_crash_behavior_np_child
315*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
316*43a90889SApple OSS Distributions	cp $(SYMROOT)/posix_spawnattr_set_crash_behavior_np_child $(INSTALLDIR)/
317*43a90889SApple OSS Distributions
318*43a90889SApple OSS Distributionsposix_spawnattr_set_launch_type_np: posix_spawnattr_set_launch_type_test
319*43a90889SApple OSS Distributionsposix_spawnattr_set_launch_type_np: OTHER_CFLAGS += -isystem $(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
320*43a90889SApple OSS Distributions
321*43a90889SApple OSS Distributionsposix_spawn_launch_type: CODE_SIGN_ENTITLEMENTS = posix_spawn_launch_type-entitlements.plist
322*43a90889SApple OSS Distributions
323*43a90889SApple OSS Distributionsport_exhaustion: OTHER_LDFLAGS += -ldarwintest_utils -lpthread
324*43a90889SApple OSS Distributionsport_exhaustion: port_exhaustion_client
325*43a90889SApple OSS Distributions
326*43a90889SApple OSS Distributionsport_exhaustion_client: port_exhaustion_client.c
327*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) port_exhaustion_client.c -o $(SYMROOT)/port_exhaustion_client
328*43a90889SApple OSS Distributions
329*43a90889SApple OSS Distributionsinstall-port_exhaustion_client: port_exhaustion_client
330*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
331*43a90889SApple OSS Distributions	cp $(SYMROOT)/port_exhaustion_client $(INSTALLDIR)/
332*43a90889SApple OSS Distributions
333*43a90889SApple OSS Distributionsport_table_limits: rnserver
334*43a90889SApple OSS Distributionsport_table_limits: CODE_SIGN_ENTITLEMENTS = task_for_pid_entitlement.plist
335*43a90889SApple OSS Distributionsport_table_limits: OTHER_CFLAGS += $(OBJROOT)/rnServer.c -I $(OBJROOT)
336*43a90889SApple OSS Distributionsport_table_limits: OTHER_LDFLAGS += -ldarwintest_utils -lpthread
337*43a90889SApple OSS Distributionsport_table_limits: port_table_limits_client
338*43a90889SApple OSS Distributions
339*43a90889SApple OSS Distributionsport_table_limits_client: port_table_limits_client.c
340*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) port_table_limits_client.c -o $(SYMROOT)/port_table_limits_client
341*43a90889SApple OSS Distributions	$(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@
342*43a90889SApple OSS Distributions
343*43a90889SApple OSS Distributionsinstall-port_table_limits_client: port_table_limits_client
344*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
345*43a90889SApple OSS Distributions	cp $(SYMROOT)/port_table_limits_client $(INSTALLDIR)/
346*43a90889SApple OSS Distributions
347*43a90889SApple OSS DistributionsCUSTOM_TARGETS += kqwl_rnserver
348*43a90889SApple OSS Distributions
349*43a90889SApple OSS Distributionskqwl_rnserver:
350*43a90889SApple OSS Distributions	$(MIG) $(CFLAGS) \
351*43a90889SApple OSS Distributions		-DKQWORKLOOPS_VIOLATION_SUPPORTED \
352*43a90889SApple OSS Distributions		-user /dev/null \
353*43a90889SApple OSS Distributions		-header $(OBJROOT)/kqwl_rn.h \
354*43a90889SApple OSS Distributions		-sheader $(OBJROOT)/kqwl_rnServer.h \
355*43a90889SApple OSS Distributions		-server $(OBJROOT)/kqwl_rnServer.c \
356*43a90889SApple OSS Distributions		rnserver.defs
357*43a90889SApple OSS Distributionsinstall-kqwl_rnserver: ;
358*43a90889SApple OSS Distributions
359*43a90889SApple OSS Distributionskqworkloop_limits: kqwl_rnserver
360*43a90889SApple OSS Distributionskqworkloop_limits: OTHER_CFLAGS += $(OBJROOT)/kqwl_rnServer.c -I $(OBJROOT)
361*43a90889SApple OSS Distributionskqworkloop_limits: OTHER_LDFLAGS += -ldarwintest_utils -lpthread
362*43a90889SApple OSS Distributionskqworkloop_limits: kqworkloop_limits_client
363*43a90889SApple OSS Distributions
364*43a90889SApple OSS Distributionskqworkloop_limits_client: kqworkloop_limits_client.c
365*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) kqworkloop_limits_client.c -o $(SYMROOT)/kqworkloop_limits_client
366*43a90889SApple OSS Distributions	$(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@
367*43a90889SApple OSS Distributions
368*43a90889SApple OSS Distributionsinstall-kqworkloop_limits_client: kqworkloop_limits_client
369*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
370*43a90889SApple OSS Distributions	cp $(SYMROOT)/kqworkloop_limits_client $(INSTALLDIR)/
371*43a90889SApple OSS Distributions
372*43a90889SApple OSS Distributionsipc/task_name_for_pid: CODE_SIGN_ENTITLEMENTS = ipc/task_name_for_pid_entitlement.plist
373*43a90889SApple OSS Distributions
374*43a90889SApple OSS Distributionsfd_table_limits: rnserver
375*43a90889SApple OSS Distributionsfd_table_limits: OTHER_CFLAGS += $(OBJROOT)/rnServer.c -I $(OBJROOT)
376*43a90889SApple OSS Distributionsfd_table_limits: OTHER_LDFLAGS += -ldarwintest_utils -lpthread
377*43a90889SApple OSS Distributionsfd_table_limits: fd_table_limits_client
378*43a90889SApple OSS Distributions
379*43a90889SApple OSS Distributionsfd_table_limits_client: fd_table_limits_client.c
380*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) fd_table_limits_client.c -o $(SYMROOT)/fd_table_limits_client
381*43a90889SApple OSS Distributions	$(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@
382*43a90889SApple OSS Distributions
383*43a90889SApple OSS Distributionsinstall-fd_table_limits_client: fd_table_limits_client
384*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
385*43a90889SApple OSS Distributions	cp $(SYMROOT)/fd_table_limits_client $(INSTALLDIR)/
386*43a90889SApple OSS Distributions
387*43a90889SApple OSS Distributionsvm_spawn_tool: INVALID_ARCHS = i386
388*43a90889SApple OSS Distributionsvm_spawn_tool: vm_spawn_tool.c
389*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) vm_spawn_tool.c -o $(SYMROOT)/vm_spawn_tool
390*43a90889SApple OSS Distributions
391*43a90889SApple OSS Distributionsinstall-vm_spawn_tool: vm_spawn_tool
392*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)/tools
393*43a90889SApple OSS Distributions	cp $(SYMROOT)/vm_spawn_tool $(INSTALLDIR)/tools/
394*43a90889SApple OSS Distributions
395*43a90889SApple OSS DistributionsCUSTOM_TARGETS += imm_pinned_control_port_crasher
396*43a90889SApple OSS DistributionsCUSTOM_TARGETS += imm_pinned_control_port_crasher_3P_hardened
397*43a90889SApple OSS Distributions
398*43a90889SApple OSS Distributionsimm_pinned_control_port: excserver_protect
399*43a90889SApple OSS Distributionsimm_pinned_control_port: CODE_SIGN_ENTITLEMENTS = task_for_pid_entitlement.plist
400*43a90889SApple OSS Distributionsimm_pinned_control_port: OTHER_CFLAGS += $(OBJROOT)/excserver_protect.c -I $(OBJROOT)
401*43a90889SApple OSS Distributionsimm_pinned_control_port: OTHER_LDFLAGS += -ldarwintest_utils -lpthread
402*43a90889SApple OSS Distributionsimm_pinned_control_port: imm_pinned_control_port_crasher imm_pinned_control_port_crasher_3P_hardened
403*43a90889SApple OSS Distributions
404*43a90889SApple OSS Distributionsimm_pinned_control_port_crasher: imm_pinned_control_port_crasher.c cs_helpers.c
405*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \
406*43a90889SApple OSS Distributions	$^ -o $(SYMROOT)/$@
407*43a90889SApple OSS Distributions	$(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@
408*43a90889SApple OSS Distributions
409*43a90889SApple OSS Distributionsimm_pinned_control_port_crasher_3P_hardened: CODE_SIGN_ENTITLEMENTS = entitlements/hardened-binary-entitlements-1.plist
410*43a90889SApple OSS Distributionsimm_pinned_control_port_crasher_3P_hardened: imm_pinned_control_port_crasher.c cs_helpers.c
411*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \
412*43a90889SApple OSS Distributions	$^ -o $(SYMROOT)/$@
413*43a90889SApple OSS Distributions	$(CODESIGN) --force --sign - --entitlements $(CODE_SIGN_ENTITLEMENTS) --timestamp=none $(SYMROOT)/$@
414*43a90889SApple OSS Distributions
415*43a90889SApple OSS Distributionsinstall-imm_pinned_control_port_crasher: imm_pinned_control_port_crasher
416*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
417*43a90889SApple OSS Distributions	cp $(SYMROOT)/$^ $(INSTALLDIR)/
418*43a90889SApple OSS Distributions
419*43a90889SApple OSS Distributionsinstall-imm_pinned_control_port_crasher_3P_hardened: imm_pinned_control_port_crasher_3P_hardened
420*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
421*43a90889SApple OSS Distributions	cp $(SYMROOT)/$^ $(INSTALLDIR)/
422*43a90889SApple OSS Distributions
423*43a90889SApple OSS DistributionsCUSTOM_TARGETS += reply_port_defense_client
424*43a90889SApple OSS DistributionsCUSTOM_TARGETS += reply_port_defense_client_3P_hardened
425*43a90889SApple OSS Distributions
426*43a90889SApple OSS Distributionsreply_port_defense: excserver_protect_state
427*43a90889SApple OSS Distributionsreply_port_defense: OTHER_CFLAGS += $(OBJROOT)/excserver_protect_state.c -I $(OBJROOT)
428*43a90889SApple OSS Distributionsreply_port_defense: OTHER_LDFLAGS += -ldarwintest_utils -lpthread
429*43a90889SApple OSS Distributionsreply_port_defense: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
430*43a90889SApple OSS Distributionsreply_port_defense: reply_port_defense_client reply_port_defense_client_3P_hardened
431*43a90889SApple OSS Distributions
432*43a90889SApple OSS Distributionsreply_port_defense_client: reply_port_defense_client.c cs_helpers.c
433*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \
434*43a90889SApple OSS Distributions	$^ -o $(SYMROOT)/$@
435*43a90889SApple OSS Distributions	$(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@
436*43a90889SApple OSS Distributions
437*43a90889SApple OSS Distributionsreply_port_defense_client_3P_hardened: CODE_SIGN_ENTITLEMENTS=entitlements/hardened-binary-entitlements-1.plist
438*43a90889SApple OSS Distributionsreply_port_defense_client_3P_hardened: reply_port_defense_client.c cs_helpers.c
439*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \
440*43a90889SApple OSS Distributions	$^ -o $(SYMROOT)/$@
441*43a90889SApple OSS Distributions	$(CODESIGN) --force --sign - --entitlements $(CODE_SIGN_ENTITLEMENTS) --timestamp=none $(SYMROOT)/$@
442*43a90889SApple OSS Distributions
443*43a90889SApple OSS Distributionsinstall-reply_port_defense_client: reply_port_defense_client
444*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
445*43a90889SApple OSS Distributions	cp $(SYMROOT)/$< $(INSTALLDIR)/
446*43a90889SApple OSS Distributions
447*43a90889SApple OSS Distributionsinstall-reply_port_defense_client_3P_hardened: reply_port_defense_client_3P_hardened
448*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
449*43a90889SApple OSS Distributions	cp $(SYMROOT)/$< $(INSTALLDIR)/
450*43a90889SApple OSS Distributions
451*43a90889SApple OSS Distributionskas_info: OTHER_LDFLAGS += -framework CoreSymbolication
452*43a90889SApple OSS Distributionskas_info: CODE_SIGN_ENTITLEMENTS = kernel_symbolication_entitlements.plist
453*43a90889SApple OSS Distributions
454*43a90889SApple OSS Distributionsnet_bounds_safety: OTHER_CFLAGS += -fbounds-safety
455*43a90889SApple OSS Distributions
456*43a90889SApple OSS Distributionsnet_no_bounds_safety: OTHER_CFLAGS += -fno-bounds-safety
457*43a90889SApple OSS Distributionsnet_no_bounds_safety: net_bounds_safety.c
458*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
459*43a90889SApple OSS DistributionsOTHER_TEST_TARGETS += net_no_bounds_safety
460*43a90889SApple OSS Distributions
461*43a90889SApple OSS Distributionshost_statistics_rate_limiting: cs_helpers.c host_statistics_rate_limiting.c
462*43a90889SApple OSS Distributions
463*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += drop_priv.c xnu_quick_test_helpers.c memorystatus_assertion_helpers.c bpflib.c in_cksum.c test_utils.c inet_transfer.c net_test_lib.c cs_helpers.c
464*43a90889SApple OSS Distributions
465*43a90889SApple OSS Distributionsifneq ($(IOS_TEST_COMPAT),YES)
466*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += jumbo_va_spaces_28530648.c perf_compressor.c vm/ios13extended_footprint.c vm/entitlement_internal_bands.c
467*43a90889SApple OSS Distributionsendif
468*43a90889SApple OSS Distributions
469*43a90889SApple OSS Distributionsperf_compressor: OTHER_LDFLAGS += -ldarwintest_utils
470*43a90889SApple OSS Distributionsperf_compressor: CODE_SIGN_ENTITLEMENTS=./private_entitlement.plist
471*43a90889SApple OSS Distributions
472*43a90889SApple OSS Distributions
473*43a90889SApple OSS Distributionsvm/memorystatus_freeze_test: CODE_SIGN_ENTITLEMENTS=./task_for_pid_entitlement.plist
474*43a90889SApple OSS Distributionsvm/memorystatus_freeze_test: OTHER_LDFLAGS += -ldarwintest_utils
475*43a90889SApple OSS Distributionsvm/memorystatus_freeze_test: memorystatus_assertion_helpers.c test_utils.c vm/memorystatus_freeze_test.c
476*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
477*43a90889SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements $(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@;
478*43a90889SApple OSS Distributions
479*43a90889SApple OSS Distributionsvm/memorystatus_freeze_test_entitled: CODE_SIGN_ENTITLEMENTS=./vm/memorystatus_freeze_test_entitled.plist
480*43a90889SApple OSS Distributionsvm/memorystatus_freeze_test_entitled: OTHER_LDFLAGS += -ldarwintest_utils
481*43a90889SApple OSS Distributionsvm/memorystatus_freeze_test_entitled: test_utils.c vm/memorystatus_freeze_test_entitled.c
482*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
483*43a90889SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements $(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@;
484*43a90889SApple OSS Distributions
485*43a90889SApple OSS Distributionsvm/memorystatus_jetsam_zprint_snapshot: CODE_SIGN_ENTITLEMENTS=./vm/memorystatus_jetsam_zprint_snapshot.entitlements
486*43a90889SApple OSS Distributionsvm/memorystatus_jetsam_zprint_snapshot: OTHER_LDFLAGS += -ldarwintest_utils
487*43a90889SApple OSS Distributions
488*43a90889SApple OSS Distributionsvm/memorystatus_kill_counts: CODE_SIGN_ENTITLEMENTS=./vm/memorystatus_kill_counts.entitlements
489*43a90889SApple OSS Distributionsvm/memorystatus_kill_counts: OTHER_LDFLAGS += -ldarwintest_utils
490*43a90889SApple OSS Distributions
491*43a90889SApple OSS Distributionsvm/neural_footprint: CODE_SIGN_ENTITLEMENTS=./vm/neural_footprint.entitlement
492*43a90889SApple OSS Distributionsvm/neural_footprint: OTHER_CFLAGS += -I $(OBJROOT)
493*43a90889SApple OSS Distributionsvm/neural_footprint: OTHER_LDFLAGS += -ldarwintest_utils
494*43a90889SApple OSS Distributionsvm/neural_footprint: test_utils.c vm/neural_footprint.c ./vm/neural_footprint.entitlement
495*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
496*43a90889SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements $(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@;
497*43a90889SApple OSS Distributions
498*43a90889SApple OSS Distributionsmemorystatus_is_assertion: OTHER_LDFLAGS += -ldarwintest_utils
499*43a90889SApple OSS Distributionsmemorystatus_is_assertion: OTHER_CFLAGS += memorystatus_assertion_helpers.c
500*43a90889SApple OSS Distributions
501*43a90889SApple OSS Distributionsmemorystatus_vm_map_fork: OTHER_CFLAGS += test_utils.c
502*43a90889SApple OSS Distributionsmemorystatus_vm_map_fork: OTHER_LDFLAGS += -ldarwintest_utils
503*43a90889SApple OSS Distributions
504*43a90889SApple OSS Distributionsshared_cache_tests: OTHER_LDFLAGS += -ldarwintest_utils
505*43a90889SApple OSS Distributions
506*43a90889SApple OSS Distributionsifneq ($(wildcard $(SDKROOT)/System/Library/PrivateFrameworks/Tightbeam.framework/Headers/tightbeam.h),)
507*43a90889SApple OSS Distributionsstackshot_tests: OTHER_LDFLAGS += -framework Tightbeam
508*43a90889SApple OSS Distributionsstackshot_tests: OTHER_CFLAGS += -I$(OBJROOT)
509*43a90889SApple OSS Distributionsstackshot_tests: OTHER_CFLAGS += $(TIGHTBEAM_MODULE_IMPL_PATH)
510*43a90889SApple OSS Distributionsstackshot_tests.m: $(TIGHTBEAM_MODULE_HEADERS)
511*43a90889SApple OSS Distributionsendif
512*43a90889SApple OSS Distributionsstackshot_tests: ./stackshot-entitlements.plist stackshot_tests.m
513*43a90889SApple OSS Distributionsstackshot_tests: CODE_SIGN_ENTITLEMENTS=./stackshot-entitlements.plist
514*43a90889SApple OSS Distributionsstackshot_tests: OTHER_CFLAGS += -Wno-objc-messaging-id test_utils.c
515*43a90889SApple OSS Distributionsstackshot_tests: OTHER_LDFLAGS += -lkdd -lz -ldarwintest_utils -framework Foundation -framework IOKit
516*43a90889SApple OSS Distributions
517*43a90889SApple OSS Distributionsstackshot_accuracy: ./stackshot-entitlements.plist
518*43a90889SApple OSS Distributionsstackshot_accuracy: CODE_SIGN_ENTITLEMENTS=./stackshot-entitlements.plist
519*43a90889SApple OSS Distributionsstackshot_accuracy: OTHER_CFLAGS += -ldarwintest_utils -Wno-objc-messaging-id
520*43a90889SApple OSS Distributionsstackshot_accuracy: OTHER_LDFLAGS += -lkdd -ldarwintest_utils -framework Foundation
521*43a90889SApple OSS Distributionsstackshot_accuracy: INVALID_ARCHS = i386
522*43a90889SApple OSS Distributions
523*43a90889SApple OSS Distributionsstackshot_spawn_exit_stress: ./stackshot-entitlements.plist
524*43a90889SApple OSS Distributionsstackshot_spawn_exit_stress: CODE_SIGN_ENTITLEMENTS=./stackshot-entitlements.plist
525*43a90889SApple OSS Distributions
526*43a90889SApple OSS Distributionsifeq ($(PLATFORM),MacOSX)
527*43a90889SApple OSS DistributionsCUSTOM_TARGETS += stackshot_translated_child
528*43a90889SApple OSS Distributions
529*43a90889SApple OSS Distributionsstackshot_translated_child: INVALID_ARCHS = arm64 arm64e
530*43a90889SApple OSS Distributionsstackshot_translated_child: stackshot_translated_child.c
531*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) stackshot_translated_child.c -o $(SYMROOT)/stackshot_translated_child
532*43a90889SApple OSS Distributions
533*43a90889SApple OSS Distributionsinstall-stackshot_translated_child: stackshot_translated_child
534*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
535*43a90889SApple OSS Distributions	cp $(SYMROOT)/stackshot_translated_child $(INSTALLDIR)/
536*43a90889SApple OSS Distributionselse
537*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += stackshot_translated_child.c
538*43a90889SApple OSS Distributionsendif
539*43a90889SApple OSS Distributions
540*43a90889SApple OSS Distributionsmicrostackshot_tests: ./stackshot-entitlements.plist
541*43a90889SApple OSS Distributionsmicrostackshot_tests: CODE_SIGN_ENTITLEMENTS=./stackshot-entitlements.plist
542*43a90889SApple OSS Distributionsmicrostackshot_tests: OTHER_LDFLAGS = -ldarwintest_utils -framework ktrace -framework kperf -framework CoreFoundation
543*43a90889SApple OSS Distributions
544*43a90889SApple OSS Distributionsmemorystatus_zone_test: ./stackshot-entitlements.plist
545*43a90889SApple OSS Distributionsmemorystatus_zone_test: CODE_SIGN_ENTITLEMENTS=./stackshot-entitlements.plist
546*43a90889SApple OSS Distributionsmemorystatus_zone_test: OTHER_CFLAGS += -isystem $(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
547*43a90889SApple OSS Distributionsmemorystatus_zone_test: OTHER_LDFLAGS += -framework ktrace
548*43a90889SApple OSS Distributionsmemorystatus_zone_test: OTHER_LDFLAGS += -ldarwintest_utils
549*43a90889SApple OSS Distributions
550*43a90889SApple OSS Distributionsmemcmp_zero: OTHER_CFLAGS += ../osfmk/arm64/memcmp_zero.s
551*43a90889SApple OSS Distributions
552*43a90889SApple OSS Distributionstext_corruption: OTHER_LDFLAGS += -ldarwintest_utils
553*43a90889SApple OSS DistributionsCUSTOM_TARGETS += text_corruption_helper
554*43a90889SApple OSS Distributions
555*43a90889SApple OSS Distributionstext_corruption_helper:
556*43a90889SApple OSS Distributions	$(CC) $(LDFLAGS) $(CFLAGS) text_corruption_helper.c -lm -o $(SYMROOT)/$@;
557*43a90889SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
558*43a90889SApple OSS Distributions
559*43a90889SApple OSS Distributionsinstall-text_corruption_helper: text_corruption_helper
560*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
561*43a90889SApple OSS Distributions	cp $(SYMROOT)/text_corruption_helper $(INSTALLDIR)/
562*43a90889SApple OSS Distributions
563*43a90889SApple OSS Distributionscodesigntests: CODE_SIGN_ENTITLEMENTS=codesigntests-entitlements.plist
564*43a90889SApple OSS Distributionscodesigntests: OTHER_CFLAGS += -DTESTNAME=codesigntests
565*43a90889SApple OSS Distributions# Adding a custom target and build/install rules since CODE_SIGN_ENTITLEMENTS
566*43a90889SApple OSS Distributions# does not take in arguments, and we need to sign this test using a sha256T
567*43a90889SApple OSS Distributions# digest
568*43a90889SApple OSS Distributions
569*43a90889SApple OSS DistributionsOTHER_TEST_TARGETS += codesigntests_sha256t
570*43a90889SApple OSS Distributionscodesigntests_sha256t: OTHER_CFLAGS += -DTESTNAME=codesigntests_sha256t
571*43a90889SApple OSS Distributions
572*43a90889SApple OSS Distributionscodesigntests_sha256t: codesigntests.c
573*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(DT_LDFLAGS) $(LDFLAGS) $(CFLAGS) codesigntests.c -o $(SYMROOT)/$@;
574*43a90889SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --digest=sha256T -s - --entitlements codesigntests-entitlements.plist $(SYMROOT)/$@;
575*43a90889SApple OSS Distributionsinstall-codesigntests_sha256t: codesigntests_sha256t
576*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
577*43a90889SApple OSS Distributions	cp $(SYMROOT)/codesigntests_sha256t $(INSTALLDIR)/
578*43a90889SApple OSS Distributions
579*43a90889SApple OSS Distributions
580*43a90889SApple OSS Distributionsecc_test: OTHER_LDFLAGS += -ldarwintest_utils
581*43a90889SApple OSS DistributionsCUSTOM_TARGETS += ecc_test_helper
582*43a90889SApple OSS Distributions
583*43a90889SApple OSS Distributionsecc_test_helper:
584*43a90889SApple OSS Distributions	$(CC) $(LDFLAGS) $(CFLAGS) ecc_test_helper.c -lm -o $(SYMROOT)/$@;
585*43a90889SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
586*43a90889SApple OSS Distributions
587*43a90889SApple OSS Distributionsinstall-ecc_test_helper: ecc_test_helper
588*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
589*43a90889SApple OSS Distributions	cp $(SYMROOT)/ecc_test_helper $(INSTALLDIR)/
590*43a90889SApple OSS Distributions
591*43a90889SApple OSS Distributionsvm/test_vm_no_pager: excserver
592*43a90889SApple OSS Distributionsvm/test_vm_no_pager: OTHER_LDFLAGS += -ldarwintest_utils -lpthread -lkdd -framework Foundation
593*43a90889SApple OSS Distributionsvm/test_vm_no_pager: OTHER_CFLAGS += -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders $(OBJROOT)/excserver.c -I$(OBJROOT)
594*43a90889SApple OSS Distributionsvm/test_vm_no_pager: vm/test_vm_no_pager_helper
595*43a90889SApple OSS Distributionsvm/test_vm_no_pager: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
596*43a90889SApple OSS DistributionsCUSTOM_TARGETS += vm/test_vm_no_pager_helper
597*43a90889SApple OSS Distributions
598*43a90889SApple OSS Distributionsvm/test_vm_no_pager_helper: vm/test_vm_no_pager_helper.c
599*43a90889SApple OSS Distributions	$(CC) $(CFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -lm -o $(SYMROOT)/$@;
600*43a90889SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
601*43a90889SApple OSS Distributions
602*43a90889SApple OSS Distributionsinstall-vm/test_vm_no_pager_helper: vm/test_vm_no_pager_helper
603*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)/vm
604*43a90889SApple OSS Distributions	cp $(SYMROOT)/vm/test_vm_no_pager_helper $(INSTALLDIR)/vm/
605*43a90889SApple OSS Distributions
606*43a90889SApple OSS Distributions
607*43a90889SApple OSS Distributionskevent_qos: OTHER_CFLAGS += -Wno-unused-macros
608*43a90889SApple OSS Distributionskevent_qos: OTHER_CFLAGS += -I $(OBJROOT)/
609*43a90889SApple OSS Distributions
610*43a90889SApple OSS Distributionstest_knote_use_after_free: OTHER_CFLAGS += -Wno-unused-macros
611*43a90889SApple OSS Distributionstest_knote_use_after_free: OTHER_LDFLAGS += -ldarwintest_utils -lpthread
612*43a90889SApple OSS Distributions
613*43a90889SApple OSS Distributionsmach_get_times: OTHER_LDFLAGS += -ldarwintest_utils
614*43a90889SApple OSS Distributions
615*43a90889SApple OSS Distributionsmonotonic_core: ./stackshot-entitlements.plist
616*43a90889SApple OSS Distributionsmonotonic_core: CODE_SIGN_ENTITLEMENTS=./stackshot-entitlements.plist
617*43a90889SApple OSS Distributionsmonotonic_core: OTHER_LDFLAGS += -framework ktrace
618*43a90889SApple OSS Distributions
619*43a90889SApple OSS Distributionsperf_exit: perf_exit_proc
620*43a90889SApple OSS Distributionsperf_exit: ./stackshot-entitlements.plist
621*43a90889SApple OSS Distributionsperf_exit: CODE_SIGN_ENTITLEMENTS=./stackshot-entitlements.plist
622*43a90889SApple OSS Distributionsperf_exit: OTHER_LDFLAGS = -framework ktrace -ldarwintest_utils
623*43a90889SApple OSS Distributionsperf_exit: CODE_SIGN_ENTITLEMENTS=./private_entitlement.plist
624*43a90889SApple OSS Distributions
625*43a90889SApple OSS Distributionsipc/mach_exc_port_substitute: excserver
626*43a90889SApple OSS Distributionsipc/mach_exc_port_substitute: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
627*43a90889SApple OSS Distributionsipc/mach_exc_port_substitute: CODE_SIGN_ENTITLEMENTS = ipc/mach_exc_port_substitute.plist
628*43a90889SApple OSS Distributions
629*43a90889SApple OSS DistributionsCUSTOM_TARGETS += prioritize_process_launch_helper
630*43a90889SApple OSS Distributionsprioritize_process_launch: prioritize_process_launch_helper
631*43a90889SApple OSS Distributions
632*43a90889SApple OSS Distributionsprioritize_process_launch_helper: prioritize_process_launch_helper.c
633*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) prioritize_process_launch_helper.c -o $(SYMROOT)/prioritize_process_launch_helper
634*43a90889SApple OSS Distributions	echo $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@; \
635*43a90889SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
636*43a90889SApple OSS Distributions
637*43a90889SApple OSS Distributionsinstall-prioritize_process_launch_helper: prioritize_process_launch_helper
638*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
639*43a90889SApple OSS Distributions	cp $(SYMROOT)/prioritize_process_launch_helper $(INSTALLDIR)/
640*43a90889SApple OSS Distributions
641*43a90889SApple OSS Distributions
642*43a90889SApple OSS Distributionsperf_spawn_fork: CODE_SIGN_ENTITLEMENTS=./private_entitlement.plist
643*43a90889SApple OSS Distributions
644*43a90889SApple OSS Distributionsmach_exception_reply: OTHER_CFLAGS += -Wno-cast-align
645*43a90889SApple OSS Distributionsmach_exception_reply: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
646*43a90889SApple OSS Distributions
647*43a90889SApple OSS Distributionsos_thread_self_restrict: os_thread_self_restrict.c os_thread_self_restrict-entitlements.plist
648*43a90889SApple OSS Distributionsos_thread_self_restrict: CODE_SIGN_ENTITLEMENTS=os_thread_self_restrict-entitlements.plist
649*43a90889SApple OSS Distributionsos_thread_self_restrict: OTHER_LDFLAGS += -sectcreate __TEXT __info_plist os_thread_self_restrict-identifier.plist
650*43a90889SApple OSS Distributions
651*43a90889SApple OSS Distributions# Temporarily disabled.  See rdar://121952316
652*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += os_thread_self_restrict.c
653*43a90889SApple OSS Distributions
654*43a90889SApple OSS Distributionssubsystem_root_path: subsystem_root_path.c subsystem_root_path-entitlements.plist
655*43a90889SApple OSS Distributionssubsystem_root_path: CODE_SIGN_ENTITLEMENTS=subsystem_root_path-entitlements.plist
656*43a90889SApple OSS Distributions
657*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += $(wildcard bounded_ptr_src/*.cpp)
658*43a90889SApple OSS Distributionsbounded_ptr: OTHER_CXXFLAGS += -Werror=implicit-int-conversion -Werror=shorten-64-to-32 -I$(SRCROOT)/../libkern -std=c++17
659*43a90889SApple OSS Distributionsbounded_ptr: $(wildcard bounded_ptr_src/*.cpp) bounded_ptr.cpp
660*43a90889SApple OSS Distributions
661*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += bounded_ptr_03.cpp
662*43a90889SApple OSS Distributionsbounded_ptr_03: OTHER_CXXFLAGS += -Werror=implicit-int-conversion -Werror=shorten-64-to-32 -I$(SRCROOT)/../libkern -std=c++03 $(DT_LDFLAGS)
663*43a90889SApple OSS Distributionsbounded_ptr_03: bounded_ptr_03.cpp
664*43a90889SApple OSS Distributions
665*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += $(wildcard bounded_array_src/*.cpp)
666*43a90889SApple OSS Distributionsbounded_array: OTHER_CXXFLAGS += -Werror=implicit-int-conversion -Werror=shorten-64-to-32 -I$(SRCROOT)/../libkern -std=c++17
667*43a90889SApple OSS Distributionsbounded_array: $(wildcard bounded_array_src/*.cpp) bounded_array.cpp
668*43a90889SApple OSS Distributions
669*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += $(wildcard bounded_array_ref_src/*.cpp)
670*43a90889SApple OSS Distributionsbounded_array_ref: OTHER_CXXFLAGS += -Werror=implicit-int-conversion -Werror=shorten-64-to-32 -I$(SRCROOT)/../libkern -std=c++17
671*43a90889SApple OSS Distributionsbounded_array_ref: $(wildcard bounded_array_ref_src/*.cpp) bounded_array_ref.cpp
672*43a90889SApple OSS Distributions
673*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += $(wildcard intrusive_shared_ptr_src/*.cpp)
674*43a90889SApple OSS Distributionsintrusive_shared_ptr: OTHER_CXXFLAGS += -Werror=implicit-int-conversion -Werror=shorten-64-to-32 -I$(SRCROOT)/../libkern -std=c++17
675*43a90889SApple OSS Distributionsintrusive_shared_ptr: $(wildcard intrusive_shared_ptr_src/*.cpp) intrusive_shared_ptr.cpp
676*43a90889SApple OSS Distributions
677*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += $(wildcard safe_allocation_src/*.cpp)
678*43a90889SApple OSS Distributionssafe_allocation: OTHER_CXXFLAGS += -Werror=implicit-int-conversion -Werror=shorten-64-to-32 -I$(SRCROOT)/../libkern -std=c++17
679*43a90889SApple OSS Distributionssafe_allocation: $(wildcard safe_allocation_src/*.cpp) safe_allocation.cpp
680*43a90889SApple OSS Distributions
681*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += $(wildcard cxx_safe_buffers_src/*.cpp)
682*43a90889SApple OSS Distributionscxx_safe_buffers: OTHER_CXXFLAGS += -Werror=unsafe-buffer-usage -I$(SRCROOT)/../libkern -std=c++20
683*43a90889SApple OSS Distributionscxx_safe_buffers: $(wildcard cxx_safe_buffers_src/*.cpp) cxx_safe_buffers.cpp
684*43a90889SApple OSS Distributions
685*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += osptr_compat.cpp
686*43a90889SApple OSS Distributionsosptr_98: OTHER_CXXFLAGS += -I$(SRCROOT)/../libkern -std=c++98 -DOSPTR_STD="98"
687*43a90889SApple OSS Distributionsosptr_98: osptr_compat.cpp
688*43a90889SApple OSS Distributions	$(CXX) $(DT_CXXFLAGS) $(OTHER_CXXFLAGS) $(CXXFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
689*43a90889SApple OSS Distributionsosptr_11: OTHER_CXXFLAGS += -I$(SRCROOT)/../libkern -std=c++11 -DOSPTR_STD="11"
690*43a90889SApple OSS Distributionsosptr_11: osptr_compat.cpp
691*43a90889SApple OSS Distributions	$(CXX) $(DT_CXXFLAGS) $(OTHER_CXXFLAGS) $(CXXFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
692*43a90889SApple OSS Distributionsosptr_14: OTHER_CXXFLAGS += -I$(SRCROOT)/../libkern -std=c++14 -DOSPTR_STD="14"
693*43a90889SApple OSS Distributionsosptr_14: osptr_compat.cpp
694*43a90889SApple OSS Distributions	$(CXX) $(DT_CXXFLAGS) $(OTHER_CXXFLAGS) $(CXXFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
695*43a90889SApple OSS Distributionsosptr_17: OTHER_CXXFLAGS += -I$(SRCROOT)/../libkern -std=c++17 -DOSPTR_STD="17"
696*43a90889SApple OSS Distributionsosptr_17: osptr_compat.cpp
697*43a90889SApple OSS Distributions	$(CXX) $(DT_CXXFLAGS) $(OTHER_CXXFLAGS) $(CXXFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
698*43a90889SApple OSS Distributions
699*43a90889SApple OSS Distributionspriority_queue: OTHER_CXXFLAGS += -std=c++17
700*43a90889SApple OSS Distributionsqueue: OTHER_CFLAGS += -I$(SRCROOT)/../osfmk
701*43a90889SApple OSS Distributions
702*43a90889SApple OSS Distributionsvm/zalloc: OTHER_LDFLAGS += -ldarwintest_utils
703*43a90889SApple OSS Distributionsvm/zalloc_buddy: OTHER_CFLAGS += -Wno-format-pedantic
704*43a90889SApple OSS Distributions
705*43a90889SApple OSS Distributionsos_refcnt: OTHER_CFLAGS += -I$(SRCROOT)/../libkern/ -Wno-gcc-compat -Wno-undef -O3 -flto -ldarwintest_utils
706*43a90889SApple OSS Distributions
707*43a90889SApple OSS Distributionskernel_inspection: CODE_SIGN_ENTITLEMENTS = ./task_for_pid_entitlement.plist
708*43a90889SApple OSS Distributionskernel_inspection: OTHER_CFLAGS += -DENTITLED=1
709*43a90889SApple OSS Distributions
710*43a90889SApple OSS Distributionsturnstile_multihop: OTHER_CFLAGS += -Wno-unused-macros
711*43a90889SApple OSS Distributionsturnstile_multihop: OTHER_CFLAGS += -I $(OBJROOT)/
712*43a90889SApple OSS Distributions
713*43a90889SApple OSS DistributionsCUSTOM_TARGETS += perf_exit_proc
714*43a90889SApple OSS Distributions
715*43a90889SApple OSS Distributionsperf_exit_proc:
716*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) perf_exit_proc.c -o $(SYMROOT)/perf_exit_proc
717*43a90889SApple OSS Distributions
718*43a90889SApple OSS Distributionsinstall-perf_exit_proc: perf_exit_proc
719*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
720*43a90889SApple OSS Distributions	cp $(SYMROOT)/perf_exit_proc $(INSTALLDIR)/
721*43a90889SApple OSS Distributions
722*43a90889SApple OSS Distributions# Stackshot
723*43a90889SApple OSS Distributions
724*43a90889SApple OSS Distributions
725*43a90889SApple OSS Distributionsstackshot_idle_25570396: ./stackshot-entitlements.plist
726*43a90889SApple OSS Distributionsstackshot_idle_25570396: CODE_SIGN_ENTITLEMENTS=./stackshot-entitlements.plist
727*43a90889SApple OSS Distributionsstackshot_idle_25570396: OTHER_LDFLAGS += -lkdd -framework Foundation
728*43a90889SApple OSS Distributionsstackshot_idle_25570396: OTHER_LDFLAGS += -lkdd -framework Foundation
729*43a90889SApple OSS Distributions
730*43a90889SApple OSS Distributionsstackshot_block_owner_14362384: ./stackshot-entitlements.plist
731*43a90889SApple OSS Distributionsstackshot_block_owner_14362384: CODE_SIGN_ENTITLEMENTS=./stackshot-entitlements.plist
732*43a90889SApple OSS Distributionsstackshot_block_owner_14362384: OTHER_LDFLAGS += -framework Foundation -lpthread -lkdd
733*43a90889SApple OSS Distributionsifeq ($(PLATFORM),MacOSX)
734*43a90889SApple OSS Distributionsstackshot_block_owner_14362384: OTHER_LDFLAGS += -lpcre
735*43a90889SApple OSS Distributionsendif
736*43a90889SApple OSS Distributions
737*43a90889SApple OSS Distributionsall: $(DSTROOT)/usr/local/bin/kcdata
738*43a90889SApple OSS Distributions
739*43a90889SApple OSS Distributions$(DSTROOT)/usr/local/bin/kcdata: $(SRCROOT)/../tools/lldbmacros/kcdata.py
740*43a90889SApple OSS Distributions	mkdir -p $(dir $@)
741*43a90889SApple OSS Distributions	cp $< $@
742*43a90889SApple OSS Distributions	chmod a+x $@
743*43a90889SApple OSS Distributions
744*43a90889SApple OSS Distributionsxnu_quick_test: OTHER_CFLAGS += xnu_quick_test_helpers.c
745*43a90889SApple OSS Distributions
746*43a90889SApple OSS DistributionsCUSTOM_TARGETS += vm_set_max_addr_helper
747*43a90889SApple OSS Distributions
748*43a90889SApple OSS Distributionsvm_set_max_addr_helper: vm_set_max_addr_helper.c
749*43a90889SApple OSS Distributions	$(CC) $(OTHER_CFLAGS) $(CFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) vm_set_max_addr_helper.c -o $(SYMROOT)/vm_set_max_addr_helper; \
750*43a90889SApple OSS Distributions	echo $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@; \
751*43a90889SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
752*43a90889SApple OSS Distributions
753*43a90889SApple OSS Distributionsinstall-vm_set_max_addr_helper: vm_set_max_addr_helper
754*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
755*43a90889SApple OSS Distributions	cp $(SYMROOT)/vm_set_max_addr_helper $(INSTALLDIR)/
756*43a90889SApple OSS Distributions
757*43a90889SApple OSS DistributionsCUSTOM_TARGETS += subsystem_root_path_helper_entitled
758*43a90889SApple OSS DistributionsCUSTOM_TARGETS += subsystem_root_path_helper
759*43a90889SApple OSS Distributions
760*43a90889SApple OSS Distributionssubsystem_root_path_helper_entitled: subsystem_root_path_helper.c subsystem_root_path-entitlements.plist
761*43a90889SApple OSS Distributions	$(CC) $(OTHER_CFLAGS) $(CFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) subsystem_root_path_helper.c -o $(SYMROOT)/subsystem_root_path_helper_entitled; \
762*43a90889SApple OSS Distributions	echo $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@; \
763*43a90889SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements subsystem_root_path-entitlements.plist $(SYMROOT)/$@;
764*43a90889SApple OSS Distributions
765*43a90889SApple OSS Distributionsinstall-subsystem_root_path_helper_entitled: subsystem_root_path_helper_entitled
766*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
767*43a90889SApple OSS Distributions	cp $(SYMROOT)/subsystem_root_path_helper_entitled $(INSTALLDIR)/
768*43a90889SApple OSS Distributions
769*43a90889SApple OSS Distributionssubsystem_root_path_helper: subsystem_root_path_helper.c
770*43a90889SApple OSS Distributions	$(CC) $(OTHER_CFLAGS) $(CFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) subsystem_root_path_helper.c -o $(SYMROOT)/subsystem_root_path_helper; \
771*43a90889SApple OSS Distributions	echo $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@; \
772*43a90889SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
773*43a90889SApple OSS Distributions
774*43a90889SApple OSS Distributionsinstall-subsystem_root_path_helper: subsystem_root_path_helper
775*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
776*43a90889SApple OSS Distributions	cp $(SYMROOT)/subsystem_root_path_helper $(INSTALLDIR)/
777*43a90889SApple OSS Distributions
778*43a90889SApple OSS DistributionsCUSTOM_TARGETS += vm_test_code_signing_helper
779*43a90889SApple OSS Distributions
780*43a90889SApple OSS Distributionsvm_test_code_signing_helper: vm_test_code_signing_helper.c
781*43a90889SApple OSS Distributions	$(CC) $(OTHER_CFLAGS) $(CFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) vm_test_code_signing_helper.c -o $(SYMROOT)/vm_test_code_signing_helper; \
782*43a90889SApple OSS Distributions	echo $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@; \
783*43a90889SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
784*43a90889SApple OSS Distributions
785*43a90889SApple OSS Distributionsinstall-vm_test_code_signing_helper: vm_test_code_signing_helper
786*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
787*43a90889SApple OSS Distributions	cp $(SYMROOT)/vm_test_code_signing_helper $(INSTALLDIR)/
788*43a90889SApple OSS Distributions
789*43a90889SApple OSS Distributionsvm_test_code_signing: OTHER_LDFLAGS += -ldarwintest_utils
790*43a90889SApple OSS Distributions
791*43a90889SApple OSS DistributionsINCLUDED_TEST_SOURCE_DIRS += ipc rm workq
792*43a90889SApple OSS Distributions
793*43a90889SApple OSS Distributionsinclude vm/Makefile
794*43a90889SApple OSS Distributions
795*43a90889SApple OSS Distributionsbig_map_test: CODE_SIGN_ENTITLEMENTS = ./big_map_test_entitlement.plist
796*43a90889SApple OSS Distributions
797*43a90889SApple OSS Distributionstask_info_28439149: CODE_SIGN_ENTITLEMENTS = ./task_for_pid_entitlement.plist
798*43a90889SApple OSS Distributions
799*43a90889SApple OSS Distributionsipc/ipc_read_inspect: CODE_SIGN_ENTITLEMENTS = ./task_for_pid_entitlement.plist
800*43a90889SApple OSS Distributions
801*43a90889SApple OSS Distributionsipc/ipc_thread_ports_race: CODE_SIGN_ENTITLEMENTS = ./task_for_pid_entitlement.plist
802*43a90889SApple OSS Distributionsipc/ipc_thread_ports_race: OTHER_LDFLAGS += -ldarwintest_utils
803*43a90889SApple OSS Distributions
804*43a90889SApple OSS Distributionsrm/pthread_setugid: OTHER_LDFLAGS += -ldarwintest_utils
805*43a90889SApple OSS Distributions
806*43a90889SApple OSS Distributionsproc_info: recount/recount_test_utils.c
807*43a90889SApple OSS Distributionsproc_info: CODE_SIGN_ENTITLEMENTS = ./task_for_pid_entitlement.plist
808*43a90889SApple OSS Distributionsproc_info: OTHER_LDFLAGS += -ldarwintest_utils
809*43a90889SApple OSS Distributions
810*43a90889SApple OSS Distributionsproc_info_list_kthreads: CODE_SIGN_ENTITLEMENTS = ./proc_info_list_kthreads.entitlements
811*43a90889SApple OSS Distributions
812*43a90889SApple OSS Distributionsproc_info_44873309: CODE_SIGN_ENTITLEMENTS = ./proc_info_44873309.entitlements
813*43a90889SApple OSS Distributions
814*43a90889SApple OSS Distributionsdisk_mount_conditioner: disk_mount_conditioner*
815*43a90889SApple OSS Distributionsdisk_mount_conditioner: CODE_SIGN_ENTITLEMENTS=./disk_mount_conditioner-entitlements.plist
816*43a90889SApple OSS Distributionsdisk_mount_conditioner: OTHER_LDFLAGS += -ldarwintest_utils
817*43a90889SApple OSS Distributions
818*43a90889SApple OSS Distributionsdisk_mount_conditioner: OTHER_TEST_TARGETS += disk_mount_conditioner_unentitled
819*43a90889SApple OSS Distributionsdisk_mount_conditioner_unentitled: OTHER_CFLAGS += -DTEST_UNENTITLED
820*43a90889SApple OSS Distributionsdisk_mount_conditioner_unentitled: OTHER_LDFLAGS += -ldarwintest_utils
821*43a90889SApple OSS Distributionsdisk_mount_conditioner_unentitled: disk_mount_conditioner.c
822*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
823*43a90889SApple OSS Distributions
824*43a90889SApple OSS Distributionswork_interval_test: CODE_SIGN_ENTITLEMENTS = work_interval_test.entitlements
825*43a90889SApple OSS Distributionswork_interval_test: OTHER_CFLAGS += -DENTITLED=1
826*43a90889SApple OSS Distributions
827*43a90889SApple OSS Distributionswork_interval_data_test: CODE_SIGN_ENTITLEMENTS = work_interval_test.entitlements
828*43a90889SApple OSS Distributionswork_interval_data_test: OTHER_CFLAGS += -DENTITLED=1
829*43a90889SApple OSS Distributionswork_interval_data_test: OTHER_LDFLAGS += -lpthread
830*43a90889SApple OSS Distributions
831*43a90889SApple OSS Distributionsgame_mode: CODE_SIGN_ENTITLEMENTS = game_mode.entitlements
832*43a90889SApple OSS Distributionscarplay_mode: CODE_SIGN_ENTITLEMENTS = carplay_mode.entitlements
833*43a90889SApple OSS Distributions
834*43a90889SApple OSS Distributionscoalition_policy: CODE_SIGN_ENTITLEMENTS = coalition_policy.entitlements
835*43a90889SApple OSS Distributions
836*43a90889SApple OSS Distributionssettimeofday_29193041: OTHER_CFLAGS += drop_priv.c
837*43a90889SApple OSS Distributions
838*43a90889SApple OSS Distributionssettimeofday_29193041_entitled: CODE_SIGN_ENTITLEMENTS = settimeofday_29193041.entitlements
839*43a90889SApple OSS Distributionssettimeofday_29193041_entitled: OTHER_CFLAGS += drop_priv.c
840*43a90889SApple OSS Distributions
841*43a90889SApple OSS Distributionsthread_group_set_32261625: ./stackshot-entitlements.plist
842*43a90889SApple OSS Distributionsthread_group_set_32261625: CODE_SIGN_ENTITLEMENTS=./stackshot-entitlements.plist
843*43a90889SApple OSS Distributionsthread_group_set_32261625: OTHER_LDFLAGS = -framework ktrace
844*43a90889SApple OSS Distributions
845*43a90889SApple OSS Distributionstask_info: CODE_SIGN_ENTITLEMENTS = task_for_pid_entitlement.plist
846*43a90889SApple OSS Distributionstask_info: OTHER_CFLAGS += test_utils.c
847*43a90889SApple OSS Distributionstask_info: OTHER_LDFLAGS += -ldarwintest_utils
848*43a90889SApple OSS Distributions
849*43a90889SApple OSS Distributionsextract_right_soft_fail: CODE_SIGN_ENTITLEMENTS = task_for_pid_entitlement.plist
850*43a90889SApple OSS Distributions
851*43a90889SApple OSS Distributionsifneq ($(IOS_TEST_COMPAT),YES)
852*43a90889SApple OSS Distributions	EXCLUDED_SOURCES += task_vm_info_decompressions.c
853*43a90889SApple OSS Distributionsendif
854*43a90889SApple OSS Distributions
855*43a90889SApple OSS Distributionsifeq ($(PLATFORM),MacOSX)
856*43a90889SApple OSS Distributions	EXCLUDED_SOURCES += vm/compression_sweep.c
857*43a90889SApple OSS Distributionsendif
858*43a90889SApple OSS Distributions
859*43a90889SApple OSS Distributionsunp_sock_release: CODE_SIGN_ENTITLEMENTS = unp_sock_release-entitlements.plist
860*43a90889SApple OSS Distributions
861*43a90889SApple OSS Distributionsbpf_write: bpflib.c in_cksum.c net_test_lib.c
862*43a90889SApple OSS Distributionsbpf_write: OTHER_LDFLAGS += -ldarwintest_utils
863*43a90889SApple OSS Distributions
864*43a90889SApple OSS Distributionsbpf_write_batch: bpflib.c in_cksum.c net_test_lib.c
865*43a90889SApple OSS Distributionsbpf_write_batch: OTHER_LDFLAGS += -ldarwintest_utils
866*43a90889SApple OSS Distributions
867*43a90889SApple OSS Distributionsudp_disconnect: in_cksum.c net_test_lib.c
868*43a90889SApple OSS Distributionsudp_disconnect: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
869*43a90889SApple OSS Distributions
870*43a90889SApple OSS Distributionsudp_bind_connect: in_cksum.c net_test_lib.c
871*43a90889SApple OSS Distributionsudp_bind_connect: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
872*43a90889SApple OSS Distributions
873*43a90889SApple OSS Distributionstcp_bind_connect: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
874*43a90889SApple OSS Distributionstcp_send_implied_connect: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
875*43a90889SApple OSS Distributionssocket_bind_35243417: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
876*43a90889SApple OSS Distributionssocket_bind_35685803: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
877*43a90889SApple OSS Distributionsicmp_fragmetned_payload: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
878*43a90889SApple OSS Distributionstcp_invalid_address: OTHER_CFLAGS += -Wno-int-conversion
879*43a90889SApple OSS Distributionstcp_invalid_address: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
880*43a90889SApple OSS Distributions
881*43a90889SApple OSS Distributionsnet_tuntests: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
882*43a90889SApple OSS Distributions
883*43a90889SApple OSS Distributionsnet_bridge: inet_transfer.c bpflib.c in_cksum.c net_test_lib.c
884*43a90889SApple OSS Distributionsnet_bridge: OTHER_LDFLAGS += -ldarwintest_utils
885*43a90889SApple OSS Distributionsnet_bridge: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
886*43a90889SApple OSS Distributions
887*43a90889SApple OSS Distributionsnet_vlan: inet_transfer.c bpflib.c in_cksum.c net_test_lib.c
888*43a90889SApple OSS Distributionsnet_vlan: OTHER_LDFLAGS += -ldarwintest_utils
889*43a90889SApple OSS Distributionsnet_vlan: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
890*43a90889SApple OSS Distributions
891*43a90889SApple OSS Distributionsnet_bond: inet_transfer.c bpflib.c in_cksum.c net_test_lib.c
892*43a90889SApple OSS Distributionsnet_bond: OTHER_LDFLAGS += -ldarwintest_utils
893*43a90889SApple OSS Distributionsnet_bond: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
894*43a90889SApple OSS Distributions
895*43a90889SApple OSS Distributionsif_generation_id: net_test_lib.c in_cksum.c
896*43a90889SApple OSS Distributionsif_generation_id: OTHER_LDFLAGS += -ldarwintest_utils
897*43a90889SApple OSS Distributions
898*43a90889SApple OSS Distributionsinet6_addr_mode: net_test_lib.c in_cksum.c
899*43a90889SApple OSS Distributionsinet6_addr_mode: OTHER_LDFLAGS += -ldarwintest_utils
900*43a90889SApple OSS Distributions
901*43a90889SApple OSS Distributionsbpf_direction: bpflib.c
902*43a90889SApple OSS Distributionsbpf_direction: OTHER_LDFLAGS += -ldarwintest_utils
903*43a90889SApple OSS Distributionsbpf_direction: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
904*43a90889SApple OSS Distributions
905*43a90889SApple OSS Distributionsbpf_timestamp: bpflib.c
906*43a90889SApple OSS Distributionsbpf_timestamp: OTHER_LDFLAGS += -ldarwintest_utils
907*43a90889SApple OSS Distributionsbpf_timestamp: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
908*43a90889SApple OSS Distributions
909*43a90889SApple OSS Distributionsipv6_bind_race: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
910*43a90889SApple OSS Distributions
911*43a90889SApple OSS Distributionsso_bindtodevice: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
912*43a90889SApple OSS Distributions
913*43a90889SApple OSS Distributionsv4mappedv6_dontfrag: net_test_lib.c in_cksum.c
914*43a90889SApple OSS Distributionsv4mappedv6_dontfrag: OTHER_LDFLAGS += -ldarwintest_utils
915*43a90889SApple OSS Distributionsv4mappedv6_dontfrag: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
916*43a90889SApple OSS Distributions
917*43a90889SApple OSS Distributionsnetwork_elevated_logging: CODE_SIGN_ENTITLEMENTS = entitlements/network_elevated_logging.entitlements
918*43a90889SApple OSS Distributions
919*43a90889SApple OSS DistributionsCUSTOM_TARGETS += posix_spawn_archpref_helper
920*43a90889SApple OSS Distributions
921*43a90889SApple OSS Distributionsposix_spawn_archpref_helper: posix_spawn_archpref_helper.c
922*43a90889SApple OSS Distributions	$(CC) $(LDFLAGS) $(CFLAGS) posix_spawn_archpref_helper.c -o $(SYMROOT)/$@;
923*43a90889SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
924*43a90889SApple OSS Distributions
925*43a90889SApple OSS Distributionsinstall-posix_spawn_archpref_helper: posix_spawn_archpref_helper
926*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
927*43a90889SApple OSS Distributions	cp $(SYMROOT)/posix_spawn_archpref_helper $(INSTALLDIR)/
928*43a90889SApple OSS Distributions
929*43a90889SApple OSS DistributionsCUSTOM_TARGETS += posix_spawn_alt_rosetta_helper
930*43a90889SApple OSS Distributions
931*43a90889SApple OSS Distributionsposix_spawn_alt_rosetta_helper: posix_spawn_alt_rosetta_helper.c
932*43a90889SApple OSS Distributions	$(CC) $(LDFLAGS) $(CFLAGS) posix_spawn_alt_rosetta_helper.c -o $(SYMROOT)/$@;
933*43a90889SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
934*43a90889SApple OSS Distributions
935*43a90889SApple OSS Distributionsinstall-posix_spawn_alt_rosetta_helper: posix_spawn_alt_rosetta_helper
936*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
937*43a90889SApple OSS Distributions	cp $(SYMROOT)/posix_spawn_alt_rosetta_helper $(INSTALLDIR)/
938*43a90889SApple OSS Distributions
939*43a90889SApple OSS DistributionsMIG:=SDKROOT=$(SDKROOT) $(shell xcrun -sdk "$(TARGETSDK)" -find mig)
940*43a90889SApple OSS Distributions
941*43a90889SApple OSS DistributionsCUSTOM_TARGETS += excserver
942*43a90889SApple OSS Distributions
943*43a90889SApple OSS Distributionsexcserver:
944*43a90889SApple OSS Distributions	$(MIG) $(CFLAGS) \
945*43a90889SApple OSS Distributions		-sheader $(OBJROOT)/excserver.h \
946*43a90889SApple OSS Distributions		-server $(OBJROOT)/excserver.c \
947*43a90889SApple OSS Distributions		-header /dev/null -user /dev/null \
948*43a90889SApple OSS Distributions		excserver.defs
949*43a90889SApple OSS Distributionsinstall-excserver: ;
950*43a90889SApple OSS Distributions
951*43a90889SApple OSS Distributionsexcserver_protect:
952*43a90889SApple OSS Distributions	$(MIG) $(CFLAGS) \
953*43a90889SApple OSS Distributions		-DMACH_EXC_SERVER_TASKIDTOKEN \
954*43a90889SApple OSS Distributions		-sheader $(OBJROOT)/excserver_protect.h \
955*43a90889SApple OSS Distributions		-server $(OBJROOT)/excserver_protect.c \
956*43a90889SApple OSS Distributions		-header /dev/null -user /dev/null \
957*43a90889SApple OSS Distributions		excserver_protect.defs
958*43a90889SApple OSS Distributionsinstall-excserver_protect: ;
959*43a90889SApple OSS Distributions
960*43a90889SApple OSS Distributionsexcserver_protect_state:
961*43a90889SApple OSS Distributions	$(MIG) $(CFLAGS) \
962*43a90889SApple OSS Distributions		-DMACH_EXC_SERVER_TASKIDTOKEN_STATE \
963*43a90889SApple OSS Distributions		-DMACH_EXC_SERVER_TASKIDTOKEN \
964*43a90889SApple OSS Distributions		-sheader $(OBJROOT)/excserver_protect_state.h \
965*43a90889SApple OSS Distributions		-server $(OBJROOT)/excserver_protect_state.c \
966*43a90889SApple OSS Distributions		-header /dev/null -user /dev/null \
967*43a90889SApple OSS Distributions		excserver_protect.defs
968*43a90889SApple OSS Distributionsinstall-excserver_protect_state: ;
969*43a90889SApple OSS Distributions
970*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += exc_helpers.c
971*43a90889SApple OSS Distributions
972*43a90889SApple OSS DistributionsCUSTOM_TARGETS += notifyserver
973*43a90889SApple OSS Distributions
974*43a90889SApple OSS Distributionsnotifyserver:
975*43a90889SApple OSS Distributions	$(MIG) $(CFLAGS) \
976*43a90889SApple OSS Distributions		-user /dev/null \
977*43a90889SApple OSS Distributions		-header $(OBJROOT)/notify.h \
978*43a90889SApple OSS Distributions		-sheader $(OBJROOT)/notifyServer.h \
979*43a90889SApple OSS Distributions		-server $(OBJROOT)/notifyServer.c \
980*43a90889SApple OSS Distributions		notifyserver.defs
981*43a90889SApple OSS Distributionsinstall-notifyserver: ;
982*43a90889SApple OSS Distributions
983*43a90889SApple OSS DistributionsCUSTOM_TARGETS += rnserver
984*43a90889SApple OSS Distributions
985*43a90889SApple OSS Distributionsrnserver:
986*43a90889SApple OSS Distributions	$(MIG) $(CFLAGS) \
987*43a90889SApple OSS Distributions		-user /dev/null \
988*43a90889SApple OSS Distributions		-header $(OBJROOT)/rn.h \
989*43a90889SApple OSS Distributions		-sheader $(OBJROOT)/rnServer.h \
990*43a90889SApple OSS Distributions		-server $(OBJROOT)/rnServer.c \
991*43a90889SApple OSS Distributions		rnserver.defs
992*43a90889SApple OSS Distributionsinstall-rnserver: ;
993*43a90889SApple OSS Distributions
994*43a90889SApple OSS DistributionsSKYWALK_COMMON_FILES := \
995*43a90889SApple OSS Distributions	skywalk/skywalk_test_common.c \
996*43a90889SApple OSS Distributions	skywalk/skywalk_test_utils.c
997*43a90889SApple OSS DistributionsSKYWALK_TEST_FILES := \
998*43a90889SApple OSS Distributions	skywalk/skywalk_test_driver.c \
999*43a90889SApple OSS Distributions	skywalk/skt_simple.c \
1000*43a90889SApple OSS Distributions	skywalk/skt_features.c \
1001*43a90889SApple OSS Distributions	skywalk/skt_oneslot.c \
1002*43a90889SApple OSS Distributions	skywalk/skt_shutdown.c \
1003*43a90889SApple OSS Distributions	skywalk/skt_shutdown2.c \
1004*43a90889SApple OSS Distributions	skywalk/skt_nslots.c \
1005*43a90889SApple OSS Distributions	skywalk/skt_closecfd.c \
1006*43a90889SApple OSS Distributions	skywalk/skt_closenfd.c \
1007*43a90889SApple OSS Distributions	skywalk/skt_badring.c \
1008*43a90889SApple OSS Distributions	skywalk/skt_kqueue.c \
1009*43a90889SApple OSS Distributions	skywalk/skt_mangle.c \
1010*43a90889SApple OSS Distributions	skywalk/skt_features.c \
1011*43a90889SApple OSS Distributions	skywalk/skt_ringid.c \
1012*43a90889SApple OSS Distributions	skywalk/skt_closekq.c \
1013*43a90889SApple OSS Distributions	skywalk/skt_writemem.c \
1014*43a90889SApple OSS Distributions	skywalk/skt_debug_verify.c \
1015*43a90889SApple OSS Distributions	skywalk/skt_utun27302538.c \
1016*43a90889SApple OSS Distributions	skywalk/skt_utunleak.c \
1017*43a90889SApple OSS Distributions	skywalk/skt_utunloop.c \
1018*43a90889SApple OSS Distributions	skywalk/skt_flowswitch_ns_reserve.c \
1019*43a90889SApple OSS Distributions	skywalk/skt_netifcompat.c \
1020*43a90889SApple OSS Distributions	skywalk/skt_fswloop.c \
1021*43a90889SApple OSS Distributions	skywalk/skt_teardown.c \
1022*43a90889SApple OSS Distributions	skywalk/skt_bind.c \
1023*43a90889SApple OSS Distributions	skywalk/skt_fsw29301703.c \
1024*43a90889SApple OSS Distributions	skywalk/skt_fswbinds.c \
1025*43a90889SApple OSS Distributions	skywalk/skt_manyflows.c \
1026*43a90889SApple OSS Distributions	skywalk/skt_pllupipe.c \
1027*43a90889SApple OSS Distributions	skywalk/skt_fullupipe.c \
1028*43a90889SApple OSS Distributions	skywalk/skt_listener.c \
1029*43a90889SApple OSS Distributions	skywalk/skt_copy_cksum.c \
1030*43a90889SApple OSS Distributions	skywalk/skt_reass.c \
1031*43a90889SApple OSS Distributions	skywalk/skt_memory.c \
1032*43a90889SApple OSS Distributions	skywalk/skt_flow.c \
1033*43a90889SApple OSS Distributions	skywalk/skt_flowlookup.c \
1034*43a90889SApple OSS Distributions	skywalk/skt_libcuckoo.c \
1035*43a90889SApple OSS Distributions	skywalk/skt_restricted_port.c \
1036*43a90889SApple OSS Distributions	skywalk/skt_steering.c
1037*43a90889SApple OSS DistributionsSKYWALK_MPTEST_FILES := \
1038*43a90889SApple OSS Distributions	skywalk/skywalk_mptests.c \
1039*43a90889SApple OSS Distributions	skywalk/skywalk_mptest_driver.c \
1040*43a90889SApple OSS Distributions	skywalk/skt_mpsimple.c \
1041*43a90889SApple OSS Distributions	skywalk/skt_mpprotons.c \
1042*43a90889SApple OSS Distributions	skywalk/skt_xfer.c \
1043*43a90889SApple OSS Distributions	skywalk/skt_netifdirect.c \
1044*43a90889SApple OSS Distributions	skywalk/skt_filter.c
1045*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += $(SKYWALK_COMMON_FILES) $(SKYWALK_TEST_FILES) $(SKYWALK_MPTEST_FILES)
1046*43a90889SApple OSS Distributions
1047*43a90889SApple OSS Distributionsskywalk_tests: excserver
1048*43a90889SApple OSS Distributionsskywalk_tests: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
1049*43a90889SApple OSS Distributionsskywalk_tests: CODE_SIGN_ENTITLEMENTS = skywalk_test.entitlements
1050*43a90889SApple OSS Distributionsskywalk_tests: $(SKYWALK_COMMON_FILES) $(SKYWALK_TEST_FILES) $(SKYWALK_MPTEST_FILES) $(SDKROOT)/usr/local/lib/libCrashReporterClient.a
1051*43a90889SApple OSS Distributions
1052*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += arm_matrix_sme.c
1053*43a90889SApple OSS Distributions
1054*43a90889SApple OSS Distributionsarm_matrix: INVALID_ARCHS = $(filter-out arm64%,$(ARCH_CONFIGS))
1055*43a90889SApple OSS Distributionsarm_matrix: excserver exc_helpers.c arm_matrix_sme.c
1056*43a90889SApple OSS Distributionsarm_matrix: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT) -Wno-language-extension-token -Wno-c++98-compat -mcpu=firestorm+nofp+sme2
1057*43a90889SApple OSS Distributionsarm_matrix: CODE_SIGN_ENTITLEMENTS = arm_matrix.entitlements
1058*43a90889SApple OSS Distributions
1059*43a90889SApple OSS Distributions
1060*43a90889SApple OSS Distributionsx18_entitled: OTHER_CFLAGS += -Wno-language-extension-token
1061*43a90889SApple OSS Distributionsx18_entitled: CODE_SIGN_ENTITLEMENTS = x18-entitlements.plist
1062*43a90889SApple OSS Distributionsx18_unentitled: OTHER_CFLAGS += -Wno-language-extension-token
1063*43a90889SApple OSS Distributionsifneq ($(PLATFORM),MacOSX)
1064*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += x18_legacy.c
1065*43a90889SApple OSS Distributionselse
1066*43a90889SApple OSS Distributionsx18_legacy: OTHER_CFLAGS += -Wno-language-extension-token -Wl,-platform_version -Wl,macos -Wl,10.12 -Wl,10.12
1067*43a90889SApple OSS Distributionsendif
1068*43a90889SApple OSS Distributions
1069*43a90889SApple OSS Distributionsifeq ($(findstring arm64,$(ARCH_CONFIGS)),)
1070*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += apple_generic_timer.c apple_generic_timer_legacy.c
1071*43a90889SApple OSS Distributionselse
1072*43a90889SApple OSS Distributionsapple_generic_timer: INVALID_ARCHS = armv7k x86_64 x86_64h
1073*43a90889SApple OSS Distributions
1074*43a90889SApple OSS Distributionsapple_generic_timer_legacy: INVALID_ARCHS = armv7k x86_64 x86_64h
1075*43a90889SApple OSS Distributionsifeq ($(PLATFORM),MacOSX)
1076*43a90889SApple OSS Distributionsapple_generic_timer_legacy: OTHER_CFLAGS += -Wl,-platform_version,macos,14.6,14.6
1077*43a90889SApple OSS Distributionselse ifeq ($(PLATFORM),iPhoneOS)
1078*43a90889SApple OSS Distributionsapple_generic_timer_legacy: OTHER_CFLAGS += -Wl,-platform_version,ios,14.6,14.6
1079*43a90889SApple OSS Distributionselse ifeq ($(PLATFORM),tvOS)
1080*43a90889SApple OSS Distributionsapple_generic_timer_legacy: OTHER_CFLAGS += -Wl,-platform_version,tvos,14.6,14.6
1081*43a90889SApple OSS Distributionselse ifeq ($(PLATFORM),WatchOS)
1082*43a90889SApple OSS Distributionsapple_generic_timer_legacy: OTHER_CFLAGS += -Wl,-platform_version,watchos,10.6,10.6
1083*43a90889SApple OSS Distributionselse
1084*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += apple_generic_timer_legacy.c
1085*43a90889SApple OSS Distributionsendif
1086*43a90889SApple OSS Distributions
1087*43a90889SApple OSS Distributionsifneq ($(PLATFORM),MacOSX)
1088*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += apple_generic_timer_vmm.c
1089*43a90889SApple OSS Distributionselse
1090*43a90889SApple OSS Distributionsapple_generic_timer_vmm: INVALID_ARCHS = armv7k x86_64 x86_64h
1091*43a90889SApple OSS Distributionsapple_generic_timer_vmm: CODE_SIGN_ENTITLEMENTS = hv_private.entitlements
1092*43a90889SApple OSS Distributionsendif
1093*43a90889SApple OSS Distributions
1094*43a90889SApple OSS Distributionsendif
1095*43a90889SApple OSS Distributions
1096*43a90889SApple OSS Distributionspmap_bench: INVALID_ARCHS = $(filter-out arm%,$(ARCH_CONFIGS))
1097*43a90889SApple OSS Distributions
1098*43a90889SApple OSS Distributionspmap_stress: INVALID_ARCHS = $(filter-out arm%,$(ARCH_CONFIGS))
1099*43a90889SApple OSS Distributions
1100*43a90889SApple OSS Distributionshw_breakpoint_step_arm64: CODE_SIGN_ENTITLEMENTS = hw_breakpoint_step_arm64_entitlements.plist
1101*43a90889SApple OSS Distributionshw_breakpoint_step_arm64: INVALID_ARCHS = $(filter-out arm64%,$(ARCH_CONFIGS))
1102*43a90889SApple OSS Distributionshw_breakpoint_step_arm64: excserver
1103*43a90889SApple OSS Distributionshw_breakpoint_step_arm64: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
1104*43a90889SApple OSS Distributions
1105*43a90889SApple OSS Distributionsexc_resource_threads: excserver
1106*43a90889SApple OSS Distributionsexc_resource_threads: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
1107*43a90889SApple OSS Distributionsexc_resource_threads: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
1108*43a90889SApple OSS Distributions
1109*43a90889SApple OSS Distributionsmach_service_port: notifyserver
1110*43a90889SApple OSS Distributionsmach_service_port: OTHER_CFLAGS += $(OBJROOT)/notifyServer.c -I $(OBJROOT)
1111*43a90889SApple OSS Distributions
1112*43a90889SApple OSS Distributionsfp_exception: excserver exc_helpers.c
1113*43a90889SApple OSS Distributionsfp_exception: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
1114*43a90889SApple OSS Distributionsfp_exception: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
1115*43a90889SApple OSS Distributions
1116*43a90889SApple OSS Distributionsptrauth_failure: excserver exc_helpers.c
1117*43a90889SApple OSS Distributionsptrauth_failure: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT) -Wno-language-extension-token
1118*43a90889SApple OSS Distributionsptrauth_failure: CODESIGN = $(CODESIGN_HARDENED_RUNTIME)
1119*43a90889SApple OSS Distributionsptrauth_failure: CODE_SIGN_ENTITLEMENTS = entitlements/set_state_and_exception_port.entitlement
1120*43a90889SApple OSS Distributions
1121*43a90889SApple OSS Distributionsdecompression_failure: excserver exc_helpers.c
1122*43a90889SApple OSS Distributionsdecompression_failure: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
1123*43a90889SApple OSS Distributionsdecompression_failure: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
1124*43a90889SApple OSS Distributions
1125*43a90889SApple OSS Distributionsipc/kernel_signed_pac_thread_state: excserver
1126*43a90889SApple OSS Distributionsipc/kernel_signed_pac_thread_state: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
1127*43a90889SApple OSS Distributionsipc/kernel_signed_pac_thread_state: CODE_SIGN_ENTITLEMENTS = pac_exception_entitlement.plist
1128*43a90889SApple OSS Distributions
1129*43a90889SApple OSS Distributionsifeq ($(findstring arm64e,$(ARCH_CONFIGS)),)
1130*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += pac_exception_entitlement.c
1131*43a90889SApple OSS Distributionselse
1132*43a90889SApple OSS Distributionspac_exception_entitlement: excserver exc_helpers.c
1133*43a90889SApple OSS Distributionspac_exception_entitlement: OTHER_CFLAGS += $(OBJROOT)/excserver.c -Wno-language-extension-token
1134*43a90889SApple OSS Distributionspac_exception_entitlement: CODE_SIGN_ENTITLEMENTS = pac_exception_entitlement.plist
1135*43a90889SApple OSS Distributionsendif
1136*43a90889SApple OSS Distributions
1137*43a90889SApple OSS Distributionsunrecoverable_trap_test: excserver exc_helpers.c
1138*43a90889SApple OSS Distributionsunrecoverable_trap_test: OTHER_CFLAGS += $(OBJROOT)/excserver.c -Wno-language-extension-token
1139*43a90889SApple OSS Distributionsunrecoverable_trap_test: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
1140*43a90889SApple OSS Distributions# libdarwintest.a doesn't have an arm64 slice on watchOS
1141*43a90889SApple OSS Distributionsifeq ($(PLATFORM),WatchOS)
1142*43a90889SApple OSS Distributionsunrecoverable_trap_test: INVALID_ARCHS += arm64
1143*43a90889SApple OSS Distributionsendif
1144*43a90889SApple OSS Distributions
1145*43a90889SApple OSS Distributionsifeq ($(findstring arm64,$(ARCH_CONFIGS)),)
1146*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += arm_cpu_capabilities.c
1147*43a90889SApple OSS Distributionselse
1148*43a90889SApple OSS Distributionsarm_cpu_capabilities: INVALID_ARCHS = armv7k x86_64 x86_64h
1149*43a90889SApple OSS Distributionsarm_cpu_capabilities: excserver exc_helpers.c
1150*43a90889SApple OSS Distributionsarm_cpu_capabilities: OTHER_CFLAGS += $(OBJROOT)/excserver.c -Wno-language-extension-token -mcpu=apple-a15
1151*43a90889SApple OSS Distributions#if HAS_ARM_FEAT_SME
1152*43a90889SApple OSS Distributionsarm_cpu_capabilities: OTHER_CFLAGS += -mcpu=apple-a15+sme2
1153*43a90889SApple OSS Distributions#endif
1154*43a90889SApple OSS Distributions# Including PrivateHeaders from both Kernel.framework and System.framework makes
1155*43a90889SApple OSS Distributions# a mess out of the Mach headers we need to build exception handling support.
1156*43a90889SApple OSS Distributions# Work around this by only including the arm/ directory.
1157*43a90889SApple OSS Distributionsarm_cpu_capabilities: OTHER_CFLAGS += -isystem $(SDKROOT)/System/Library/Frameworks/Kernel.framework/PrivateHeaders/arm
1158*43a90889SApple OSS Distributionsarm_cpu_capabilities: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
1159*43a90889SApple OSS Distributionsendif
1160*43a90889SApple OSS Distributions
1161*43a90889SApple OSS Distributions# Disabling building of ldt files as dt_extractmeta crashes
1162*43a90889SApple OSS Distributions# in build systems. Ref rdar://110251082
1163*43a90889SApple OSS Distributions# Leaving commented bits for future re-enablement
1164*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += ldt_code32.s ldt.c
1165*43a90889SApple OSS Distributions
1166*43a90889SApple OSS Distributions#\ifeq ($(findstring x86_64,$(ARCH_CONFIGS)),)
1167*43a90889SApple OSS Distributions#EXCLUDED_SOURCES += ldt_code32.s ldt.c
1168*43a90889SApple OSS Distributions#\else # target = osx
1169*43a90889SApple OSS Distributions#$(OBJROOT)/ldt_mach_exc_server.c:
1170*43a90889SApple OSS Distributions#	$(MIG) $(CFLAGS) \
1171*43a90889SApple OSS Distributions#		-user /dev/null \
1172*43a90889SApple OSS Distributions#		-server $(OBJROOT)/ldt_mach_exc_server.c \
1173*43a90889SApple OSS Distributions#		-header $(OBJROOT)/ldt_mach_exc.h \
1174*43a90889SApple OSS Distributions#		mach_exc.defs
1175*43a90889SApple OSS Distributions#
1176*43a90889SApple OSS Distributions#ldt: INVALID_ARCHS = $(ARCH_CONFIGS)
1177*43a90889SApple OSS Distributions#ldt: $(OBJROOT)/ldt_mach_exc_server.c
1178*43a90889SApple OSS Distributions#ldt: OTHER_CFLAGS += -arch x86_64 -I $(OBJROOT) $(SRCROOT)/ldt_code32.s -Wl,-pagezero_size,0x1000 -Wno-missing-variable-declarations
1179*43a90889SApple OSS Distributions#ldt: CODE_SIGN_ENTITLEMENTS=ldt_entitlement.plist
1180*43a90889SApple OSS Distributions#\endif
1181*43a90889SApple OSS Distributions
1182*43a90889SApple OSS Distributionsifneq ($(PLATFORM),BridgeOS)
1183*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += remote_time.c
1184*43a90889SApple OSS Distributionselse
1185*43a90889SApple OSS Distributionsremote_time: INVALID_ARCHS = armv7 armv7s arm64_32
1186*43a90889SApple OSS Distributionsendif
1187*43a90889SApple OSS Distributions
1188*43a90889SApple OSS Distributionsvm_phys_footprint: OTHER_LDFLAGS += -framework CoreFoundation -framework IOSurface
1189*43a90889SApple OSS Distributions
1190*43a90889SApple OSS Distributionsvm_kern_count_wired_kernelcache: OTHER_CFLAGS += -I$(SDKROOT)/System/Library/Frameworks/Kernel.framework/PrivateHeaders/mach
1191*43a90889SApple OSS Distributions
1192*43a90889SApple OSS Distributionsdebug_control_port_for_pid: CODE_SIGN_ENTITLEMENTS = ./debug_control_port_for_pid_entitlement.plist
1193*43a90889SApple OSS Distributions
1194*43a90889SApple OSS Distributionsprng: OTHER_LDFLAGS += -ldarwintest_utils
1195*43a90889SApple OSS Distributions
1196*43a90889SApple OSS Distributionspreoslog: OTHER_LDFLAGS += -ldarwintest_utils
1197*43a90889SApple OSS Distributionspreoslog: OTHER_CFLAGS += test_utils.c
1198*43a90889SApple OSS Distributions
1199*43a90889SApple OSS Distributionstask_policy: CODE_SIGN_ENTITLEMENTS = ./task_policy_entitlement.plist
1200*43a90889SApple OSS Distributions
1201*43a90889SApple OSS DistributionsOTHER_TEST_TARGETS += task_policy_unentitled
1202*43a90889SApple OSS Distributionstask_policy_unentitled: CODE_SIGN_ENTITLEMENTS = task_for_pid_entitlement.plist
1203*43a90889SApple OSS Distributionstask_policy_unentitled: OTHER_CFLAGS += -DUNENTITLED
1204*43a90889SApple OSS Distributionstask_policy_unentitled: task_policy.c
1205*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
1206*43a90889SApple OSS Distributions	$(CODESIGN) --force --sign - --timestamp=none --entitlements $(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@
1207*43a90889SApple OSS Distributions
1208*43a90889SApple OSS Distributions
1209*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += get_shared_cache_address.c
1210*43a90889SApple OSS Distributions
1211*43a90889SApple OSS Distributions
1212*43a90889SApple OSS Distributionsifneq ($(filter iPhoneOS MacOSX, $(PLATFORM)),)
1213*43a90889SApple OSS DistributionsCUSTOM_TARGETS += get_shared_cache_address
1214*43a90889SApple OSS Distributions
1215*43a90889SApple OSS Distributionsget_shared_cache_address: INVALID_ARCHS = arm64 i386 x86_64
1216*43a90889SApple OSS Distributionsget_shared_cache_address: get_shared_cache_address.c
1217*43a90889SApple OSS Distributions	$(CC) $(OTHER_CFLAGS) $(CFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/get_shared_cache_address
1218*43a90889SApple OSS Distributions
1219*43a90889SApple OSS Distributionsinstall-get_shared_cache_address: get_shared_cache_address
1220*43a90889SApple OSS Distributions	$(CODESIGN) --force --sign - --timestamp=none --identifier=com.apple.get_shared_cache_address $(SYMROOT)/get_shared_cache_address
1221*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
1222*43a90889SApple OSS Distributions	cp $(SYMROOT)/get_shared_cache_address $(INSTALLDIR)/
1223*43a90889SApple OSS Distributionsendif
1224*43a90889SApple OSS Distributions
1225*43a90889SApple OSS Distributions
1226*43a90889SApple OSS DistributionsOTHER_TEST_TARGETS += vm_memory_share_tests
1227*43a90889SApple OSS Distributions
1228*43a90889SApple OSS Distributionsvm_memory_share_tests: INVALID_ARCHS = i386
1229*43a90889SApple OSS Distributionsvm_memory_share_tests: CODE_SIGN_ENTITLEMENTS = ./task_for_pid_entitlement.plist
1230*43a90889SApple OSS Distributionsvm_memory_share_tests: vm_memory_tests_src/main.c vm_memory_tests_src/common.c vm_memory_tests_src/vm_tests.c
1231*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
1232*43a90889SApple OSS Distributions	echo $(CODESIGN) --force --sign - --timestamp=none --entitlements $(SRCROOT)/$(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@;
1233*43a90889SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements "$(SRCROOT)/$(CODE_SIGN_ENTITLEMENTS)" $(SYMROOT)/$@;
1234*43a90889SApple OSS Distributions
1235*43a90889SApple OSS Distributions# build the mach server as individual helper which does not use libdarwintest
1236*43a90889SApple OSS DistributionsCUSTOM_TARGETS += vm_memory_share_tests_server
1237*43a90889SApple OSS Distributionsvm_memory_share_tests_server: CODE_SIGN_ENTITLEMENTS = ./task_for_pid_entitlement.plist
1238*43a90889SApple OSS Distributionsvm_memory_share_tests_server: vm_memory_tests_src/server.c vm_memory_tests_src/common.c vm_memory_tests_src/vm_tests.c
1239*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/vm_memory_share_tests_server
1240*43a90889SApple OSS Distributions	echo $(CODESIGN) --force --sign - --timestamp=none --entitlements $(SRCROOT)/$(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@;
1241*43a90889SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements "$(SRCROOT)/$(CODE_SIGN_ENTITLEMENTS)" $(SYMROOT)/$@;
1242*43a90889SApple OSS Distributions
1243*43a90889SApple OSS Distributionsinstall-vm_memory_share_tests_server: vm_memory_share_tests_server
1244*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
1245*43a90889SApple OSS Distributions	cp $(SYMROOT)/vm_memory_share_tests_server $(INSTALLDIR)/
1246*43a90889SApple OSS Distributions
1247*43a90889SApple OSS Distributionsifeq ($(PLATFORM),MacOSX)
1248*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += vm/kern_max_task_pmem.c
1249*43a90889SApple OSS Distributionsendif
1250*43a90889SApple OSS Distributions
1251*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += benchmark/helpers.c
1252*43a90889SApple OSS Distributions
1253*43a90889SApple OSS Distributionsperf_vmfault: OTHER_CFLAGS += benchmark/helpers.c
1254*43a90889SApple OSS Distributions
1255*43a90889SApple OSS Distributionsvm/fault_throughput: OTHER_CFLAGS += benchmark/helpers.c
1256*43a90889SApple OSS Distributions
1257*43a90889SApple OSS Distributions.PHONY: install-vm/fault_throughput
1258*43a90889SApple OSS Distributionsinstall-vm/fault_throughput: vm/fault_throughput
1259*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)/vm
1260*43a90889SApple OSS Distributions	cp $(SYMROOT)/vm/fault_throughput $(INSTALLDIR)/vm/
1261*43a90889SApple OSS Distributions
1262*43a90889SApple OSS Distributions$(SYMROOT)/vm/fault_throughput.lua: $(SRCROOT)/vm/fault_throughput.lua
1263*43a90889SApple OSS Distributions	mkdir -p $(SYMROOT)/vm
1264*43a90889SApple OSS Distributions	cp $< $@
1265*43a90889SApple OSS Distributions	chmod +x $@
1266*43a90889SApple OSS Distributions
1267*43a90889SApple OSS Distributions.PHONY: install-fault_throughput_benchrun
1268*43a90889SApple OSS Distributionsinstall-$(SYMROOT)/vm/fault_throughput.lua: $(SYMROOT)/vm/fault_throughput.lua
1269*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)/vm
1270*43a90889SApple OSS Distributions	cp $(SYMROOT)/vm/fault_throughput.lua $(INSTALLDIR)/vm/
1271*43a90889SApple OSS Distributions	chmod +x $(INSTALLDIR)/vm/fault_throughput.lua
1272*43a90889SApple OSS Distributions
1273*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += vm/fault_throughput.plist
1274*43a90889SApple OSS Distributions
1275*43a90889SApple OSS DistributionsCUSTOM_TARGETS += $(SYMROOT)/vm/fault_throughput.lua vm/fault_throughput
1276*43a90889SApple OSS Distributions
1277*43a90889SApple OSS Distributionsifeq ($(PLATFORM),MacOSX)
1278*43a90889SApple OSS Distributionsmixed_pagesize: vm/mixed_pagesize.c
1279*43a90889SApple OSS Distributions	mkdir -p $(SYMROOT)/vm
1280*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/vm/$@
1281*43a90889SApple OSS Distributions
1282*43a90889SApple OSS Distributionsinstall-mixed_pagesize: mixed_pagesize
1283*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)/vm
1284*43a90889SApple OSS Distributions	cp $(SYMROOT)/vm/mixed_pagesize $(INSTALLDIR)/vm/
1285*43a90889SApple OSS Distributions
1286*43a90889SApple OSS DistributionsBATS_PLISTS += $(SRCROOT)/vm/mixed_pagesize.plist
1287*43a90889SApple OSS Distributions
1288*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += vm/mixed_pagesize.c vm/mixed_pagesize.plist
1289*43a90889SApple OSS DistributionsCUSTOM_TARGETS += mixed_pagesize
1290*43a90889SApple OSS Distributionselse
1291*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += vm/mixed_pagesize.c vm/mixed_pagesize.plist
1292*43a90889SApple OSS Distributionsendif
1293*43a90889SApple OSS Distributions
1294*43a90889SApple OSS Distributionsmanual_wq_cooperative: manual_wq_cooperative.c
1295*43a90889SApple OSS Distributions	mkdir -p $(SYMROOT)
1296*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
1297*43a90889SApple OSS Distributions
1298*43a90889SApple OSS Distributionsinstall-manual_wq_cooperative: manual_wq_cooperative
1299*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
1300*43a90889SApple OSS Distributions	cp $(SYMROOT)/manual_wq_cooperative $(INSTALLDIR)
1301*43a90889SApple OSS Distributions
1302*43a90889SApple OSS DistributionsBATS_PLISTS += $(SRCROOT)/workqueue.plist
1303*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += manual_wq_cooperative.c workqueue.plist
1304*43a90889SApple OSS DistributionsCUSTOM_TARGETS += manual_wq_cooperative
1305*43a90889SApple OSS Distributions
1306*43a90889SApple OSS Distributions# VM madvise(2) benchmark
1307*43a90889SApple OSS Distributions
1308*43a90889SApple OSS DistributionsBATS_PLISTS += $(SRCROOT)/vm/perf_madvise.plist
1309*43a90889SApple OSS Distributions
1310*43a90889SApple OSS Distributionsvm/perf_madvise: OTHER_CFLAGS += benchmark/helpers.c
1311*43a90889SApple OSS Distributions
1312*43a90889SApple OSS Distributions.PHONY: install-vm/perf_madvise
1313*43a90889SApple OSS Distributionsinstall-vm/perf_madvise: vm/perf_madvise
1314*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)/vm
1315*43a90889SApple OSS Distributions	cp $(SYMROOT)/vm/perf_madvise $(INSTALLDIR)/vm/
1316*43a90889SApple OSS Distributions
1317*43a90889SApple OSS Distributions$(SYMROOT)/vm/perf_madvise.lua: $(SRCROOT)/vm/perf_madvise.lua
1318*43a90889SApple OSS Distributions	mkdir -p $(SYMROOT)/vm
1319*43a90889SApple OSS Distributions	cp $< $@
1320*43a90889SApple OSS Distributions	chmod +x $@
1321*43a90889SApple OSS Distributions
1322*43a90889SApple OSS Distributions.PHONY: install-perf_madvise_benchrun
1323*43a90889SApple OSS Distributionsinstall-$(SYMROOT)/vm/perf_madvise.lua: $(SYMROOT)/vm/perf_madvise.lua
1324*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)/vm
1325*43a90889SApple OSS Distributions	cp $(SYMROOT)/vm/perf_madvise.lua $(INSTALLDIR)/vm
1326*43a90889SApple OSS Distributions	chmod +x $(INSTALLDIR)/vm/perf_madvise.lua
1327*43a90889SApple OSS Distributions
1328*43a90889SApple OSS DistributionsCUSTOM_TARGETS += $(SYMROOT)/vm/perf_madvise.lua vm/perf_madvise
1329*43a90889SApple OSS Distributions
1330*43a90889SApple OSS DistributionsBATS_PLISTS += $(SRCROOT)/vm/perf_compressor.plist
1331*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += vm/perf_compressor.plist
1332*43a90889SApple OSS Distributions
1333*43a90889SApple OSS Distributionsvm/perf_compressor: OTHER_CFLAGS += benchmark/helpers.c
1334*43a90889SApple OSS Distributions
1335*43a90889SApple OSS Distributions.PHONY: install-vm/perf_compressor
1336*43a90889SApple OSS Distributionsinstall-vm/perf_compressor: vm/perf_compressor
1337*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)/vm
1338*43a90889SApple OSS Distributions	cp $(SYMROOT)/vm/perf_compressor $(INSTALLDIR)/vm/
1339*43a90889SApple OSS Distributions
1340*43a90889SApple OSS Distributions$(SYMROOT)/vm/perf_compressor.lua: $(SRCROOT)/vm/perf_compressor.lua
1341*43a90889SApple OSS Distributions	mkdir -p $(SYMROOT)/vm
1342*43a90889SApple OSS Distributions	cp $< $@
1343*43a90889SApple OSS Distributions	chmod +x $@
1344*43a90889SApple OSS Distributions
1345*43a90889SApple OSS Distributions.PHONY: install-$(SYMROOT)/vm/perf_compressor_benchrun
1346*43a90889SApple OSS Distributionsinstall-$(SYMROOT)/vm/perf_compressor.lua: $(SYMROOT)/vm/perf_compressor.lua
1347*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)/vm
1348*43a90889SApple OSS Distributions	cp $(SYMROOT)/vm/perf_compressor.lua $(INSTALLDIR)/vm/
1349*43a90889SApple OSS Distributions	chmod +x $(INSTALLDIR)/vm/perf_compressor.lua
1350*43a90889SApple OSS Distributions
1351*43a90889SApple OSS DistributionsCUSTOM_TARGETS += $(SYMROOT)/vm/perf_compressor.lua vm/perf_compressor
1352*43a90889SApple OSS Distributions
1353*43a90889SApple OSS Distributionsioconnectasyncmethod_57641955: OTHER_LDFLAGS += -framework IOKit
1354*43a90889SApple OSS Distributions
1355*43a90889SApple OSS Distributionsifeq ($(PLATFORM),BridgeOS)
1356*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += ipsec.m
1357*43a90889SApple OSS Distributionselse
1358*43a90889SApple OSS Distributionsipsec: OTHER_LDFLAGS += -framework Foundation -framework CoreFoundation -framework NetworkExtension
1359*43a90889SApple OSS Distributionsipsec: CODE_SIGN_ENTITLEMENTS = ipsec.entitlements
1360*43a90889SApple OSS Distributionsendif
1361*43a90889SApple OSS Distributions
1362*43a90889SApple OSS Distributionstest_sysctl_kern_procargs_25397314: OTHER_LDFLAGS += -framework Foundation -ldarwintest_utils
1363*43a90889SApple OSS Distributions
1364*43a90889SApple OSS DistributionsINCLUDED_TEST_SOURCE_DIRS += counter
1365*43a90889SApple OSS Distributions
1366*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += counter/common.c
1367*43a90889SApple OSS Distributionscounter/counter: OTHER_CFLAGS += counter/common.c test_utils.c
1368*43a90889SApple OSS Distributionscounter/counter: OTHER_LDFLAGS += -ldarwintest_utils -ldarwintest
1369*43a90889SApple OSS Distributions
1370*43a90889SApple OSS Distributionscounter/benchmark: OTHER_CFLAGS += counter/common.c benchmark/helpers.c
1371*43a90889SApple OSS Distributions
1372*43a90889SApple OSS Distributions.PHONY: install-counter/benchmark
1373*43a90889SApple OSS Distributionsinstall-counter/benchmark: counter/benchmark
1374*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)/counter
1375*43a90889SApple OSS Distributions	cp $(SYMROOT)/counter/benchmark $(INSTALLDIR)/counter/
1376*43a90889SApple OSS Distributions
1377*43a90889SApple OSS Distributions$(SYMROOT)/counter/benchmark.lua: $(SRCROOT)/counter/benchmark.lua
1378*43a90889SApple OSS Distributions	mkdir -p $(SYMROOT)/counter
1379*43a90889SApple OSS Distributions	cp $< $@
1380*43a90889SApple OSS Distributions	chmod +x $@
1381*43a90889SApple OSS Distributions
1382*43a90889SApple OSS Distributions.PHONY: install-counter_benchrun
1383*43a90889SApple OSS Distributionsinstall-$(SYMROOT)/counter/benchmark.lua: $(SYMROOT)/counter/benchmark.lua
1384*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)/counter
1385*43a90889SApple OSS Distributions	cp $(SYMROOT)/counter/benchmark.lua $(INSTALLDIR)/counter/
1386*43a90889SApple OSS Distributions	chmod +x $(INSTALLDIR)/counter/benchmark.lua
1387*43a90889SApple OSS Distributions
1388*43a90889SApple OSS DistributionsCUSTOM_TARGETS += $(SYMROOT)/counter/benchmark.lua counter/benchmark
1389*43a90889SApple OSS Distributions
1390*43a90889SApple OSS Distributionsifneq ($(PLATFORM),MacOSX)
1391*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += vm/page_size_globals.c
1392*43a90889SApple OSS Distributionselse
1393*43a90889SApple OSS Distributionsvm/page_size_globals: INVALID_ARCHS = arm64 arm64e
1394*43a90889SApple OSS Distributionsendif
1395*43a90889SApple OSS Distributions
1396*43a90889SApple OSS Distributions# Same helper used in execperf, different build system.
1397*43a90889SApple OSS Distributionsstatic_binary: ../tools/tests/execperf/exit-asm.S
1398*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(CFLAGS) $(filter-out -l%,$(DT_LDFLAGS) $(LDFLAGS) $(OTHER_LDFLAGS)) $< -o $(SYMROOT)/static_binary -static -nostartfiles -nodefaultlibs -Wl,-version_load_command -Wl,-segalign,0x4000 -e _main
1399*43a90889SApple OSS Distributions	CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/static_binary
1400*43a90889SApple OSS Distributions
1401*43a90889SApple OSS Distributionsinstall-static_binary: static_binary
1402*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
1403*43a90889SApple OSS Distributions	cp $(SYMROOT)/static_binary $(INSTALLDIR)
1404*43a90889SApple OSS Distributions
1405*43a90889SApple OSS DistributionsCUSTOM_TARGETS += static_binary
1406*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += static_binary.c
1407*43a90889SApple OSS Distributions
1408*43a90889SApple OSS Distributionstest_static_binary_csflags: static_binary
1409*43a90889SApple OSS Distributionstest_static_binary_csflags: OTHER_LDFLAGS += -ldarwintest_utils
1410*43a90889SApple OSS Distributions
1411*43a90889SApple OSS Distributions
1412*43a90889SApple OSS Distributionslibmalloc_apple_array: CODE_SIGN_ENTITLEMENTS = entitlements/libmalloc_apple_array.entitlements
1413*43a90889SApple OSS Distributionslibmalloc_apple_array: OTHER_CFLAGS += -DENTITLED=1 drop_priv.c test_utils.c
1414*43a90889SApple OSS Distributionslibmalloc_apple_array: OTHER_LDFLAGS += -ldarwintest_utils
1415*43a90889SApple OSS Distributionslibmalloc_apple_array: libmalloc_apple_array.c print_apple_array print_apple_array_HR1 print_apple_array_HR2 print_apple_array_hardened_proc print_apple_array_hardened_heap
1416*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
1417*43a90889SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements $(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@;
1418*43a90889SApple OSS Distributions
1419*43a90889SApple OSS Distributionslibmalloc_apple_array_unentitled: OTHER_CFLAGS += drop_priv.c test_utils.c
1420*43a90889SApple OSS Distributionslibmalloc_apple_array_unentitled: OTHER_LDFLAGS += -ldarwintest_utils
1421*43a90889SApple OSS Distributionslibmalloc_apple_array_unentitled: libmalloc_apple_array.c print_apple_array print_apple_array_HR1 print_apple_array_HR2 print_apple_array_hardened_proc print_apple_array_hardened_heap
1422*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $(OTHER_CFLAGS) $< -o $(SYMROOT)/$@
1423*43a90889SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
1424*43a90889SApple OSS Distributions
1425*43a90889SApple OSS DistributionsCUSTOM_TARGETS += print_apple_array
1426*43a90889SApple OSS Distributionsprint_apple_array: print_apple_array.c
1427*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
1428*43a90889SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
1429*43a90889SApple OSS Distributions
1430*43a90889SApple OSS DistributionsCUSTOM_TARGETS += print_apple_array_HR1
1431*43a90889SApple OSS Distributionsprint_apple_array_HR1: CODE_SIGN_ENTITLEMENTS=entitlements/hardened-binary-entitlements-1.plist
1432*43a90889SApple OSS Distributionsprint_apple_array_HR1: print_apple_array.c
1433*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
1434*43a90889SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --entitlements $(SRCROOT)/$(CODE_SIGN_ENTITLEMENTS) --timestamp=none $(SYMROOT)/$@;
1435*43a90889SApple OSS Distributions
1436*43a90889SApple OSS DistributionsCUSTOM_TARGETS += print_apple_array_HR2
1437*43a90889SApple OSS Distributionsprint_apple_array_HR2: CODE_SIGN_ENTITLEMENTS=entitlements/hardened-binary-entitlements-2.plist
1438*43a90889SApple OSS Distributionsprint_apple_array_HR2: print_apple_array.c
1439*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
1440*43a90889SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --entitlements $(SRCROOT)/$(CODE_SIGN_ENTITLEMENTS) --timestamp=none $(SYMROOT)/$@;
1441*43a90889SApple OSS Distributions
1442*43a90889SApple OSS DistributionsCUSTOM_TARGETS += print_apple_array_hardened_proc
1443*43a90889SApple OSS Distributionsprint_apple_array_hardened_proc: CODE_SIGN_ENTITLEMENTS=entitlements/hardened-proc.entitlements
1444*43a90889SApple OSS Distributionsprint_apple_array_hardened_proc: print_apple_array.c
1445*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
1446*43a90889SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --entitlements $(SRCROOT)/$(CODE_SIGN_ENTITLEMENTS) --timestamp=none $(SYMROOT)/$@;
1447*43a90889SApple OSS Distributions
1448*43a90889SApple OSS Distributions
1449*43a90889SApple OSS DistributionsCUSTOM_TARGETS += print_apple_array_hardened_heap
1450*43a90889SApple OSS Distributionsprint_apple_array_hardened_heap: CODE_SIGN_ENTITLEMENTS=entitlements/hardened-heap.entitlements
1451*43a90889SApple OSS Distributionsprint_apple_array_hardened_heap: print_apple_array.c
1452*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
1453*43a90889SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --entitlements $(SRCROOT)/$(CODE_SIGN_ENTITLEMENTS) --timestamp=none $(SYMROOT)/$@;
1454*43a90889SApple OSS Distributions
1455*43a90889SApple OSS Distributionsinstall-print_apple_array: print_apple_array
1456*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)/tools
1457*43a90889SApple OSS Distributions	cp $(SYMROOT)/print_apple_array $(INSTALLDIR)/tools/
1458*43a90889SApple OSS Distributions
1459*43a90889SApple OSS Distributionsinstall-print_apple_array_HR1: print_apple_array_HR1
1460*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)/tools
1461*43a90889SApple OSS Distributions	cp $(SYMROOT)/print_apple_array_HR1 $(INSTALLDIR)/tools/
1462*43a90889SApple OSS Distributions
1463*43a90889SApple OSS Distributionsinstall-print_apple_array_HR2: print_apple_array_HR2
1464*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)/tools
1465*43a90889SApple OSS Distributions	cp $(SYMROOT)/print_apple_array_HR2 $(INSTALLDIR)/tools/
1466*43a90889SApple OSS Distributions
1467*43a90889SApple OSS Distributionsinstall-print_apple_array_hardened_proc: print_apple_array_hardened_proc
1468*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)/tools
1469*43a90889SApple OSS Distributions	cp $(SYMROOT)/print_apple_array_hardened_proc $(INSTALLDIR)/tools/
1470*43a90889SApple OSS Distributions
1471*43a90889SApple OSS Distributionsinstall-print_apple_array_hardened_heap: print_apple_array_hardened_heap
1472*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)/tools
1473*43a90889SApple OSS Distributions	cp $(SYMROOT)/print_apple_array_hardened_heap $(INSTALLDIR)/tools/
1474*43a90889SApple OSS Distributions
1475*43a90889SApple OSS Distributions
1476*43a90889SApple OSS Distributionspersona: CODE_SIGN_ENTITLEMENTS = persona.entitlements
1477*43a90889SApple OSS Distributionspersona_adoption: CODE_SIGN_ENTITLEMENTS = persona_adoption.entitlements
1478*43a90889SApple OSS Distributions
1479*43a90889SApple OSS DistributionsOTHER_TEST_TARGETS += libmalloc_apple_array libmalloc_apple_array_unentitled
1480*43a90889SApple OSS Distributions
1481*43a90889SApple OSS Distributionsentropy: OTHER_CFLAGS += -framework perfdata
1482*43a90889SApple OSS Distributions
1483*43a90889SApple OSS Distributionsdebug_enable_syscall_rejection: OTHER_LDFLAGS += -ldarwintest_utils
1484*43a90889SApple OSS Distributions
1485*43a90889SApple OSS Distributionsthread_set_state_arm64_cpsr: CODE_SIGN_ENTITLEMENTS = entitlements/thread_set_state.entitlement
1486*43a90889SApple OSS Distributions
1487*43a90889SApple OSS Distributionsvm/app_swap: OTHER_LDFLAGS += -ldarwintest_utils
1488*43a90889SApple OSS Distributions
1489*43a90889SApple OSS DistributionsCUSTOM_TARGETS += debug_syscall_rejection_helper
1490*43a90889SApple OSS Distributionsdebug_syscall_rejection_helper: debug_syscall_rejection_helper.c
1491*43a90889SApple OSS Distributions	$(CC) $(OTHER_CFLAGS) $(CFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@; \
1492*43a90889SApple OSS Distributions	echo $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@; \
1493*43a90889SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
1494*43a90889SApple OSS Distributions
1495*43a90889SApple OSS Distributions
1496*43a90889SApple OSS Distributionsinstall-debug_syscall_rejection_helper: debug_syscall_rejection_helper
1497*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
1498*43a90889SApple OSS Distributions	cp $(SYMROOT)/debug_syscall_rejection_helper $(INSTALLDIR)/
1499*43a90889SApple OSS Distributions
1500*43a90889SApple OSS Distributionsfile_leases: OTHER_CFLAGS += test_utils.c
1501*43a90889SApple OSS Distributionsfile_leases: OTHER_LDFLAGS += -ldarwintest_utils
1502*43a90889SApple OSS Distributionsfile_leases: CODE_SIGN_ENTITLEMENTS = file_leases.entitlements
1503*43a90889SApple OSS Distributions
1504*43a90889SApple OSS Distributionsiopolicy: OTHER_LDFLAGS += -ldarwintest_utils
1505*43a90889SApple OSS Distributionsiopolicy: CODE_SIGN_ENTITLEMENTS = iopolicy.entitlements
1506*43a90889SApple OSS Distributions
1507*43a90889SApple OSS DistributionsINCLUDED_TEST_SOURCE_DIRS += vfs
1508*43a90889SApple OSS Distributionsvfs/freeable_vnodes: OTHER_LDFLAGS += -ldarwintest_utils
1509*43a90889SApple OSS Distributions
1510*43a90889SApple OSS Distributionsvm/vm_reclaim: OTHER_CFLAGS += -Wno-language-extension-token -Wno-c++98-compat memorystatus_assertion_helpers.c
1511*43a90889SApple OSS Distributionsvm/vm_reclaim: OTHER_LDFLAGS += -ldarwintest_utils
1512*43a90889SApple OSS Distributions
1513*43a90889SApple OSS Distributionsvm/vm_reclaim: INVALID_ARCHS = armv7k arm64_32
1514*43a90889SApple OSS Distributions
1515*43a90889SApple OSS DistributionsEXCLUDED_SOURCES += constrained_ctypes_tests.c
1516*43a90889SApple OSS DistributionsCUSTOM_TARGETS += constrained_ctypes_tests_enabled constrained_ctypes_tests_enacted constrained_ctypes_tests_disabled
1517*43a90889SApple OSS Distributionsconstrained_ctypes_tests_enabled: OTHER_CFLAGS += -D__CCT_TEST_ENABLED
1518*43a90889SApple OSS Distributionsconstrained_ctypes_tests_enabled: OTHER_LDFLAGS += -ldarwintest_utils
1519*43a90889SApple OSS Distributionsconstrained_ctypes_tests_enabled: constrained_ctypes_tests.c
1520*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) constrained_ctypes_tests.c -o $(SYMROOT)/constrained_ctypes_tests_enabled
1521*43a90889SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/constrained_ctypes_tests_enabled;
1522*43a90889SApple OSS Distributions
1523*43a90889SApple OSS Distributionsinstall-constrained_ctypes_tests_enabled: constrained_ctypes_tests_enabled
1524*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
1525*43a90889SApple OSS Distributions	cp $(SYMROOT)/constrained_ctypes_tests_enabled $(INSTALLDIR)/
1526*43a90889SApple OSS Distributions
1527*43a90889SApple OSS Distributionsconstrained_ctypes_tests_enacted: OTHER_CFLAGS += -D__CCT_TEST_ENABLED
1528*43a90889SApple OSS Distributionsconstrained_ctypes_tests_enacted: OTHER_CFLAGS += -D__CCT_TEST_ENACTED
1529*43a90889SApple OSS Distributionsconstrained_ctypes_tests_enacted: OTHER_CFLAGS += -fbounds-safety
1530*43a90889SApple OSS Distributionsconstrained_ctypes_tests_enacted: OTHER_LDFLAGS += -ldarwintest_utils
1531*43a90889SApple OSS Distributionsconstrained_ctypes_tests_enacted: constrained_ctypes_tests.c
1532*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) constrained_ctypes_tests.c -o $(SYMROOT)/constrained_ctypes_tests_enacted
1533*43a90889SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/constrained_ctypes_tests_enacted;
1534*43a90889SApple OSS Distributions
1535*43a90889SApple OSS Distributionsinstall-constrained_ctypes_tests_enacted: constrained_ctypes_tests_enacted
1536*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
1537*43a90889SApple OSS Distributions	cp $(SYMROOT)/constrained_ctypes_tests_enacted $(INSTALLDIR)/
1538*43a90889SApple OSS Distributions
1539*43a90889SApple OSS Distributions
1540*43a90889SApple OSS Distributionsconstrained_ctypes_tests_disabled: OTHER_LDFLAGS += -ldarwintest_utils
1541*43a90889SApple OSS Distributionsconstrained_ctypes_tests_disabled: constrained_ctypes_tests.c
1542*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) constrained_ctypes_tests.c -o $(SYMROOT)/constrained_ctypes_tests_disabled
1543*43a90889SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/constrained_ctypes_tests_disabled;
1544*43a90889SApple OSS Distributions
1545*43a90889SApple OSS Distributionsinstall-constrained_ctypes_tests_disabled: constrained_ctypes_tests_disabled
1546*43a90889SApple OSS Distributions	mkdir -p $(INSTALLDIR)
1547*43a90889SApple OSS Distributions	cp $(SYMROOT)/constrained_ctypes_tests_disabled $(INSTALLDIR)/
1548*43a90889SApple OSS Distributions
1549*43a90889SApple OSS Distributionstask_suspend_stats: OTHER_LDFLAGS += -ldarwintest_utils
1550*43a90889SApple OSS Distributionstask_suspend_stats: CODE_SIGN_ENTITLEMENTS = task_for_pid_entitlement.plist
1551*43a90889SApple OSS Distributions
1552*43a90889SApple OSS Distributions# os_atomic use throws this warning
1553*43a90889SApple OSS Distributionssetitimer: OTHER_CFLAGS += -Wno-c++98-compat -framework perfdata
1554*43a90889SApple OSS Distributionssetitimer: OTHER_LDFLAGS += -framework perfdata
1555*43a90889SApple OSS Distributions
1556*43a90889SApple OSS Distributionsexec_set_proc_name: OTHER_LDFLAGS += -ldarwintest_utils
1557*43a90889SApple OSS Distributions
1558*43a90889SApple OSS Distributions
1559*43a90889SApple OSS Distributionsinclude $(DEVELOPER_DIR)/AppleInternal/Makefiles/darwintest/Makefile.targets
1560*43a90889SApple OSS Distributions
1561*43a90889SApple OSS Distributionsexception_ports_info: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
1562*43a90889SApple OSS Distributions
1563*43a90889SApple OSS Distributionsvfs/longpaths: vfs/longpaths.c
1564*43a90889SApple OSS Distributionsvfs/longpaths: OTHER_LDFLAGS += -ldarwintest_utils
1565*43a90889SApple OSS Distributionsvfs/longpaths: CODE_SIGN_ENTITLEMENTS = vfs/longpaths.entitlements
1566*43a90889SApple OSS Distributions
1567*43a90889SApple OSS Distributionsmemorystatus_experiment_factors: CODESIGN_ENTITLEMENTS=./memorystatus/memorystatus_experiment_factors.entitlements
1568*43a90889SApple OSS Distributionsmemorystatus_experiment_factors: memorystatus/memorystatus_experiment_factors.c
1569*43a90889SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
1570*43a90889SApple OSS Distributions	$(ENV) CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements $(CODESIGN_ENTITLEMENTS) $(SYMROOT)/$@;
1571*43a90889SApple OSS Distributions
1572