xref: /xnu-12377.41.6/tests/Makefile (revision bbb1b6f9e71b8cdde6e5cd6f4841f207dee3d828)
1*bbb1b6f9SApple OSS DistributionsPROJECT := xnu/darwintests
2*bbb1b6f9SApple OSS Distributions
3*bbb1b6f9SApple OSS Distributionsinclude disabled.mk
4*bbb1b6f9SApple OSS Distributions
5*bbb1b6f9SApple OSS Distributions# When building as part of xnu_tests, we get passed a DSTROOT that's got the
6*bbb1b6f9SApple OSS Distributions# unit test path in it already.  But, BASEDSTROOT doesn't, so use that instead.
7*bbb1b6f9SApple OSS Distributionsifdef BASEDSTROOT
8*bbb1b6f9SApple OSS Distributionsoverride DSTROOT = $(BASEDSTROOT)
9*bbb1b6f9SApple OSS Distributionsendif
10*bbb1b6f9SApple OSS Distributions
11*bbb1b6f9SApple OSS DistributionsINVALID_ARCHS = i386 $(filter armv7%,$(ARCH_CONFIGS))
12*bbb1b6f9SApple OSS DistributionsENABLE_LTE_TESTS=YES
13*bbb1b6f9SApple OSS Distributions
14*bbb1b6f9SApple OSS DistributionsOTHER_LTE_INCLUDE_FILES += \
15*bbb1b6f9SApple OSS Distributions	/System/Library/PrivateFrameworks/LoggingSupport.framework, \
16*bbb1b6f9SApple OSS Distributions	/System/Library/PrivateFrameworks/MobileKeyBag.framework, \
17*bbb1b6f9SApple OSS Distributions	/System/Library/Frameworks/IOSurface.framework, \
18*bbb1b6f9SApple OSS Distributions	/usr/local/lib/libdarwintest_utils.dylib, \
19*bbb1b6f9SApple OSS Distributions	/usr/lib/libapple_crypto.dylib,
20*bbb1b6f9SApple OSS Distributions
21*bbb1b6f9SApple OSS DistributionsENV = /usr/bin/env
22*bbb1b6f9SApple OSS Distributions
23*bbb1b6f9SApple OSS DistributionsDEVELOPER_DIR ?= $(shell xcode-select -p)
24*bbb1b6f9SApple OSS Distributions
25*bbb1b6f9SApple OSS Distributions
26*bbb1b6f9SApple OSS Distributionsifeq ($(origin TIGHTBEAM_MODULE_DIR),undefined)
27*bbb1b6f9SApple OSS Distributions	export TIGHTBEAM_MODULE_DIR := $(shell /usr/bin/xcrun --show-sdk-path -sdk $(SDKROOT))/usr/local/lib/kernel/tightbeam
28*bbb1b6f9SApple OSS Distributionsendif
29*bbb1b6f9SApple OSS Distributions
30*bbb1b6f9SApple OSS DistributionsUSE_WERROR := 1
31*bbb1b6f9SApple OSS Distributionsifneq ($(BUILD_WERROR),)
32*bbb1b6f9SApple OSS DistributionsUSE_WERROR := $(BUILD_WERROR)
33*bbb1b6f9SApple OSS Distributionsendif
34*bbb1b6f9SApple OSS Distributions
35*bbb1b6f9SApple OSS Distributionsifeq ($(USE_WERROR),1)
36*bbb1b6f9SApple OSS DistributionsWERROR := -Werror
37*bbb1b6f9SApple OSS Distributionsendif
38*bbb1b6f9SApple OSS Distributions
39*bbb1b6f9SApple OSS Distributions# the xnu build system will only ever call us with the default target
40*bbb1b6f9SApple OSS Distributions.DEFAULT_GOAL := install
41*bbb1b6f9SApple OSS Distributions
42*bbb1b6f9SApple OSS Distributionsinclude $(DEVELOPER_DIR)/AppleInternal/Makefiles/darwintest/Makefile.common
43*bbb1b6f9SApple OSS Distributions
44*bbb1b6f9SApple OSS DistributionsOTHER_CFLAGS  = -Wall
45*bbb1b6f9SApple OSS DistributionsOTHER_CFLAGS += -Wno-deprecated-declarations
46*bbb1b6f9SApple OSS DistributionsOTHER_CFLAGS += -Werror=excess-initializers
47*bbb1b6f9SApple OSS DistributionsOTHER_CFLAGS += -Wno-c2x-extensions
48*bbb1b6f9SApple OSS DistributionsOTHER_CFLAGS += -Werror=excess-initializers
49*bbb1b6f9SApple OSS DistributionsOTHER_CFLAGS += --std=gnu17 -isystem $(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
50*bbb1b6f9SApple OSS DistributionsOTHER_CFLAGS += -UT_NAMESPACE_PREFIX -DT_NAMESPACE_PREFIX=xnu -DT_LEAKS_DISABLE=1
51*bbb1b6f9SApple OSS DistributionsOTHER_CFLAGS += -F $(SDKROOT)/System/Library/PrivateFrameworks
52*bbb1b6f9SApple OSS Distributions
53*bbb1b6f9SApple OSS Distributions# IPC utils for tests that need ipc_utils.c
54*bbb1b6f9SApple OSS DistributionsIPC_UTILS = ipc/ipc_utils.c
55*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += $(IPC_UTILS)
56*bbb1b6f9SApple OSS Distributions
57*bbb1b6f9SApple OSS Distributionsipc/%: OTHER_CFLAGS += -Wno-format-pedantic $(WERROR)
58*bbb1b6f9SApple OSS Distributions
59*bbb1b6f9SApple OSS Distributions
60*bbb1b6f9SApple OSS DistributionsCODESIGN:=$(shell xcrun -sdk "$(TARGETSDK)" -find codesign)
61*bbb1b6f9SApple OSS DistributionsCODESIGN_HARDENED_RUNTIME:=$(CODESIGN) -o runtime
62*bbb1b6f9SApple OSS DistributionsCODESIGN_ALLOCATE:=$(shell xcrun -sdk "$(TARGETSDK)" -find codesign_allocate)
63*bbb1b6f9SApple OSS Distributions
64*bbb1b6f9SApple OSS DistributionsLIPO:=$(shell xcrun -sdk "$(TARGETSDK)" -find lipo)
65*bbb1b6f9SApple OSS Distributions
66*bbb1b6f9SApple OSS Distributionsifeq ($(PLATFORM),iPhoneOS)
67*bbb1b6f9SApple OSS Distributions  IOS_TEST_COMPAT = YES
68*bbb1b6f9SApple OSS Distributionselse
69*bbb1b6f9SApple OSS Distributions  IOS_TEST_COMPAT = NO
70*bbb1b6f9SApple OSS Distributionsendif
71*bbb1b6f9SApple OSS Distributions
72*bbb1b6f9SApple OSS Distributions# Generate tightbeam header for ExclavesCHelloServer from tbmodule in the SDK
73*bbb1b6f9SApple OSS Distributionsifneq ($(wildcard $(SDKROOT)/System/Library/PrivateFrameworks/Tightbeam.framework/Headers/tightbeam.h),)
74*bbb1b6f9SApple OSS DistributionsTIGHTBEAM_MODULES := \
75*bbb1b6f9SApple OSS Distributions	ExclavesCHelloServer.tbmodule
76*bbb1b6f9SApple OSS Distributions
77*bbb1b6f9SApple OSS DistributionsTIGHTBEAM_MODULE_HEADERS := $(patsubst %.tbmodule,%.tightbeam.h,$(TIGHTBEAM_MODULES))
78*bbb1b6f9SApple OSS DistributionsTIGHTBEAM_MODULE_IMPL := $(patsubst %.tbmodule,%.tightbeam.c,$(TIGHTBEAM_MODULES))
79*bbb1b6f9SApple OSS Distributions
80*bbb1b6f9SApple OSS Distributions# This makes sure to not include any tbmodules which don't exist in the SDK and
81*bbb1b6f9SApple OSS Distributions# expand the modules listed above to their full path in the SDK. The modules
82*bbb1b6f9SApple OSS Distributions# should only be needed when actually building with CONFIG_EXCLAVES
83*bbb1b6f9SApple OSS Distributions# (which can't easily be checked here).
84*bbb1b6f9SApple OSS DistributionsTIGHTBEAM_MODULES := $(patsubst %.tbmodule,$(TIGHTBEAM_MODULE_DIR)/%.tbmodule,$(TIGHTBEAM_MODULES))
85*bbb1b6f9SApple OSS DistributionsTIGHTBEAM_MODULES := $(wildcard $(TIGHTBEAM_MODULES))
86*bbb1b6f9SApple OSS DistributionsTIGHTBEAM_MODULE_IMPL_PATH := $(addprefix $(OBJROOT)/, $(TIGHTBEAM_MODULE_IMPL))
87*bbb1b6f9SApple OSS Distributions
88*bbb1b6f9SApple OSS Distributions$(TIGHTBEAM_MODULE_IMPL) : \
89*bbb1b6f9SApple OSS Distributions	%.tightbeam.c : $(TIGHTBEAM_MODULES)
90*bbb1b6f9SApple OSS Distributions	$(TIGHTBEAMC) build generate-c --output-base $(OBJROOT)/$*.tightbeam.c --codegen-version 2 $<
91*bbb1b6f9SApple OSS Distributions
92*bbb1b6f9SApple OSS Distributions$(TIGHTBEAM_MODULE_HEADERS) : $(TIGHTBEAM_MODULE_IMPL)
93*bbb1b6f9SApple OSS Distributionsendif
94*bbb1b6f9SApple OSS Distributions
95*bbb1b6f9SApple OSS Distributions# Subsystems
96*bbb1b6f9SApple OSS Distributions
97*bbb1b6f9SApple OSS Distributionsinclude ktrace/Makefile
98*bbb1b6f9SApple OSS Distributionsinclude signals/Makefile
99*bbb1b6f9SApple OSS Distributions
100*bbb1b6f9SApple OSS DistributionsINCLUDED_TEST_SOURCE_DIRS += recount
101*bbb1b6f9SApple OSS Distributionsinclude recount/Makefile
102*bbb1b6f9SApple OSS DistributionsINCLUDED_TEST_SOURCE_DIRS += cpu_counters
103*bbb1b6f9SApple OSS Distributionsinclude cpu_counters/Makefile
104*bbb1b6f9SApple OSS Distributions
105*bbb1b6f9SApple OSS DistributionsINCLUDED_TEST_SOURCE_DIRS += sched
106*bbb1b6f9SApple OSS Distributionsinclude sched/Makefile
107*bbb1b6f9SApple OSS Distributions
108*bbb1b6f9SApple OSS Distributions# Miscellaneous Tests
109*bbb1b6f9SApple OSS Distributions
110*bbb1b6f9SApple OSS Distributionsmach_eventlink: OTHER_LDFLAGS += $(SCHED_UTILS_FLAGS)
111*bbb1b6f9SApple OSS Distributionsmach_eventlink: $(SCHED_UTILS)
112*bbb1b6f9SApple OSS Distributions
113*bbb1b6f9SApple OSS Distributionsatm_diagnostic_flag: OTHER_CFLAGS += drop_priv.c
114*bbb1b6f9SApple OSS Distributions
115*bbb1b6f9SApple OSS Distributionsatm_diagnostic_flag_entitled: CODE_SIGN_ENTITLEMENTS = atm_diagnostic_flag.entitlements
116*bbb1b6f9SApple OSS Distributionsatm_diagnostic_flag_entitled: OTHER_CFLAGS += drop_priv.c
117*bbb1b6f9SApple OSS Distributions
118*bbb1b6f9SApple OSS Distributionsavx: INVALID_ARCHS = $(filter arm%,$(ARCH_CONFIGS))
119*bbb1b6f9SApple OSS Distributionsavx: OTHER_CFLAGS += -mavx512f -mavx512bw -mavx512vl
120*bbb1b6f9SApple OSS Distributionsavx: OTHER_CFLAGS += -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
121*bbb1b6f9SApple OSS Distributionsavx: CONFIG_FLAGS := $(filter-out -O%,$(CONFIG_FLAGS))
122*bbb1b6f9SApple OSS Distributions# Add -mno-implicit-float to prevent the compiler from touching SIMD regs
123*bbb1b6f9SApple OSS Distributions# unexpectedly
124*bbb1b6f9SApple OSS Distributionsavx: CONFIG_FLAGS += -mno-implicit-float
125*bbb1b6f9SApple OSS Distributions# Disable vzeroupper insertion to work around rdar://problem/35035096
126*bbb1b6f9SApple OSS Distributionsavx: CONFIG_FLAGS += -mllvm -x86-use-vzeroupper=0
127*bbb1b6f9SApple OSS Distributionsifneq (osx,$(TARGET_NAME))
128*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += avx.c
129*bbb1b6f9SApple OSS Distributionsendif
130*bbb1b6f9SApple OSS Distributions
131*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS = sr_entitlement_helper
132*bbb1b6f9SApple OSS Distributions
133*bbb1b6f9SApple OSS Distributionssr_entitlement_helper: sr_entitlement_helper.c
134*bbb1b6f9SApple OSS Distributions	mkdir -p $(SYMROOT)
135*bbb1b6f9SApple OSS Distributions	$(CC) -I $(OBJROOT) $(CFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) sr_entitlement_helper.c -o $(SYMROOT)/$@
136*bbb1b6f9SApple OSS Distributions	echo $(CODESIGN) --force --sign - --timestamp=none --entitlements sr_entitlement.entitlements $(SYMROOT)/$@; \
137*bbb1b6f9SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements sr_entitlement.entitlements $(SYMROOT)/$@;
138*bbb1b6f9SApple OSS Distributions
139*bbb1b6f9SApple OSS Distributionsinstall-sr_entitlement_helper: sr_entitlement_helper
140*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
141*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/sr_entitlement_helper $(INSTALLDIR)
142*bbb1b6f9SApple OSS Distributions
143*bbb1b6f9SApple OSS Distributionssr_entitlement: OTHER_LDFLAGS += -ldarwintest_utils
144*bbb1b6f9SApple OSS Distributions
145*bbb1b6f9SApple OSS Distributionsrestrict_jit: CODE_SIGN_ENTITLEMENTS = restrict_jit.entitlements
146*bbb1b6f9SApple OSS Distributions
147*bbb1b6f9SApple OSS Distributionsbacktracing_tests: OTHER_LDFLAGS += -framework CoreSymbolication
148*bbb1b6f9SApple OSS Distributionsbacktracing_tests: CODE_SIGN_ENTITLEMENTS = kernel_symbolication_entitlements.plist
149*bbb1b6f9SApple OSS Distributions
150*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += corpse_backtrace2
151*bbb1b6f9SApple OSS Distributions
152*bbb1b6f9SApple OSS Distributionscorpse_backtrace2:
153*bbb1b6f9SApple OSS Distributions		$(MIG) $(CFLAGS) \
154*bbb1b6f9SApple OSS Distributions		-DMACH_EXC_SERVER_TASKIDTOKEN \
155*bbb1b6f9SApple OSS Distributions		-DMACH_EXC_SERVER_BACKTRACE \
156*bbb1b6f9SApple OSS Distributions		-sheader $(OBJROOT)/excserver_backtrace.h \
157*bbb1b6f9SApple OSS Distributions		-server $(OBJROOT)/excserver_backtrace.c \
158*bbb1b6f9SApple OSS Distributions		-header /dev/null -user /dev/null \
159*bbb1b6f9SApple OSS Distributions		excserver_backtrace.defs
160*bbb1b6f9SApple OSS Distributions
161*bbb1b6f9SApple OSS Distributionsinstall-corpse_backtrace2: ;
162*bbb1b6f9SApple OSS Distributions
163*bbb1b6f9SApple OSS Distributionscorpse_backtrace: corpse_backtrace2 exc_helpers.c
164*bbb1b6f9SApple OSS Distributionscorpse_backtrace: OTHER_CFLAGS += $(OBJROOT)/excserver_backtrace.c
165*bbb1b6f9SApple OSS Distributionscorpse_backtrace: OTHER_CFLAGS += -I $(OBJROOT)
166*bbb1b6f9SApple OSS Distributionscorpse_backtrace: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
167*bbb1b6f9SApple OSS Distributions
168*bbb1b6f9SApple OSS Distributions# Tests that use exc_guard_helper.h should add all of the build options used by exc_guard_helper_test:
169*bbb1b6f9SApple OSS Distributions# - additional C files exc_guard_helper.c and exc_helpers.c and test_utils.c
170*bbb1b6f9SApple OSS Distributions# - additional library darwintest_utils
171*bbb1b6f9SApple OSS Distributions# - excserver MIG-generated file
172*bbb1b6f9SApple OSS Distributions# - entitlement to allow thread_set_exception_ports()
173*bbb1b6f9SApple OSS Distributionsexc_guard_helper_test: exc_guard_helper.c exc_helpers.c test_utils.c excserver
174*bbb1b6f9SApple OSS Distributionsexc_guard_helper_test: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
175*bbb1b6f9SApple OSS Distributionsexc_guard_helper_test: OTHER_LDFLAGS += -ldarwintest_utils
176*bbb1b6f9SApple OSS Distributionsexc_guard_helper_test: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
177*bbb1b6f9SApple OSS Distributions
178*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += exc_guard_helper.c
179*bbb1b6f9SApple OSS Distributions
180*bbb1b6f9SApple OSS Distributionsexc_guard_helper_test_unexpected: exc_guard_helper.c exc_helpers.c test_utils.c excserver
181*bbb1b6f9SApple OSS Distributionsexc_guard_helper_test_unexpected: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
182*bbb1b6f9SApple OSS Distributionsexc_guard_helper_test_unexpected: OTHER_LDFLAGS += -ldarwintest_utils
183*bbb1b6f9SApple OSS Distributionsexc_guard_helper_test_unexpected: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
184*bbb1b6f9SApple OSS Distributions
185*bbb1b6f9SApple OSS Distributions# Tests that use try_read_write.h should add all of the build options used by try_read_write_test:
186*bbb1b6f9SApple OSS Distributions# - additional C files try_read_write.c and exc_helpers.c
187*bbb1b6f9SApple OSS Distributions# - excserver MIG-generated file
188*bbb1b6f9SApple OSS Distributions# - entitlement to allow thread_set_exception_ports()
189*bbb1b6f9SApple OSS Distributionstry_read_write_test: try_read_write.c exc_helpers.c excserver
190*bbb1b6f9SApple OSS Distributionstry_read_write_test: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
191*bbb1b6f9SApple OSS Distributionstry_read_write_test: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
192*bbb1b6f9SApple OSS Distributions
193*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += try_read_write.c
194*bbb1b6f9SApple OSS Distributions
195*bbb1b6f9SApple OSS Distributionstry_read_write_test_unexpected: try_read_write.c exc_helpers.c excserver
196*bbb1b6f9SApple OSS Distributionstry_read_write_test_unexpected: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
197*bbb1b6f9SApple OSS Distributionstry_read_write_test_unexpected: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
198*bbb1b6f9SApple OSS Distributions
199*bbb1b6f9SApple OSS Distributionsvm/corpse_owned_vmobjects: excserver_protect_state
200*bbb1b6f9SApple OSS Distributionsvm/corpse_owned_vmobjects: OTHER_CFLAGS += $(OBJROOT)/excserver_protect_state.c -I $(OBJROOT)
201*bbb1b6f9SApple OSS Distributionsvm/corpse_owned_vmobjects: CODE_SIGN_ENTITLEMENTS += vm/corpse_owned_vmobjects.entitlements
202*bbb1b6f9SApple OSS Distributions
203*bbb1b6f9SApple OSS Distributionsvm_test_mach_map: try_read_write.c exc_helpers.c excserver
204*bbb1b6f9SApple OSS Distributionsvm_test_mach_map: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
205*bbb1b6f9SApple OSS Distributionsvm_test_mach_map: CODE_SIGN_ENTITLEMENTS = ./vm_test_mach_map.plist
206*bbb1b6f9SApple OSS Distributions
207*bbb1b6f9SApple OSS DistributionsOTHER_TEST_TARGETS += vm/vm_parameter_validation
208*bbb1b6f9SApple OSS Distributionsvm/vm_parameter_validation: CODE_SIGN_ENTITLEMENTS = vm/vm_parameter_validation.entitlements
209*bbb1b6f9SApple OSS Distributions
210*bbb1b6f9SApple OSS Distributions# vm_parameter_validation builds each arch as a separate build command
211*bbb1b6f9SApple OSS Distributions# so we can pass architecture-specific linker flags.
212*bbb1b6f9SApple OSS Distributions# and generate arch-specific MIG files.
213*bbb1b6f9SApple OSS Distributions
214*bbb1b6f9SApple OSS Distributions# libdarwintest.a doesn't have an arm64 slice on watchOS
215*bbb1b6f9SApple OSS Distributionsifeq ($(PLATFORM),WatchOS)
216*bbb1b6f9SApple OSS DistributionsVM_PARAMETER_VALIDATION_INVALID_ARCHS = arm64
217*bbb1b6f9SApple OSS Distributionsvm/vm_parameter_validation: INVALID_ARCHS += arm64
218*bbb1b6f9SApple OSS Distributionsendif
219*bbb1b6f9SApple OSS Distributions
220*bbb1b6f9SApple OSS DistributionsVM_PARAMETER_VALIDATION_ARCHS = $(filter-out $(VM_PARAMETER_VALIDATION_INVALID_ARCHS),$(ARCH_CONFIGS))
221*bbb1b6f9SApple OSS Distributions
222*bbb1b6f9SApple OSS Distributions# Some tests map-overwrite wildly at addresses near 0.
223*bbb1b6f9SApple OSS Distributions# Use a large PAGEZERO so our executable and other data do not land there.
224*bbb1b6f9SApple OSS Distributions# (This is 32-bit only. 64-bit uses 4GB PAGEZERO by default which is fine.)
225*bbb1b6f9SApple OSS DistributionsVM_PARAMETER_VALIDATION_LDFLAGS_i386     = -Xlinker -pagezero_size -Xlinker 0x1000000
226*bbb1b6f9SApple OSS DistributionsVM_PARAMETER_VALIDATION_LDFLAGS_armv7    = -Xlinker -pagezero_size -Xlinker 0x1000000
227*bbb1b6f9SApple OSS DistributionsVM_PARAMETER_VALIDATION_LDFLAGS_armv7s   = -Xlinker -pagezero_size -Xlinker 0x1000000
228*bbb1b6f9SApple OSS DistributionsVM_PARAMETER_VALIDATION_LDFLAGS_armv7k   = -Xlinker -pagezero_size -Xlinker 0x1000000
229*bbb1b6f9SApple OSS DistributionsVM_PARAMETER_VALIDATION_LDFLAGS_arm64_32 = -Xlinker -pagezero_size -Xlinker 0x1000000
230*bbb1b6f9SApple OSS Distributions
231*bbb1b6f9SApple OSS DistributionsVM_PARAMETER_VALIDATION_SLICES=$(addprefix $(SYMROOT)/vm/vm_parameter_validation_,$(VM_PARAMETER_VALIDATION_ARCHS))
232*bbb1b6f9SApple OSS Distributions
233*bbb1b6f9SApple OSS Distributionsvm/vm_parameter_validation: assets $(VM_PARAMETER_VALIDATION_SLICES)
234*bbb1b6f9SApple OSS Distributions	$(LIPO) -create $(VM_PARAMETER_VALIDATION_SLICES) -output $(SYMROOT)/$@
235*bbb1b6f9SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --entitlements $(CODE_SIGN_ENTITLEMENTS) --timestamp=none $(SYMROOT)/$@
236*bbb1b6f9SApple OSS Distributions
237*bbb1b6f9SApple OSS Distributions$(SYMROOT)/vm/vm_parameter_validation_%: ../osfmk/tests/vm_parameter_validation.h \
238*bbb1b6f9SApple OSS Distributions                                         $(OBJROOT)/vm_parameter_validation_%_vm32_map_user.c \
239*bbb1b6f9SApple OSS Distributions                                         $(OBJROOT)/vm_parameter_validation_%_mach_vm_user.c \
240*bbb1b6f9SApple OSS Distributions                                         $(OBJROOT)/vm_parameter_validation_%_replacement_mach_host.c \
241*bbb1b6f9SApple OSS Distributions                                         $(OBJROOT)/vm_parameter_validation_%_replacement_host_priv.c \
242*bbb1b6f9SApple OSS Distributions                                         vm/vm_parameter_validation.c
243*bbb1b6f9SApple OSS Distributions	mkdir -p $(SYMROOT)/vm
244*bbb1b6f9SApple OSS Distributions	$(CC) -I $(OBJROOT) \
245*bbb1b6f9SApple OSS Distributions	    $(DT_CFLAGS) $(OTHER_CFLAGS) $(filter-out $(ARCH_FLAGS),$(CFLAGS)) -arch $* \
246*bbb1b6f9SApple OSS Distributions	    $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $(VM_PARAMETER_VALIDATION_LDFLAGS_$*) \
247*bbb1b6f9SApple OSS Distributions	    -DVM32_SUPPORT=1 -DKERNEL_VM_TEST=1 \
248*bbb1b6f9SApple OSS Distributions	    $(OBJROOT)/vm_parameter_validation_$*_vm32_map_user.c \
249*bbb1b6f9SApple OSS Distributions	    $(OBJROOT)/vm_parameter_validation_$*_mach_vm_user.c \
250*bbb1b6f9SApple OSS Distributions	    $(OBJROOT)/vm_parameter_validation_$*_replacement_mach_host.c \
251*bbb1b6f9SApple OSS Distributions	    $(OBJROOT)/vm_parameter_validation_$*_replacement_host_priv.c \
252*bbb1b6f9SApple OSS Distributions	    vm/vm_parameter_validation.c -o $@
253*bbb1b6f9SApple OSS Distributions
254*bbb1b6f9SApple OSS Distributions# xnu/libsyscall/mach/mach_vm.c intercepts some VM calls from userspace,
255*bbb1b6f9SApple OSS Distributions# sometimes doing something other than the expected MIG call.
256*bbb1b6f9SApple OSS Distributions# And on 64-bit platforms libsystem has no interface to reach the 32-bit entrypoints.
257*bbb1b6f9SApple OSS Distributions# We generate our own MIG userspace call sites to call the kernel entrypoints directly.
258*bbb1b6f9SApple OSS Distributions$(OBJROOT)/vm_parameter_validation_%_vm32_map_user.c: ../osfmk/mach/vm32_map.defs
259*bbb1b6f9SApple OSS Distributions	$(MIG) $(filter-out $(ARCH_FLAGS),$(CFLAGS)) -arch $* \
260*bbb1b6f9SApple OSS Distributions	 -I../osfmk -novouchers -DKERNEL_USER=1 -DKOBJECT_SERVER -DKERNEL_VM_TEST=1 \
261*bbb1b6f9SApple OSS Distributions	 -user $@ -header $(subst _$*_,_,$(@:.c=.h)) \
262*bbb1b6f9SApple OSS Distributions	 -server /dev/null -sheader /dev/null \
263*bbb1b6f9SApple OSS Distributions	 $<
264*bbb1b6f9SApple OSS Distributions$(OBJROOT)/vm_parameter_validation_%_mach_vm_user.c: ../osfmk/mach/mach_vm.defs
265*bbb1b6f9SApple OSS Distributions	$(MIG) $(filter-out $(ARCH_FLAGS),$(CFLAGS)) -arch $* \
266*bbb1b6f9SApple OSS Distributions	 -I../osfmk -novouchers -DKERNEL_USER=1 -DKOBJECT_SERVER -DKERNEL_VM_TEST=1 \
267*bbb1b6f9SApple OSS Distributions	 -user $@ -header $(subst _$*_,_,$(@:.c=.h)) \
268*bbb1b6f9SApple OSS Distributions	 -server /dev/null -sheader /dev/null \
269*bbb1b6f9SApple OSS Distributions	 $<
270*bbb1b6f9SApple OSS Distributions# The declaration of mach_memory_object_memory_entry is buggy on U32.
271*bbb1b6f9SApple OSS Distributions# We compile in our own MIG user stub for it with a "replacement_" prefix.
272*bbb1b6f9SApple OSS Distributions# rdar://117927965
273*bbb1b6f9SApple OSS Distributions$(OBJROOT)/vm_parameter_validation_%_replacement_mach_host.c: vm/vm_parameter_validation_replacement_mach_host.defs
274*bbb1b6f9SApple OSS Distributions	$(MIG) $(filter-out $(ARCH_FLAGS),$(CFLAGS)) -arch $* \
275*bbb1b6f9SApple OSS Distributions	 -I../osfmk -novouchers -DKERNEL_USER=1 -DKOBJECT_SERVER -DKERNEL_VM_TEST=1 \
276*bbb1b6f9SApple OSS Distributions	 -user $@ -header $(subst _$*_,_,$(@:.c=.h)) \
277*bbb1b6f9SApple OSS Distributions	 -server /dev/null -sheader /dev/null \
278*bbb1b6f9SApple OSS Distributions	 $<
279*bbb1b6f9SApple OSS Distributions# The declaration of vm_wire is buggy on U32.
280*bbb1b6f9SApple OSS Distributions# We compile in our own MIG user stub for it with a "replacement_" prefix.
281*bbb1b6f9SApple OSS Distributions# rdar://118258929
282*bbb1b6f9SApple OSS Distributions$(OBJROOT)/vm_parameter_validation_%_replacement_host_priv.c: vm/vm_parameter_validation_replacement_host_priv.defs
283*bbb1b6f9SApple OSS Distributions	$(MIG) $(filter-out $(ARCH_FLAGS),$(CFLAGS)) -arch $* \
284*bbb1b6f9SApple OSS Distributions	 -I../osfmk -novouchers -DKERNEL_USER=1 -DKOBJECT_SERVER -DKERNEL_VM_TEST=1 \
285*bbb1b6f9SApple OSS Distributions	 -user $@ -header $(subst _$*_,_,$(@:.c=.h)) \
286*bbb1b6f9SApple OSS Distributions	 -server /dev/null -sheader /dev/null \
287*bbb1b6f9SApple OSS Distributions	 $<
288*bbb1b6f9SApple OSS Distributions
289*bbb1b6f9SApple OSS Distributions
290*bbb1b6f9SApple 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
291*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += ipc/hardened_exceptions_entitled_debugger ipc/hardened_exceptions_entitled
292*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += excserver_protect
293*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += excserver_protect_state
294*bbb1b6f9SApple OSS Distributions
295*bbb1b6f9SApple OSS Distributionsexception_tests: excserver_protect exc_helpers.c
296*bbb1b6f9SApple OSS Distributionsexception_tests: CODE_SIGN_ENTITLEMENTS = exception_tests.entitlements
297*bbb1b6f9SApple OSS Distributionsexception_tests: OTHER_CFLAGS += $(OBJROOT)/excserver_protect.c
298*bbb1b6f9SApple OSS Distributionsexception_tests: OTHER_CFLAGS += -I $(OBJROOT)
299*bbb1b6f9SApple OSS Distributionsexception_tests: OTHER_CFLAGS += -DENTITLED=1
300*bbb1b6f9SApple OSS Distributions
301*bbb1b6f9SApple OSS Distributionsipc/hardened_exceptions: excserver_protect_state exc_helpers.c
302*bbb1b6f9SApple OSS Distributionsipc/hardened_exceptions: ipc/hardened_exceptions_entitled ipc/hardened_exceptions_entitled_debugger
303*bbb1b6f9SApple OSS Distributionsipc/hardened_exceptions: $(OBJROOT)/excserver_protect_state.c
304*bbb1b6f9SApple OSS Distributions
305*bbb1b6f9SApple OSS Distributionsipc/hardened_exceptions_entitled: excserver_protect_state
306*bbb1b6f9SApple OSS Distributionsipc/hardened_exceptions_entitled: CODE_SIGN_ENTITLEMENTS = entitlements/only_one_exception_port.entitlement
307*bbb1b6f9SApple OSS Distributionsipc/hardened_exceptions_entitled: OTHER_CFLAGS += -I $(OBJROOT)
308*bbb1b6f9SApple OSS Distributionsipc/hardened_exceptions_entitled: exc_helpers.c ipc/hardened_exceptions.c $(OBJROOT)/excserver_protect_state.c
309*bbb1b6f9SApple OSS Distributions	mkdir -p $(SYMROOT)/ipc
310*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(OTHER_CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \
311*bbb1b6f9SApple OSS Distributions	$(filter-out $(CUSTOM_TARGETS), $^) -o $(SYMROOT)/$@
312*bbb1b6f9SApple OSS Distributions	$(CODESIGN) --force --sign - --entitlements $(CODE_SIGN_ENTITLEMENTS) --timestamp=none $(SYMROOT)/$@
313*bbb1b6f9SApple OSS Distributions
314*bbb1b6f9SApple OSS Distributionsipc/hardened_exceptions_entitled_debugger: excserver_protect_state
315*bbb1b6f9SApple OSS Distributionsipc/hardened_exceptions_entitled_debugger: CODE_SIGN_ENTITLEMENTS = entitlements/only_one_exception_port_debugger.entitlement
316*bbb1b6f9SApple OSS Distributionsipc/hardened_exceptions_entitled_debugger: exc_helpers.c ipc/hardened_exceptions.c $(OBJROOT)/excserver_protect_state.c
317*bbb1b6f9SApple OSS Distributions	mkdir -p $(SYMROOT)/ipc
318*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(OTHER_CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \
319*bbb1b6f9SApple OSS Distributions	$(filter-out $(CUSTOM_TARGETS), $^) -o $(SYMROOT)/$@
320*bbb1b6f9SApple OSS Distributions	$(CODESIGN) --force --sign -  --entitlements $(CODE_SIGN_ENTITLEMENTS) --timestamp=none $(SYMROOT)/$@
321*bbb1b6f9SApple OSS Distributions
322*bbb1b6f9SApple OSS Distributionsinstall-ipc/hardened_exceptions_entitled_debugger: ipc/hardened_exceptions_entitled_debugger
323*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
324*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/$< $(INSTALLDIR)/
325*bbb1b6f9SApple OSS Distributions
326*bbb1b6f9SApple OSS Distributionsinstall-ipc/hardened_exceptions_entitled: ipc/hardened_exceptions_entitled
327*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
328*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/$< $(INSTALLDIR)/
329*bbb1b6f9SApple OSS Distributions
330*bbb1b6f9SApple OSS Distributionsinstall-reply_port_defense_client: reply_port_defense_client
331*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
332*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/$< $(INSTALLDIR)/
333*bbb1b6f9SApple OSS Distributions
334*bbb1b6f9SApple OSS Distributionsimmovable_send: excserver
335*bbb1b6f9SApple OSS Distributionsimmovable_send: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
336*bbb1b6f9SApple OSS Distributionsimmovable_send: OTHER_LDFLAGS += -ldarwintest_utils -lpthread -framework IOKit
337*bbb1b6f9SApple OSS Distributionsimmovable_send: immovable_send_client
338*bbb1b6f9SApple OSS Distributionsimmovable_send: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
339*bbb1b6f9SApple OSS Distributions
340*bbb1b6f9SApple OSS Distributionslocks: OTHER_LDFLAGS += -ldarwintest_utils
341*bbb1b6f9SApple OSS Distributions
342*bbb1b6f9SApple OSS Distributionsimmovable_send_client: immovable_send_client.c
343*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) immovable_send_client.c -o $(SYMROOT)/immovable_send_client
344*bbb1b6f9SApple OSS Distributions
345*bbb1b6f9SApple OSS Distributionsinstall-immovable_send_client: immovable_send_client
346*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
347*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/immovable_send_client $(INSTALLDIR)/
348*bbb1b6f9SApple OSS Distributions
349*bbb1b6f9SApple OSS Distributionsipc/sys_perf_notify_test: excserver_protect_state
350*bbb1b6f9SApple OSS Distributionsipc/sys_perf_notify_test: OTHER_CFLAGS += $(OBJROOT)/excserver_protect_state.c -I $(OBJROOT)
351*bbb1b6f9SApple OSS Distributionsipc/sys_perf_notify_test: CODE_SIGN_ENTITLEMENTS=entitlements/sys_perf_notify_test.entitlements
352*bbb1b6f9SApple OSS Distributions
353*bbb1b6f9SApple OSS Distributionsipc/port_type_policy: CODE_SIGN_ENTITLEMENTS = entitlements/port_type_policy.entitlements
354*bbb1b6f9SApple OSS Distributionsipc/port_type_policy: OTHER_CFLAGS += -I $(OBJROOT)
355*bbb1b6f9SApple OSS Distributionsipc/port_type_policy: ipc/port_type_policy.c
356*bbb1b6f9SApple OSS Distributionsipc/port_type_policy: $(IPC_UTILS)
357*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(OTHER_CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \
358*bbb1b6f9SApple OSS Distributions	$(filter-out $(CUSTOM_TARGETS), $^) -o $(SYMROOT)/$@
359*bbb1b6f9SApple OSS Distributions	$(CODESIGN) --force --sign - --entitlements $(CODE_SIGN_ENTITLEMENTS) --timestamp=none $(SYMROOT)/$@
360*bbb1b6f9SApple OSS Distributions
361*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += posix_sem_namespace_helper.c
362*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS   += posix_sem_namespace_helper_team0 posix_sem_namespace_helper_team1
363*bbb1b6f9SApple OSS Distributionsposix_sem_namespace_helper_team0: posix_sem_namespace_helper.c
364*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \
365*bbb1b6f9SApple OSS Distributions	$^ -o $(SYMROOT)/$@
366*bbb1b6f9SApple OSS Distributions	$(CODESIGN) --force --sign - --timestamp=none --team-identifier "PSXSEMT0" $(SYMROOT)/$@
367*bbb1b6f9SApple OSS Distributionsposix_sem_namespace_helper_team1: posix_sem_namespace_helper.c
368*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \
369*bbb1b6f9SApple OSS Distributions	$^ -o $(SYMROOT)/$@
370*bbb1b6f9SApple OSS Distributions	$(CODESIGN) --force --sign - --timestamp=none --team-identifier "PSXSEMT1" $(SYMROOT)/$@
371*bbb1b6f9SApple OSS Distributions
372*bbb1b6f9SApple OSS Distributionsinstall-posix_sem_namespace_helper_team0: posix_sem_namespace_helper_team0
373*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
374*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/posix_sem_namespace_helper_team0 $(INSTALLDIR)/
375*bbb1b6f9SApple OSS Distributionsinstall-posix_sem_namespace_helper_team1: posix_sem_namespace_helper_team1
376*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
377*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/posix_sem_namespace_helper_team1 $(INSTALLDIR)/
378*bbb1b6f9SApple OSS Distributions
379*bbb1b6f9SApple OSS Distributionsposix_sem: posix_sem_namespace_helper_team0 posix_sem_namespace_helper_team1
380*bbb1b6f9SApple OSS Distributionsposix_sem: OTHER_LDFLAGS += -ldarwintest_utils
381*bbb1b6f9SApple OSS Distributions
382*bbb1b6f9SApple OSS Distributions
383*bbb1b6f9SApple OSS Distributionsposix_spawnattr_set_crash_behavior_np: posix_spawnattr_set_crash_behavior_np_child
384*bbb1b6f9SApple OSS Distributionsposix_spawnattr_set_crash_behavior_np: CODE_SIGN_ENTITLEMENTS = posix_spawnattr_set_crash_behavior_np_entitlements.plist
385*bbb1b6f9SApple OSS Distributions
386*bbb1b6f9SApple OSS Distributionsposix_spawnattr_set_crash_behavior_np_child: posix_spawnattr_set_crash_behavior_np_child.c
387*bbb1b6f9SApple 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
388*bbb1b6f9SApple OSS Distributions	$(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@
389*bbb1b6f9SApple OSS Distributions
390*bbb1b6f9SApple OSS Distributionsinstall-posix_spawnattr_set_crash_behavior_np_child: posix_spawnattr_set_crash_behavior_np_child
391*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
392*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/posix_spawnattr_set_crash_behavior_np_child $(INSTALLDIR)/
393*bbb1b6f9SApple OSS Distributions
394*bbb1b6f9SApple OSS Distributionsposix_spawnattr_set_launch_type_np: posix_spawnattr_set_launch_type_test
395*bbb1b6f9SApple OSS Distributionsposix_spawnattr_set_launch_type_np: OTHER_CFLAGS += -isystem $(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
396*bbb1b6f9SApple OSS Distributions
397*bbb1b6f9SApple OSS Distributionsposix_spawn_launch_type: CODE_SIGN_ENTITLEMENTS = posix_spawn_launch_type-entitlements.plist
398*bbb1b6f9SApple OSS Distributions
399*bbb1b6f9SApple OSS Distributionsport_exhaustion: OTHER_LDFLAGS += -ldarwintest_utils -lpthread
400*bbb1b6f9SApple OSS Distributionsport_exhaustion: port_exhaustion_client
401*bbb1b6f9SApple OSS Distributions
402*bbb1b6f9SApple OSS Distributionsport_exhaustion_client: port_exhaustion_client.c
403*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) port_exhaustion_client.c -o $(SYMROOT)/port_exhaustion_client
404*bbb1b6f9SApple OSS Distributions
405*bbb1b6f9SApple OSS Distributionsinstall-port_exhaustion_client: port_exhaustion_client
406*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
407*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/port_exhaustion_client $(INSTALLDIR)/
408*bbb1b6f9SApple OSS Distributions
409*bbb1b6f9SApple OSS Distributionsport_table_limits: rnserver
410*bbb1b6f9SApple OSS Distributionsport_table_limits: CODE_SIGN_ENTITLEMENTS = task_for_pid_entitlement.plist
411*bbb1b6f9SApple OSS Distributionsport_table_limits: OTHER_CFLAGS += $(OBJROOT)/rnServer.c -I $(OBJROOT)
412*bbb1b6f9SApple OSS Distributionsport_table_limits: OTHER_LDFLAGS += -ldarwintest_utils -lpthread
413*bbb1b6f9SApple OSS Distributionsport_table_limits: port_table_limits_client
414*bbb1b6f9SApple OSS Distributions
415*bbb1b6f9SApple OSS Distributionsport_table_limits_client: port_table_limits_client.c
416*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) port_table_limits_client.c -o $(SYMROOT)/port_table_limits_client
417*bbb1b6f9SApple OSS Distributions	$(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@
418*bbb1b6f9SApple OSS Distributions
419*bbb1b6f9SApple OSS Distributionsinstall-port_table_limits_client: port_table_limits_client
420*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
421*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/port_table_limits_client $(INSTALLDIR)/
422*bbb1b6f9SApple OSS Distributions
423*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += kqwl_rnserver
424*bbb1b6f9SApple OSS Distributions
425*bbb1b6f9SApple OSS Distributionskqwl_rnserver:
426*bbb1b6f9SApple OSS Distributions	$(MIG) $(CFLAGS) \
427*bbb1b6f9SApple OSS Distributions		-DKQWORKLOOPS_VIOLATION_SUPPORTED \
428*bbb1b6f9SApple OSS Distributions		-user /dev/null \
429*bbb1b6f9SApple OSS Distributions		-header $(OBJROOT)/kqwl_rn.h \
430*bbb1b6f9SApple OSS Distributions		-sheader $(OBJROOT)/kqwl_rnServer.h \
431*bbb1b6f9SApple OSS Distributions		-server $(OBJROOT)/kqwl_rnServer.c \
432*bbb1b6f9SApple OSS Distributions		rnserver.defs
433*bbb1b6f9SApple OSS Distributionsinstall-kqwl_rnserver: ;
434*bbb1b6f9SApple OSS Distributions
435*bbb1b6f9SApple OSS Distributionskqworkloop_limits: kqwl_rnserver
436*bbb1b6f9SApple OSS Distributionskqworkloop_limits: OTHER_CFLAGS += $(OBJROOT)/kqwl_rnServer.c -I $(OBJROOT)
437*bbb1b6f9SApple OSS Distributionskqworkloop_limits: OTHER_LDFLAGS += -ldarwintest_utils -lpthread
438*bbb1b6f9SApple OSS Distributionskqworkloop_limits: kqworkloop_limits_client
439*bbb1b6f9SApple OSS Distributions
440*bbb1b6f9SApple OSS Distributionskqworkloop_limits_client: kqworkloop_limits_client.c
441*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) kqworkloop_limits_client.c -o $(SYMROOT)/kqworkloop_limits_client
442*bbb1b6f9SApple OSS Distributions	$(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@
443*bbb1b6f9SApple OSS Distributions
444*bbb1b6f9SApple OSS Distributionsinstall-kqworkloop_limits_client: kqworkloop_limits_client
445*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
446*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/kqworkloop_limits_client $(INSTALLDIR)/
447*bbb1b6f9SApple OSS Distributions
448*bbb1b6f9SApple OSS Distributionsipc/task_name_for_pid: CODE_SIGN_ENTITLEMENTS = ipc/task_name_for_pid_entitlement.plist
449*bbb1b6f9SApple OSS Distributions
450*bbb1b6f9SApple OSS Distributionsipc/mach_msg_transport: CODE_SIGN_ENTITLEMENTS = entitlements/create_conn_port_with_port_array.entitlements
451*bbb1b6f9SApple OSS Distributions
452*bbb1b6f9SApple OSS Distributionsfd_table_limits: rnserver
453*bbb1b6f9SApple OSS Distributionsfd_table_limits: OTHER_CFLAGS += $(OBJROOT)/rnServer.c -I $(OBJROOT)
454*bbb1b6f9SApple OSS Distributionsfd_table_limits: OTHER_LDFLAGS += -ldarwintest_utils -lpthread
455*bbb1b6f9SApple OSS Distributionsfd_table_limits: fd_table_limits_client
456*bbb1b6f9SApple OSS Distributions
457*bbb1b6f9SApple OSS Distributionsfd_table_limits_client: fd_table_limits_client.c
458*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) fd_table_limits_client.c -o $(SYMROOT)/fd_table_limits_client
459*bbb1b6f9SApple OSS Distributions	$(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@
460*bbb1b6f9SApple OSS Distributions
461*bbb1b6f9SApple OSS Distributionsinstall-fd_table_limits_client: fd_table_limits_client
462*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
463*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/fd_table_limits_client $(INSTALLDIR)/
464*bbb1b6f9SApple OSS Distributions
465*bbb1b6f9SApple OSS Distributionsvm_spawn_tool: INVALID_ARCHS = i386
466*bbb1b6f9SApple OSS Distributionsvm_spawn_tool: vm_spawn_tool.c
467*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) vm_spawn_tool.c -o $(SYMROOT)/vm_spawn_tool
468*bbb1b6f9SApple OSS Distributions
469*bbb1b6f9SApple OSS Distributionsinstall-vm_spawn_tool: vm_spawn_tool
470*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)/tools
471*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/vm_spawn_tool $(INSTALLDIR)/tools/
472*bbb1b6f9SApple OSS Distributions
473*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += ipc/imm_pinned_control_port_crasher
474*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += ipc/imm_pinned_control_port_crasher_3P_hardened
475*bbb1b6f9SApple OSS Distributions
476*bbb1b6f9SApple OSS Distributionsipc/imm_pinned_control_port: excserver_protect
477*bbb1b6f9SApple OSS Distributionsipc/imm_pinned_control_port: CODE_SIGN_ENTITLEMENTS = entitlements/imm_pinned_control_port.entitlements
478*bbb1b6f9SApple OSS Distributionsipc/imm_pinned_control_port: OTHER_CFLAGS += $(OBJROOT)/excserver_protect.c -I $(OBJROOT)
479*bbb1b6f9SApple OSS Distributionsipc/imm_pinned_control_port: OTHER_LDFLAGS += -ldarwintest_utils -lpthread
480*bbb1b6f9SApple OSS Distributionsipc/imm_pinned_control_port: ipc/imm_pinned_control_port_crasher ipc/imm_pinned_control_port_crasher_3P_hardened
481*bbb1b6f9SApple OSS Distributions
482*bbb1b6f9SApple OSS Distributionsipc/imm_pinned_control_port_crasher: ipc/imm_pinned_control_port_crasher.c cs_helpers.c
483*bbb1b6f9SApple OSS Distributions	mkdir -p $(SYMROOT)/ipc
484*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \
485*bbb1b6f9SApple OSS Distributions	$^ -o $(SYMROOT)/$@
486*bbb1b6f9SApple OSS Distributions	$(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@
487*bbb1b6f9SApple OSS Distributions
488*bbb1b6f9SApple OSS Distributionsipc/imm_pinned_control_port_crasher_3P_hardened: CODE_SIGN_ENTITLEMENTS = entitlements/enhanced-security-binary-entitlements-1.plist
489*bbb1b6f9SApple OSS Distributionsipc/imm_pinned_control_port_crasher_3P_hardened: ipc/imm_pinned_control_port_crasher.c cs_helpers.c
490*bbb1b6f9SApple OSS Distributions	mkdir -p $(SYMROOT)/ipc
491*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \
492*bbb1b6f9SApple OSS Distributions	$^ -o $(SYMROOT)/$@
493*bbb1b6f9SApple OSS Distributions	$(CODESIGN) --force --sign - --entitlements $(CODE_SIGN_ENTITLEMENTS) --timestamp=none $(SYMROOT)/$@
494*bbb1b6f9SApple OSS Distributions
495*bbb1b6f9SApple OSS Distributionsinstall-ipc/imm_pinned_control_port: ipc/imm_pinned_control_port
496*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)/ipc
497*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/$< $(INSTALLDIR)/ipc/
498*bbb1b6f9SApple OSS Distributions
499*bbb1b6f9SApple OSS Distributionsinstall-ipc/imm_pinned_control_port_crasher: ipc/imm_pinned_control_port_crasher
500*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)/ipc
501*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/$< $(INSTALLDIR)/ipc/
502*bbb1b6f9SApple OSS Distributions
503*bbb1b6f9SApple OSS Distributionsinstall-ipc/imm_pinned_control_port_crasher_3P_hardened: ipc/imm_pinned_control_port_crasher_3P_hardened
504*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)/ipc
505*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/$< $(INSTALLDIR)/ipc/
506*bbb1b6f9SApple OSS Distributions
507*bbb1b6f9SApple OSS Distributions# Allow this test to pull {TASK, THREAD}_KERNEL_PORT via get-movable-control-port
508*bbb1b6f9SApple OSS Distributionsipc/imm_pinned_control_port_entitled: CODE_SIGN_ENTITLEMENTS = task_for_pid_entitlement.plist
509*bbb1b6f9SApple OSS Distributionsipc/imm_pinned_control_port_entitled: OTHER_LDFLAGS += -ldarwintest_utils -lpthread
510*bbb1b6f9SApple OSS Distributions
511*bbb1b6f9SApple OSS Distributionsinstall-ipc/imm_pinned_control_port_entitled: ipc/imm_pinned_control_port_entitled
512*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)/ipc
513*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/$< $(INSTALLDIR)/ipc/
514*bbb1b6f9SApple OSS Distributions
515*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += reply_port_defense_client
516*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += reply_port_defense_client_3P_hardened
517*bbb1b6f9SApple OSS Distributions
518*bbb1b6f9SApple OSS Distributionsreply_port_defense: excserver_protect_state
519*bbb1b6f9SApple OSS Distributionsreply_port_defense: OTHER_CFLAGS += $(OBJROOT)/excserver_protect_state.c -I $(OBJROOT)
520*bbb1b6f9SApple OSS Distributionsreply_port_defense: OTHER_LDFLAGS += -ldarwintest_utils -lpthread
521*bbb1b6f9SApple OSS Distributionsreply_port_defense: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
522*bbb1b6f9SApple OSS Distributionsreply_port_defense: reply_port_defense_client reply_port_defense_client_3P_hardened
523*bbb1b6f9SApple OSS Distributionsreply_port_defense: $(IPC_UTILS)
524*bbb1b6f9SApple OSS Distributions
525*bbb1b6f9SApple OSS Distributionsreply_port_defense_client: CODE_SIGN_ENTITLEMENTS=exception_tests.entitlements
526*bbb1b6f9SApple OSS Distributionsreply_port_defense_client: OTHER_LDFLAGS += -ldarwintest_utils -lpthread
527*bbb1b6f9SApple OSS Distributionsreply_port_defense_client: reply_port_defense_client.c cs_helpers.c
528*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \
529*bbb1b6f9SApple OSS Distributions	$^ -o $(SYMROOT)/$@
530*bbb1b6f9SApple OSS Distributions	$(CODESIGN) --force --sign - --entitlements $(CODE_SIGN_ENTITLEMENTS) --timestamp=none $(SYMROOT)/$@
531*bbb1b6f9SApple OSS Distributions
532*bbb1b6f9SApple OSS Distributionsreply_port_defense_client_3P_hardened: CODE_SIGN_ENTITLEMENTS=entitlements/enhanced-security-binary-entitlements-1.plist
533*bbb1b6f9SApple OSS Distributionsreply_port_defense_client_3P_hardened: reply_port_defense_client.c cs_helpers.c
534*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \
535*bbb1b6f9SApple OSS Distributions	$^ -o $(SYMROOT)/$@
536*bbb1b6f9SApple OSS Distributions	$(CODESIGN) --force --sign - --entitlements $(CODE_SIGN_ENTITLEMENTS) --timestamp=none $(SYMROOT)/$@
537*bbb1b6f9SApple OSS Distributions
538*bbb1b6f9SApple OSS Distributionsinstall-reply_port_defense_client: reply_port_defense_client
539*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
540*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/$< $(INSTALLDIR)/
541*bbb1b6f9SApple OSS Distributions
542*bbb1b6f9SApple OSS Distributionsinstall-reply_port_defense_client_3P_hardened: reply_port_defense_client_3P_hardened
543*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
544*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/$< $(INSTALLDIR)/
545*bbb1b6f9SApple OSS Distributions
546*bbb1b6f9SApple OSS Distributionskas_info: OTHER_LDFLAGS += -framework CoreSymbolication
547*bbb1b6f9SApple OSS Distributionskas_info: CODE_SIGN_ENTITLEMENTS = kernel_symbolication_entitlements.plist
548*bbb1b6f9SApple OSS Distributions
549*bbb1b6f9SApple OSS Distributionsnet_bounds_safety: OTHER_CFLAGS += -fbounds-safety
550*bbb1b6f9SApple OSS Distributions
551*bbb1b6f9SApple OSS Distributionsnet_no_bounds_safety: OTHER_CFLAGS += -fno-bounds-safety
552*bbb1b6f9SApple OSS Distributionsnet_no_bounds_safety: net_bounds_safety.c
553*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
554*bbb1b6f9SApple OSS DistributionsOTHER_TEST_TARGETS += net_no_bounds_safety
555*bbb1b6f9SApple OSS Distributions
556*bbb1b6f9SApple OSS Distributionshost_statistics_rate_limiting: cs_helpers.c host_statistics_rate_limiting.c
557*bbb1b6f9SApple OSS Distributions
558*bbb1b6f9SApple 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 vsock_helpers.c
559*bbb1b6f9SApple OSS Distributions
560*bbb1b6f9SApple OSS Distributionsifneq ($(IOS_TEST_COMPAT),YES)
561*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += jumbo_va_spaces_28530648.c perf_compressor.c vm/ios13extended_footprint.c vm/entitlement_internal_bands.c
562*bbb1b6f9SApple OSS Distributionsendif
563*bbb1b6f9SApple OSS Distributions
564*bbb1b6f9SApple OSS Distributionsperf_compressor: OTHER_LDFLAGS += -ldarwintest_utils
565*bbb1b6f9SApple OSS Distributionsperf_compressor: CODE_SIGN_ENTITLEMENTS=./private_entitlement.plist
566*bbb1b6f9SApple OSS Distributions
567*bbb1b6f9SApple OSS Distributions
568*bbb1b6f9SApple OSS Distributionsvm/memorystatus_freeze_test: CODE_SIGN_ENTITLEMENTS=./task_for_pid_entitlement.plist
569*bbb1b6f9SApple OSS Distributionsvm/memorystatus_freeze_test: OTHER_LDFLAGS += -ldarwintest_utils
570*bbb1b6f9SApple OSS Distributionsvm/memorystatus_freeze_test: memorystatus_assertion_helpers.c test_utils.c vm/memorystatus_freeze_test.c
571*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
572*bbb1b6f9SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements $(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@;
573*bbb1b6f9SApple OSS Distributions
574*bbb1b6f9SApple OSS Distributionsvm/memorystatus_freeze_test_entitled: CODE_SIGN_ENTITLEMENTS=./vm/memorystatus_freeze_test_entitled.plist
575*bbb1b6f9SApple OSS Distributionsvm/memorystatus_freeze_test_entitled: OTHER_LDFLAGS += -ldarwintest_utils
576*bbb1b6f9SApple OSS Distributionsvm/memorystatus_freeze_test_entitled: test_utils.c vm/memorystatus_freeze_test_entitled.c
577*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
578*bbb1b6f9SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements $(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@;
579*bbb1b6f9SApple OSS Distributions
580*bbb1b6f9SApple OSS Distributionsvm/memorystatus_jetsam_zprint_snapshot: CODE_SIGN_ENTITLEMENTS=./vm/memorystatus_jetsam_zprint_snapshot.entitlements
581*bbb1b6f9SApple OSS Distributionsvm/memorystatus_jetsam_zprint_snapshot: OTHER_LDFLAGS += -ldarwintest_utils
582*bbb1b6f9SApple OSS Distributions
583*bbb1b6f9SApple OSS Distributionsvm/memorystatus_kill_counts: CODE_SIGN_ENTITLEMENTS=./vm/memorystatus_kill_counts.entitlements
584*bbb1b6f9SApple OSS Distributionsvm/memorystatus_kill_counts: OTHER_LDFLAGS += -ldarwintest_utils
585*bbb1b6f9SApple OSS Distributions
586*bbb1b6f9SApple OSS Distributionsvm/neural_footprint: CODE_SIGN_ENTITLEMENTS=./vm/neural_footprint.entitlement
587*bbb1b6f9SApple OSS Distributionsvm/neural_footprint: OTHER_CFLAGS += -I $(OBJROOT)
588*bbb1b6f9SApple OSS Distributionsvm/neural_footprint: OTHER_LDFLAGS += -ldarwintest_utils
589*bbb1b6f9SApple OSS Distributionsvm/neural_footprint: test_utils.c vm/neural_footprint.c ./vm/neural_footprint.entitlement
590*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
591*bbb1b6f9SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements $(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@;
592*bbb1b6f9SApple OSS Distributions
593*bbb1b6f9SApple OSS Distributionsmemorystatus_is_assertion: OTHER_LDFLAGS += -ldarwintest_utils
594*bbb1b6f9SApple OSS Distributionsmemorystatus_is_assertion: OTHER_CFLAGS += memorystatus_assertion_helpers.c
595*bbb1b6f9SApple OSS Distributions
596*bbb1b6f9SApple OSS Distributionsmemorystatus_vm_map_fork: OTHER_CFLAGS += test_utils.c
597*bbb1b6f9SApple OSS Distributionsmemorystatus_vm_map_fork: OTHER_LDFLAGS += -ldarwintest_utils
598*bbb1b6f9SApple OSS Distributions
599*bbb1b6f9SApple OSS Distributionsshared_cache_tests: OTHER_LDFLAGS += -ldarwintest_utils
600*bbb1b6f9SApple OSS Distributions
601*bbb1b6f9SApple OSS Distributionsifneq ($(wildcard $(SDKROOT)/System/Library/PrivateFrameworks/Tightbeam.framework/Headers/tightbeam.h),)
602*bbb1b6f9SApple OSS Distributionsstackshot_tests: OTHER_LDFLAGS += -framework Tightbeam
603*bbb1b6f9SApple OSS Distributionsstackshot_tests: OTHER_CFLAGS += -I$(OBJROOT)
604*bbb1b6f9SApple OSS Distributionsstackshot_tests: OTHER_CFLAGS += $(TIGHTBEAM_MODULE_IMPL_PATH)
605*bbb1b6f9SApple OSS Distributionsstackshot_tests.m: $(TIGHTBEAM_MODULE_HEADERS)
606*bbb1b6f9SApple OSS Distributionsendif
607*bbb1b6f9SApple OSS Distributionsstackshot_tests: ./stackshot-entitlements.plist stackshot_tests.m
608*bbb1b6f9SApple OSS Distributionsstackshot_tests: CODE_SIGN_ENTITLEMENTS=./stackshot-entitlements.plist
609*bbb1b6f9SApple OSS Distributionsstackshot_tests: OTHER_CFLAGS += -Wno-objc-messaging-id test_utils.c
610*bbb1b6f9SApple OSS Distributionsstackshot_tests: OTHER_LDFLAGS += -lkdd -lz -ldarwintest_utils -framework Foundation -framework IOKit
611*bbb1b6f9SApple OSS Distributions
612*bbb1b6f9SApple OSS Distributionsstackshot_accuracy: ./stackshot-entitlements.plist
613*bbb1b6f9SApple OSS Distributionsstackshot_accuracy: CODE_SIGN_ENTITLEMENTS=./stackshot-entitlements.plist
614*bbb1b6f9SApple OSS Distributionsstackshot_accuracy: OTHER_CFLAGS += -ldarwintest_utils -Wno-objc-messaging-id
615*bbb1b6f9SApple OSS Distributionsstackshot_accuracy: OTHER_LDFLAGS += -lkdd -ldarwintest_utils -framework Foundation
616*bbb1b6f9SApple OSS Distributionsstackshot_accuracy: INVALID_ARCHS = i386
617*bbb1b6f9SApple OSS Distributions
618*bbb1b6f9SApple OSS Distributionsstackshot_spawn_exit_stress: ./stackshot-entitlements.plist
619*bbb1b6f9SApple OSS Distributionsstackshot_spawn_exit_stress: CODE_SIGN_ENTITLEMENTS=./stackshot-entitlements.plist
620*bbb1b6f9SApple OSS Distributions
621*bbb1b6f9SApple OSS Distributionsifeq ($(PLATFORM),MacOSX)
622*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += stackshot_translated_child
623*bbb1b6f9SApple OSS Distributions
624*bbb1b6f9SApple OSS Distributionsstackshot_translated_child: INVALID_ARCHS = arm64 arm64e
625*bbb1b6f9SApple OSS Distributionsstackshot_translated_child: stackshot_translated_child.c
626*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) stackshot_translated_child.c -o $(SYMROOT)/stackshot_translated_child
627*bbb1b6f9SApple OSS Distributions
628*bbb1b6f9SApple OSS Distributionsinstall-stackshot_translated_child: stackshot_translated_child
629*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
630*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/stackshot_translated_child $(INSTALLDIR)/
631*bbb1b6f9SApple OSS Distributionselse
632*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += stackshot_translated_child.c
633*bbb1b6f9SApple OSS Distributionsendif
634*bbb1b6f9SApple OSS Distributions
635*bbb1b6f9SApple OSS Distributionsmicrostackshot_tests: ./stackshot-entitlements.plist
636*bbb1b6f9SApple OSS Distributionsmicrostackshot_tests: CODE_SIGN_ENTITLEMENTS=./stackshot-entitlements.plist
637*bbb1b6f9SApple OSS Distributionsmicrostackshot_tests: OTHER_LDFLAGS = -ldarwintest_utils -framework ktrace -framework kperf -framework CoreFoundation
638*bbb1b6f9SApple OSS Distributions
639*bbb1b6f9SApple OSS Distributionsmemorystatus_zone_test: ./stackshot-entitlements.plist
640*bbb1b6f9SApple OSS Distributionsmemorystatus_zone_test: CODE_SIGN_ENTITLEMENTS=./stackshot-entitlements.plist
641*bbb1b6f9SApple OSS Distributionsmemorystatus_zone_test: OTHER_CFLAGS += -isystem $(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
642*bbb1b6f9SApple OSS Distributionsmemorystatus_zone_test: OTHER_LDFLAGS += -framework ktrace
643*bbb1b6f9SApple OSS Distributionsmemorystatus_zone_test: OTHER_LDFLAGS += -ldarwintest_utils
644*bbb1b6f9SApple OSS Distributions
645*bbb1b6f9SApple OSS Distributionsmemcmp_zero: OTHER_CFLAGS += ../osfmk/arm64/memcmp_zero.s
646*bbb1b6f9SApple OSS Distributions
647*bbb1b6f9SApple OSS Distributionstext_corruption: OTHER_LDFLAGS += -ldarwintest_utils
648*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += text_corruption_helper
649*bbb1b6f9SApple OSS Distributions
650*bbb1b6f9SApple OSS Distributionstext_corruption_helper:
651*bbb1b6f9SApple OSS Distributions	$(CC) $(LDFLAGS) $(CFLAGS) text_corruption_helper.c -lm -o $(SYMROOT)/$@;
652*bbb1b6f9SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
653*bbb1b6f9SApple OSS Distributions
654*bbb1b6f9SApple OSS Distributionsinstall-text_corruption_helper: text_corruption_helper
655*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
656*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/text_corruption_helper $(INSTALLDIR)/
657*bbb1b6f9SApple OSS Distributions
658*bbb1b6f9SApple OSS Distributionscodesigntests: CODE_SIGN_ENTITLEMENTS=codesigntests-entitlements.plist
659*bbb1b6f9SApple OSS Distributionscodesigntests: OTHER_CFLAGS += -DTESTNAME=codesigntests
660*bbb1b6f9SApple OSS Distributions# Adding a custom target and build/install rules since CODE_SIGN_ENTITLEMENTS
661*bbb1b6f9SApple OSS Distributions# does not take in arguments, and we need to sign this test using a sha256T
662*bbb1b6f9SApple OSS Distributions# digest
663*bbb1b6f9SApple OSS Distributions
664*bbb1b6f9SApple OSS DistributionsOTHER_TEST_TARGETS += codesigntests_sha256t
665*bbb1b6f9SApple OSS Distributionscodesigntests_sha256t: OTHER_CFLAGS += -DTESTNAME=codesigntests_sha256t
666*bbb1b6f9SApple OSS Distributions
667*bbb1b6f9SApple OSS Distributionscodesigntests_sha256t: codesigntests.c
668*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(DT_LDFLAGS) $(LDFLAGS) $(CFLAGS) codesigntests.c -o $(SYMROOT)/$@;
669*bbb1b6f9SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --digest=sha256T -s - --entitlements codesigntests-entitlements.plist $(SYMROOT)/$@;
670*bbb1b6f9SApple OSS Distributionsinstall-codesigntests_sha256t: codesigntests_sha256t
671*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
672*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/codesigntests_sha256t $(INSTALLDIR)/
673*bbb1b6f9SApple OSS Distributions
674*bbb1b6f9SApple OSS Distributions
675*bbb1b6f9SApple OSS Distributionsecc_test: OTHER_LDFLAGS += -ldarwintest_utils
676*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += ecc_test_helper
677*bbb1b6f9SApple OSS Distributions
678*bbb1b6f9SApple OSS Distributionsecc_test_helper:
679*bbb1b6f9SApple OSS Distributions	$(CC) $(LDFLAGS) $(CFLAGS) ecc_test_helper.c -lm -o $(SYMROOT)/$@;
680*bbb1b6f9SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
681*bbb1b6f9SApple OSS Distributions
682*bbb1b6f9SApple OSS Distributionsinstall-ecc_test_helper: ecc_test_helper
683*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
684*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/ecc_test_helper $(INSTALLDIR)/
685*bbb1b6f9SApple OSS Distributions
686*bbb1b6f9SApple OSS Distributionsvm/test_vm_no_pager: excserver
687*bbb1b6f9SApple OSS Distributionsvm/test_vm_no_pager: OTHER_LDFLAGS += -ldarwintest_utils -lpthread -lkdd -framework Foundation
688*bbb1b6f9SApple OSS Distributionsvm/test_vm_no_pager: OTHER_CFLAGS += -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders $(OBJROOT)/excserver.c -I$(OBJROOT)
689*bbb1b6f9SApple OSS Distributionsvm/test_vm_no_pager: vm/test_vm_no_pager_helper
690*bbb1b6f9SApple OSS Distributionsvm/test_vm_no_pager: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
691*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += vm/test_vm_no_pager_helper
692*bbb1b6f9SApple OSS Distributions
693*bbb1b6f9SApple OSS Distributionsvm/test_vm_no_pager_helper: vm/test_vm_no_pager_helper.c
694*bbb1b6f9SApple OSS Distributions	$(CC) $(CFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -lm -o $(SYMROOT)/$@;
695*bbb1b6f9SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
696*bbb1b6f9SApple OSS Distributions
697*bbb1b6f9SApple OSS Distributionsinstall-vm/test_vm_no_pager_helper: vm/test_vm_no_pager_helper
698*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)/vm
699*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/vm/test_vm_no_pager_helper $(INSTALLDIR)/vm/
700*bbb1b6f9SApple OSS Distributions
701*bbb1b6f9SApple OSS Distributions
702*bbb1b6f9SApple OSS Distributionskevent_qos: OTHER_CFLAGS += -Wno-unused-macros
703*bbb1b6f9SApple OSS Distributionskevent_qos: OTHER_CFLAGS += -I $(OBJROOT)/
704*bbb1b6f9SApple OSS Distributions
705*bbb1b6f9SApple OSS Distributionstest_knote_use_after_free: OTHER_CFLAGS += -Wno-unused-macros
706*bbb1b6f9SApple OSS Distributionstest_knote_use_after_free: OTHER_LDFLAGS += -ldarwintest_utils -lpthread
707*bbb1b6f9SApple OSS Distributions
708*bbb1b6f9SApple OSS Distributionsmach_get_times: OTHER_LDFLAGS += -ldarwintest_utils
709*bbb1b6f9SApple OSS Distributions
710*bbb1b6f9SApple OSS Distributionsmonotonic_core: ./stackshot-entitlements.plist
711*bbb1b6f9SApple OSS Distributionsmonotonic_core: CODE_SIGN_ENTITLEMENTS=./stackshot-entitlements.plist
712*bbb1b6f9SApple OSS Distributionsmonotonic_core: OTHER_LDFLAGS += -framework ktrace
713*bbb1b6f9SApple OSS Distributions
714*bbb1b6f9SApple OSS Distributionsperf_exit: perf_exit_proc
715*bbb1b6f9SApple OSS Distributionsperf_exit: ./stackshot-entitlements.plist
716*bbb1b6f9SApple OSS Distributionsperf_exit: CODE_SIGN_ENTITLEMENTS=./stackshot-entitlements.plist
717*bbb1b6f9SApple OSS Distributionsperf_exit: OTHER_LDFLAGS = -framework ktrace -ldarwintest_utils
718*bbb1b6f9SApple OSS Distributionsperf_exit: CODE_SIGN_ENTITLEMENTS=./private_entitlement.plist
719*bbb1b6f9SApple OSS Distributions
720*bbb1b6f9SApple OSS Distributionsipc/mach_exc_port_substitute: excserver
721*bbb1b6f9SApple OSS Distributionsipc/mach_exc_port_substitute: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
722*bbb1b6f9SApple OSS Distributionsipc/mach_exc_port_substitute: CODE_SIGN_ENTITLEMENTS = ipc/mach_exc_port_substitute.plist
723*bbb1b6f9SApple OSS Distributions
724*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += prioritize_process_launch_helper
725*bbb1b6f9SApple OSS Distributionsprioritize_process_launch: prioritize_process_launch_helper
726*bbb1b6f9SApple OSS Distributions
727*bbb1b6f9SApple OSS Distributionsprioritize_process_launch_helper: prioritize_process_launch_helper.c
728*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) prioritize_process_launch_helper.c -o $(SYMROOT)/prioritize_process_launch_helper
729*bbb1b6f9SApple OSS Distributions	echo $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@; \
730*bbb1b6f9SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
731*bbb1b6f9SApple OSS Distributions
732*bbb1b6f9SApple OSS Distributionsinstall-prioritize_process_launch_helper: prioritize_process_launch_helper
733*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
734*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/prioritize_process_launch_helper $(INSTALLDIR)/
735*bbb1b6f9SApple OSS Distributions
736*bbb1b6f9SApple OSS Distributions
737*bbb1b6f9SApple OSS Distributionsperf_spawn_fork: CODE_SIGN_ENTITLEMENTS=./private_entitlement.plist
738*bbb1b6f9SApple OSS Distributions
739*bbb1b6f9SApple OSS Distributionsmach_exception_reply: OTHER_CFLAGS += -Wno-cast-align
740*bbb1b6f9SApple OSS Distributionsmach_exception_reply: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
741*bbb1b6f9SApple OSS Distributions
742*bbb1b6f9SApple OSS Distributionsos_thread_self_restrict: os_thread_self_restrict.c os_thread_self_restrict-entitlements.plist
743*bbb1b6f9SApple OSS Distributionsos_thread_self_restrict: CODE_SIGN_ENTITLEMENTS=os_thread_self_restrict-entitlements.plist
744*bbb1b6f9SApple OSS Distributionsos_thread_self_restrict: OTHER_LDFLAGS += -sectcreate __TEXT __info_plist os_thread_self_restrict-identifier.plist
745*bbb1b6f9SApple OSS Distributions
746*bbb1b6f9SApple OSS Distributions# Temporarily disabled.  See rdar://121952316
747*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += os_thread_self_restrict.c
748*bbb1b6f9SApple OSS Distributions
749*bbb1b6f9SApple OSS Distributionssubsystem_root_path: subsystem_root_path.c subsystem_root_path-entitlements.plist
750*bbb1b6f9SApple OSS Distributionssubsystem_root_path: CODE_SIGN_ENTITLEMENTS=subsystem_root_path-entitlements.plist
751*bbb1b6f9SApple OSS Distributions
752*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += $(wildcard bounded_ptr_src/*.cpp)
753*bbb1b6f9SApple OSS Distributionsbounded_ptr: OTHER_CXXFLAGS += -Werror=implicit-int-conversion -Werror=shorten-64-to-32 -I$(SRCROOT)/../libkern -std=c++17
754*bbb1b6f9SApple OSS Distributionsbounded_ptr: $(wildcard bounded_ptr_src/*.cpp) bounded_ptr.cpp
755*bbb1b6f9SApple OSS Distributions
756*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += bounded_ptr_03.cpp
757*bbb1b6f9SApple OSS Distributionsbounded_ptr_03: OTHER_CXXFLAGS += -Werror=implicit-int-conversion -Werror=shorten-64-to-32 -I$(SRCROOT)/../libkern -std=c++03 $(DT_LDFLAGS)
758*bbb1b6f9SApple OSS Distributionsbounded_ptr_03: bounded_ptr_03.cpp
759*bbb1b6f9SApple OSS Distributions
760*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += $(wildcard bounded_array_src/*.cpp)
761*bbb1b6f9SApple OSS Distributionsbounded_array: OTHER_CXXFLAGS += -Werror=implicit-int-conversion -Werror=shorten-64-to-32 -I$(SRCROOT)/../libkern -std=c++17
762*bbb1b6f9SApple OSS Distributionsbounded_array: $(wildcard bounded_array_src/*.cpp) bounded_array.cpp
763*bbb1b6f9SApple OSS Distributions
764*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += $(wildcard bounded_array_ref_src/*.cpp)
765*bbb1b6f9SApple OSS Distributionsbounded_array_ref: OTHER_CXXFLAGS += -Werror=implicit-int-conversion -Werror=shorten-64-to-32 -I$(SRCROOT)/../libkern -std=c++17
766*bbb1b6f9SApple OSS Distributionsbounded_array_ref: $(wildcard bounded_array_ref_src/*.cpp) bounded_array_ref.cpp
767*bbb1b6f9SApple OSS Distributions
768*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += $(wildcard intrusive_shared_ptr_src/*.cpp)
769*bbb1b6f9SApple OSS Distributionsintrusive_shared_ptr: OTHER_CXXFLAGS += -Werror=implicit-int-conversion -Werror=shorten-64-to-32 -I$(SRCROOT)/../libkern -std=c++17
770*bbb1b6f9SApple OSS Distributionsintrusive_shared_ptr: $(wildcard intrusive_shared_ptr_src/*.cpp) intrusive_shared_ptr.cpp
771*bbb1b6f9SApple OSS Distributions
772*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += $(wildcard safe_allocation_src/*.cpp)
773*bbb1b6f9SApple OSS Distributionssafe_allocation: OTHER_CXXFLAGS += -Werror=implicit-int-conversion -Werror=shorten-64-to-32 -I$(SRCROOT)/../libkern -std=c++17
774*bbb1b6f9SApple OSS Distributionssafe_allocation: $(wildcard safe_allocation_src/*.cpp) safe_allocation.cpp
775*bbb1b6f9SApple OSS Distributions
776*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += $(wildcard cxx_safe_buffers_src/*.cpp)
777*bbb1b6f9SApple OSS Distributionscxx_safe_buffers: OTHER_CXXFLAGS += -Werror=unsafe-buffer-usage -I$(SRCROOT)/../libkern -std=c++20
778*bbb1b6f9SApple OSS Distributionscxx_safe_buffers: $(wildcard cxx_safe_buffers_src/*.cpp) cxx_safe_buffers.cpp
779*bbb1b6f9SApple OSS Distributions
780*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += osptr_compat.cpp
781*bbb1b6f9SApple OSS Distributionsosptr_98: OTHER_CXXFLAGS += -I$(SRCROOT)/../libkern -std=c++98 -DOSPTR_STD="98"
782*bbb1b6f9SApple OSS Distributionsosptr_98: osptr_compat.cpp
783*bbb1b6f9SApple OSS Distributions	$(CXX) $(DT_CXXFLAGS) $(OTHER_CXXFLAGS) $(CXXFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
784*bbb1b6f9SApple OSS Distributionsosptr_11: OTHER_CXXFLAGS += -I$(SRCROOT)/../libkern -std=c++11 -DOSPTR_STD="11"
785*bbb1b6f9SApple OSS Distributionsosptr_11: osptr_compat.cpp
786*bbb1b6f9SApple OSS Distributions	$(CXX) $(DT_CXXFLAGS) $(OTHER_CXXFLAGS) $(CXXFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
787*bbb1b6f9SApple OSS Distributionsosptr_14: OTHER_CXXFLAGS += -I$(SRCROOT)/../libkern -std=c++14 -DOSPTR_STD="14"
788*bbb1b6f9SApple OSS Distributionsosptr_14: osptr_compat.cpp
789*bbb1b6f9SApple OSS Distributions	$(CXX) $(DT_CXXFLAGS) $(OTHER_CXXFLAGS) $(CXXFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
790*bbb1b6f9SApple OSS Distributionsosptr_17: OTHER_CXXFLAGS += -I$(SRCROOT)/../libkern -std=c++17 -DOSPTR_STD="17"
791*bbb1b6f9SApple OSS Distributionsosptr_17: osptr_compat.cpp
792*bbb1b6f9SApple OSS Distributions	$(CXX) $(DT_CXXFLAGS) $(OTHER_CXXFLAGS) $(CXXFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
793*bbb1b6f9SApple OSS Distributions
794*bbb1b6f9SApple OSS Distributionspriority_queue: OTHER_CXXFLAGS += -std=c++17
795*bbb1b6f9SApple OSS Distributionsqueue: OTHER_CFLAGS += -I$(SRCROOT)/../osfmk
796*bbb1b6f9SApple OSS Distributions
797*bbb1b6f9SApple OSS Distributionsvm/zalloc: OTHER_LDFLAGS += -ldarwintest_utils
798*bbb1b6f9SApple OSS Distributionsvm/zalloc_buddy: OTHER_CFLAGS += -Wno-format-pedantic
799*bbb1b6f9SApple OSS Distributions
800*bbb1b6f9SApple OSS Distributionsos_refcnt: OTHER_CFLAGS += -I$(SRCROOT)/../libkern/ -Wno-gcc-compat -Wno-undef -O3 -flto -ldarwintest_utils
801*bbb1b6f9SApple OSS Distributions
802*bbb1b6f9SApple OSS Distributionskernel_inspection: CODE_SIGN_ENTITLEMENTS = ./task_for_pid_entitlement.plist
803*bbb1b6f9SApple OSS Distributionskernel_inspection: OTHER_CFLAGS += -DENTITLED=1
804*bbb1b6f9SApple OSS Distributions
805*bbb1b6f9SApple OSS Distributionsturnstile_multihop: OTHER_CFLAGS += -Wno-unused-macros
806*bbb1b6f9SApple OSS Distributionsturnstile_multihop: OTHER_CFLAGS += -I $(OBJROOT)/
807*bbb1b6f9SApple OSS Distributions
808*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += perf_exit_proc
809*bbb1b6f9SApple OSS Distributions
810*bbb1b6f9SApple OSS Distributionsperf_exit_proc:
811*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) perf_exit_proc.c -o $(SYMROOT)/perf_exit_proc
812*bbb1b6f9SApple OSS Distributions
813*bbb1b6f9SApple OSS Distributionsinstall-perf_exit_proc: perf_exit_proc
814*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
815*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/perf_exit_proc $(INSTALLDIR)/
816*bbb1b6f9SApple OSS Distributions
817*bbb1b6f9SApple OSS Distributions# Stackshot
818*bbb1b6f9SApple OSS Distributions
819*bbb1b6f9SApple OSS Distributions
820*bbb1b6f9SApple OSS Distributionsstackshot_idle_25570396: ./stackshot-entitlements.plist
821*bbb1b6f9SApple OSS Distributionsstackshot_idle_25570396: CODE_SIGN_ENTITLEMENTS=./stackshot-entitlements.plist
822*bbb1b6f9SApple OSS Distributionsstackshot_idle_25570396: OTHER_LDFLAGS += -lkdd -framework Foundation
823*bbb1b6f9SApple OSS Distributionsstackshot_idle_25570396: OTHER_LDFLAGS += -lkdd -framework Foundation
824*bbb1b6f9SApple OSS Distributions
825*bbb1b6f9SApple OSS Distributionsstackshot_block_owner_14362384: ./stackshot-entitlements.plist
826*bbb1b6f9SApple OSS Distributionsstackshot_block_owner_14362384: CODE_SIGN_ENTITLEMENTS=./stackshot-entitlements.plist
827*bbb1b6f9SApple OSS Distributionsstackshot_block_owner_14362384: OTHER_LDFLAGS += -framework Foundation -lpthread -lkdd
828*bbb1b6f9SApple OSS Distributionsifeq ($(PLATFORM),MacOSX)
829*bbb1b6f9SApple OSS Distributionsstackshot_block_owner_14362384: OTHER_LDFLAGS += -lpcre
830*bbb1b6f9SApple OSS Distributionsendif
831*bbb1b6f9SApple OSS Distributions
832*bbb1b6f9SApple OSS Distributionsall: $(DSTROOT)/usr/local/bin/kcdata
833*bbb1b6f9SApple OSS Distributions
834*bbb1b6f9SApple OSS Distributions$(DSTROOT)/usr/local/bin/kcdata: $(SRCROOT)/../tools/lldbmacros/kcdata.py
835*bbb1b6f9SApple OSS Distributions	mkdir -p $(dir $@)
836*bbb1b6f9SApple OSS Distributions	cp $< $@
837*bbb1b6f9SApple OSS Distributions	chmod a+x $@
838*bbb1b6f9SApple OSS Distributions
839*bbb1b6f9SApple OSS Distributionsxnu_quick_test: OTHER_CFLAGS += xnu_quick_test_helpers.c
840*bbb1b6f9SApple OSS Distributions
841*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += vm_set_max_addr_helper
842*bbb1b6f9SApple OSS Distributions
843*bbb1b6f9SApple OSS Distributionsvm_set_max_addr_helper: vm_set_max_addr_helper.c
844*bbb1b6f9SApple OSS Distributions	$(CC) $(OTHER_CFLAGS) $(CFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) vm_set_max_addr_helper.c -o $(SYMROOT)/vm_set_max_addr_helper; \
845*bbb1b6f9SApple OSS Distributions	echo $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@; \
846*bbb1b6f9SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
847*bbb1b6f9SApple OSS Distributions
848*bbb1b6f9SApple OSS Distributionsinstall-vm_set_max_addr_helper: vm_set_max_addr_helper
849*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
850*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/vm_set_max_addr_helper $(INSTALLDIR)/
851*bbb1b6f9SApple OSS Distributions
852*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += subsystem_root_path_helper_entitled
853*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += subsystem_root_path_helper
854*bbb1b6f9SApple OSS Distributions
855*bbb1b6f9SApple OSS Distributionssubsystem_root_path_helper_entitled: subsystem_root_path_helper.c subsystem_root_path-entitlements.plist
856*bbb1b6f9SApple OSS Distributions	$(CC) $(OTHER_CFLAGS) $(CFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) subsystem_root_path_helper.c -o $(SYMROOT)/subsystem_root_path_helper_entitled; \
857*bbb1b6f9SApple OSS Distributions	echo $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@; \
858*bbb1b6f9SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements subsystem_root_path-entitlements.plist $(SYMROOT)/$@;
859*bbb1b6f9SApple OSS Distributions
860*bbb1b6f9SApple OSS Distributionsinstall-subsystem_root_path_helper_entitled: subsystem_root_path_helper_entitled
861*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
862*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/subsystem_root_path_helper_entitled $(INSTALLDIR)/
863*bbb1b6f9SApple OSS Distributions
864*bbb1b6f9SApple OSS Distributionssubsystem_root_path_helper: subsystem_root_path_helper.c
865*bbb1b6f9SApple OSS Distributions	$(CC) $(OTHER_CFLAGS) $(CFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) subsystem_root_path_helper.c -o $(SYMROOT)/subsystem_root_path_helper; \
866*bbb1b6f9SApple OSS Distributions	echo $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@; \
867*bbb1b6f9SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
868*bbb1b6f9SApple OSS Distributions
869*bbb1b6f9SApple OSS Distributionsinstall-subsystem_root_path_helper: subsystem_root_path_helper
870*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
871*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/subsystem_root_path_helper $(INSTALLDIR)/
872*bbb1b6f9SApple OSS Distributions
873*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += vm_test_code_signing_helper
874*bbb1b6f9SApple OSS Distributions
875*bbb1b6f9SApple OSS Distributionsvm_test_code_signing_helper: vm_test_code_signing_helper.c
876*bbb1b6f9SApple OSS Distributions	$(CC) $(OTHER_CFLAGS) $(CFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) vm_test_code_signing_helper.c -o $(SYMROOT)/vm_test_code_signing_helper; \
877*bbb1b6f9SApple OSS Distributions	echo $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@; \
878*bbb1b6f9SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
879*bbb1b6f9SApple OSS Distributions
880*bbb1b6f9SApple OSS Distributionsinstall-vm_test_code_signing_helper: vm_test_code_signing_helper
881*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
882*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/vm_test_code_signing_helper $(INSTALLDIR)/
883*bbb1b6f9SApple OSS Distributions
884*bbb1b6f9SApple OSS Distributionsvm_test_code_signing: OTHER_LDFLAGS += -ldarwintest_utils
885*bbb1b6f9SApple OSS Distributions
886*bbb1b6f9SApple OSS DistributionsINCLUDED_TEST_SOURCE_DIRS += ipc rm workq
887*bbb1b6f9SApple OSS Distributions
888*bbb1b6f9SApple OSS Distributionsinclude vm/Makefile
889*bbb1b6f9SApple OSS Distributions
890*bbb1b6f9SApple OSS Distributionsvm/vm_stress: OTHER_CXXFLAGS += -std=c++20
891*bbb1b6f9SApple OSS Distributionsvm/vm_stress: OTHER_LDFLAGS += -ldarwintest_utils
892*bbb1b6f9SApple OSS Distributionsvm/vm_stress: INVALID_ARCHS = x86_64h
893*bbb1b6f9SApple OSS Distributions
894*bbb1b6f9SApple OSS Distributions
895*bbb1b6f9SApple OSS Distributionsbig_map_test: CODE_SIGN_ENTITLEMENTS = ./big_map_test_entitlement.plist
896*bbb1b6f9SApple OSS Distributions
897*bbb1b6f9SApple OSS Distributionstask_info_28439149: CODE_SIGN_ENTITLEMENTS = ./task_for_pid_entitlement.plist
898*bbb1b6f9SApple OSS Distributions
899*bbb1b6f9SApple OSS Distributionsipc/ipc_read_inspect: CODE_SIGN_ENTITLEMENTS = ./task_for_pid_entitlement.plist
900*bbb1b6f9SApple OSS Distributions
901*bbb1b6f9SApple OSS Distributionsipc/ipc_thread_ports_race: CODE_SIGN_ENTITLEMENTS = ./task_for_pid_entitlement.plist
902*bbb1b6f9SApple OSS Distributionsipc/ipc_thread_ports_race: OTHER_LDFLAGS += -ldarwintest_utils
903*bbb1b6f9SApple OSS Distributions
904*bbb1b6f9SApple OSS Distributionsrm/pthread_setugid: OTHER_LDFLAGS += -ldarwintest_utils
905*bbb1b6f9SApple OSS Distributionsrm/coalition_info_resource_usage: OTHER_LDFLAGS += -ldarwintest_utils
906*bbb1b6f9SApple OSS Distributions
907*bbb1b6f9SApple OSS Distributionsproc_info: recount/recount_test_utils.c
908*bbb1b6f9SApple OSS Distributionsproc_info: CODE_SIGN_ENTITLEMENTS = ./task_for_pid_entitlement.plist
909*bbb1b6f9SApple OSS Distributionsproc_info: OTHER_LDFLAGS += -ldarwintest_utils
910*bbb1b6f9SApple OSS Distributions
911*bbb1b6f9SApple OSS Distributionsproc_info_list_kthreads: CODE_SIGN_ENTITLEMENTS = ./proc_info_list_kthreads.entitlements
912*bbb1b6f9SApple OSS Distributions
913*bbb1b6f9SApple OSS Distributionsproc_info_44873309: CODE_SIGN_ENTITLEMENTS = ./proc_info_44873309.entitlements
914*bbb1b6f9SApple OSS Distributions
915*bbb1b6f9SApple OSS Distributionsdisk_mount_conditioner: disk_mount_conditioner*
916*bbb1b6f9SApple OSS Distributionsdisk_mount_conditioner: CODE_SIGN_ENTITLEMENTS=./disk_mount_conditioner-entitlements.plist
917*bbb1b6f9SApple OSS Distributionsdisk_mount_conditioner: OTHER_LDFLAGS += -ldarwintest_utils -framework Foundation
918*bbb1b6f9SApple OSS Distributions
919*bbb1b6f9SApple OSS Distributionsdisk_mount_conditioner: OTHER_TEST_TARGETS += disk_mount_conditioner_unentitled
920*bbb1b6f9SApple OSS Distributionsdisk_mount_conditioner_unentitled: OTHER_CFLAGS += -DTEST_UNENTITLED
921*bbb1b6f9SApple OSS Distributionsdisk_mount_conditioner_unentitled: OTHER_LDFLAGS += -ldarwintest_utils -framework Foundation
922*bbb1b6f9SApple OSS Distributionsdisk_mount_conditioner_unentitled: disk_mount_conditioner.m
923*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
924*bbb1b6f9SApple OSS Distributions
925*bbb1b6f9SApple OSS Distributionswork_interval_test: CODE_SIGN_ENTITLEMENTS = work_interval_test.entitlements
926*bbb1b6f9SApple OSS Distributionswork_interval_test: OTHER_CFLAGS += -DENTITLED=1
927*bbb1b6f9SApple OSS Distributions
928*bbb1b6f9SApple OSS Distributionswork_interval_data_test: CODE_SIGN_ENTITLEMENTS = work_interval_test.entitlements
929*bbb1b6f9SApple OSS Distributionswork_interval_data_test: OTHER_CFLAGS += -DENTITLED=1
930*bbb1b6f9SApple OSS Distributionswork_interval_data_test: OTHER_LDFLAGS += -lpthread
931*bbb1b6f9SApple OSS Distributions
932*bbb1b6f9SApple OSS Distributionsgame_mode: CODE_SIGN_ENTITLEMENTS = game_mode.entitlements
933*bbb1b6f9SApple OSS Distributionscarplay_mode: CODE_SIGN_ENTITLEMENTS = carplay_mode.entitlements
934*bbb1b6f9SApple OSS Distributionsrunaway_mitigation: CODE_SIGN_ENTITLEMENTS = runaway_mitigation.entitlements
935*bbb1b6f9SApple OSS Distributions
936*bbb1b6f9SApple OSS Distributionscoalition_policy: CODE_SIGN_ENTITLEMENTS = coalition_policy.entitlements
937*bbb1b6f9SApple OSS Distributionscoalition_policy: OTHER_LDFLAGS += $(SCHED_UTILS_FLAGS)
938*bbb1b6f9SApple OSS Distributionscoalition_policy: $(SCHED_UTILS)
939*bbb1b6f9SApple OSS Distributions
940*bbb1b6f9SApple OSS Distributionssettimeofday_29193041: OTHER_CFLAGS += drop_priv.c
941*bbb1b6f9SApple OSS Distributions
942*bbb1b6f9SApple OSS Distributionssettimeofday_29193041_entitled: CODE_SIGN_ENTITLEMENTS = settimeofday_29193041.entitlements
943*bbb1b6f9SApple OSS Distributionssettimeofday_29193041_entitled: OTHER_CFLAGS += drop_priv.c
944*bbb1b6f9SApple OSS Distributions
945*bbb1b6f9SApple OSS Distributionsthread_group_set_32261625: ./stackshot-entitlements.plist
946*bbb1b6f9SApple OSS Distributionsthread_group_set_32261625: CODE_SIGN_ENTITLEMENTS=./stackshot-entitlements.plist
947*bbb1b6f9SApple OSS Distributionsthread_group_set_32261625: OTHER_LDFLAGS = -framework ktrace
948*bbb1b6f9SApple OSS Distributions
949*bbb1b6f9SApple OSS Distributionstask_info: CODE_SIGN_ENTITLEMENTS = task_for_pid_entitlement.plist
950*bbb1b6f9SApple OSS Distributionstask_info: OTHER_CFLAGS += test_utils.c
951*bbb1b6f9SApple OSS Distributionstask_info: OTHER_LDFLAGS += -ldarwintest_utils
952*bbb1b6f9SApple OSS Distributions
953*bbb1b6f9SApple OSS Distributionsextract_right_soft_fail: CODE_SIGN_ENTITLEMENTS = task_for_pid_entitlement.plist
954*bbb1b6f9SApple OSS Distributions
955*bbb1b6f9SApple OSS Distributionsifneq ($(IOS_TEST_COMPAT),YES)
956*bbb1b6f9SApple OSS Distributions	EXCLUDED_SOURCES += task_vm_info_decompressions.c
957*bbb1b6f9SApple OSS Distributionsendif
958*bbb1b6f9SApple OSS Distributions
959*bbb1b6f9SApple OSS Distributionsifeq ($(PLATFORM),MacOSX)
960*bbb1b6f9SApple OSS Distributions	EXCLUDED_SOURCES += vm/compression_sweep.c
961*bbb1b6f9SApple OSS Distributionsendif
962*bbb1b6f9SApple OSS Distributions
963*bbb1b6f9SApple OSS Distributionsunp_sock_release: CODE_SIGN_ENTITLEMENTS = unp_sock_release-entitlements.plist
964*bbb1b6f9SApple OSS Distributions
965*bbb1b6f9SApple OSS Distributionsaccept_race: in_cksum.c net_test_lib.c
966*bbb1b6f9SApple OSS Distributionsaccept_race: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
967*bbb1b6f9SApple OSS Distributions
968*bbb1b6f9SApple OSS Distributionsflow_div_doubleconnect_55917185: in_cksum.c net_test_lib.c
969*bbb1b6f9SApple OSS Distributionsflow_div_doubleconnect_55917185: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
970*bbb1b6f9SApple OSS Distributions
971*bbb1b6f9SApple OSS Distributionsbpf_write: bpflib.c in_cksum.c net_test_lib.c
972*bbb1b6f9SApple OSS Distributionsbpf_write: OTHER_LDFLAGS += -ldarwintest_utils
973*bbb1b6f9SApple OSS Distributions
974*bbb1b6f9SApple OSS Distributionsbpf_write_batch: bpflib.c in_cksum.c net_test_lib.c
975*bbb1b6f9SApple OSS Distributionsbpf_write_batch: OTHER_LDFLAGS += -ldarwintest_utils
976*bbb1b6f9SApple OSS Distributions
977*bbb1b6f9SApple OSS Distributionsudp_disconnect: in_cksum.c net_test_lib.c
978*bbb1b6f9SApple OSS Distributionsudp_disconnect: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
979*bbb1b6f9SApple OSS Distributions
980*bbb1b6f9SApple OSS Distributionsudp_bind_connect: in_cksum.c net_test_lib.c
981*bbb1b6f9SApple OSS Distributionsudp_bind_connect: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
982*bbb1b6f9SApple OSS Distributions
983*bbb1b6f9SApple OSS Distributionstcp_bind_connect: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
984*bbb1b6f9SApple OSS Distributionstcp_send_implied_connect: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
985*bbb1b6f9SApple OSS Distributions
986*bbb1b6f9SApple OSS Distributionstcp_cache_test: CODE_SIGN_ENTITLEMENTS = tcp_cache_entitlements.plist
987*bbb1b6f9SApple OSS Distributions
988*bbb1b6f9SApple OSS Distributionssocket_bind_35243417: in_cksum.c net_test_lib.c
989*bbb1b6f9SApple OSS Distributionssocket_bind_35243417: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
990*bbb1b6f9SApple OSS Distributions
991*bbb1b6f9SApple OSS Distributionssocket_bind_35685803: in_cksum.c net_test_lib.c
992*bbb1b6f9SApple OSS Distributionssocket_bind_35685803: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
993*bbb1b6f9SApple OSS Distributions
994*bbb1b6f9SApple OSS Distributionstcp_input_outputopts_uaf_56155583: in_cksum.c net_test_lib.c
995*bbb1b6f9SApple OSS Distributionstcp_input_outputopts_uaf_56155583: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
996*bbb1b6f9SApple OSS Distributions
997*bbb1b6f9SApple OSS Distributionsunp_connect_thread_uaf: in_cksum.c net_test_lib.c
998*bbb1b6f9SApple OSS Distributionsunp_connect_thread_uaf: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
999*bbb1b6f9SApple OSS Distributions
1000*bbb1b6f9SApple OSS Distributionsicmp_fragmetned_payload: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
1001*bbb1b6f9SApple OSS Distributionstcp_invalid_address: OTHER_CFLAGS += -Wno-int-conversion
1002*bbb1b6f9SApple OSS Distributionstcp_invalid_address: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
1003*bbb1b6f9SApple OSS Distributions
1004*bbb1b6f9SApple OSS Distributionsnet_tuntests: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
1005*bbb1b6f9SApple OSS Distributions
1006*bbb1b6f9SApple OSS Distributionsnet_bridge: inet_transfer.c bpflib.c in_cksum.c net_test_lib.c
1007*bbb1b6f9SApple OSS Distributionsnet_bridge: OTHER_LDFLAGS += -ldarwintest_utils
1008*bbb1b6f9SApple OSS Distributionsnet_bridge: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
1009*bbb1b6f9SApple OSS Distributions
1010*bbb1b6f9SApple OSS Distributionsnet_vlan: inet_transfer.c bpflib.c in_cksum.c net_test_lib.c
1011*bbb1b6f9SApple OSS Distributionsnet_vlan: OTHER_LDFLAGS += -ldarwintest_utils
1012*bbb1b6f9SApple OSS Distributionsnet_vlan: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
1013*bbb1b6f9SApple OSS Distributions
1014*bbb1b6f9SApple OSS Distributionsnet_bond: inet_transfer.c bpflib.c in_cksum.c net_test_lib.c
1015*bbb1b6f9SApple OSS Distributionsnet_bond: OTHER_LDFLAGS += -ldarwintest_utils
1016*bbb1b6f9SApple OSS Distributionsnet_bond: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
1017*bbb1b6f9SApple OSS Distributions
1018*bbb1b6f9SApple OSS Distributionsmcast_ssm: in_cksum.c net_test_lib.c
1019*bbb1b6f9SApple OSS Distributionsmcast_ssm: OTHER_LDFLAGS += -ldarwintest_utils
1020*bbb1b6f9SApple OSS Distributions
1021*bbb1b6f9SApple OSS Distributionsif_generation_id: net_test_lib.c in_cksum.c
1022*bbb1b6f9SApple OSS Distributionsif_generation_id: OTHER_LDFLAGS += -ldarwintest_utils
1023*bbb1b6f9SApple OSS Distributions
1024*bbb1b6f9SApple OSS Distributionsinet6_addr_mode: net_test_lib.c in_cksum.c
1025*bbb1b6f9SApple OSS Distributionsinet6_addr_mode: OTHER_LDFLAGS += -ldarwintest_utils
1026*bbb1b6f9SApple OSS Distributions
1027*bbb1b6f9SApple OSS Distributionsbpf_direction: bpflib.c
1028*bbb1b6f9SApple OSS Distributionsbpf_direction: OTHER_LDFLAGS += -ldarwintest_utils
1029*bbb1b6f9SApple OSS Distributionsbpf_direction: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
1030*bbb1b6f9SApple OSS Distributions
1031*bbb1b6f9SApple OSS Distributionsbpf_timestamp: bpflib.c
1032*bbb1b6f9SApple OSS Distributionsbpf_timestamp: OTHER_LDFLAGS += -ldarwintest_utils
1033*bbb1b6f9SApple OSS Distributionsbpf_timestamp: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
1034*bbb1b6f9SApple OSS Distributions
1035*bbb1b6f9SApple OSS Distributionsipv6_bind_race: in_cksum.c net_test_lib.c
1036*bbb1b6f9SApple OSS Distributionsipv6_bind_race: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
1037*bbb1b6f9SApple OSS Distributions
1038*bbb1b6f9SApple OSS Distributionsmcast_group_race_82820812: in_cksum.c net_test_lib.c
1039*bbb1b6f9SApple OSS Distributionsmcast_group_race_82820812: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
1040*bbb1b6f9SApple OSS Distributions
1041*bbb1b6f9SApple OSS Distributionsso_bindtodevice: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
1042*bbb1b6f9SApple OSS Distributions
1043*bbb1b6f9SApple OSS Distributionsrecv_link_addr_type: net_test_lib.c in_cksum.c
1044*bbb1b6f9SApple OSS Distributionsrecv_link_addr_type: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
1045*bbb1b6f9SApple OSS Distributions
1046*bbb1b6f9SApple OSS Distributionsip_pktinfo: net_test_lib.c in_cksum.c
1047*bbb1b6f9SApple OSS Distributionsip_pktinfo: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
1048*bbb1b6f9SApple OSS Distributions
1049*bbb1b6f9SApple OSS Distributionsv4mappedv6_dontfrag: net_test_lib.c in_cksum.c
1050*bbb1b6f9SApple OSS Distributionsv4mappedv6_dontfrag: OTHER_LDFLAGS += -ldarwintest_utils
1051*bbb1b6f9SApple OSS Distributionsv4mappedv6_dontfrag: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
1052*bbb1b6f9SApple OSS Distributions
1053*bbb1b6f9SApple OSS Distributionsnet_siocdifaddr: net_test_lib.c in_cksum.c
1054*bbb1b6f9SApple OSS Distributionsnet_siocdifaddr: OTHER_LDFLAGS += -ldarwintest_utils
1055*bbb1b6f9SApple OSS Distributions
1056*bbb1b6f9SApple OSS Distributionsvsock: vsock_helpers.c
1057*bbb1b6f9SApple OSS Distributionsvsock_entitled: vsock_helpers.c
1058*bbb1b6f9SApple OSS Distributionsvsock_entitled: CODE_SIGN_ENTITLEMENTS = vsock_entitlements.plist
1059*bbb1b6f9SApple OSS Distributions
1060*bbb1b6f9SApple OSS Distributionssendmsg_test: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
1061*bbb1b6f9SApple OSS Distributions
1062*bbb1b6f9SApple OSS Distributionsnetwork_elevated_logging: CODE_SIGN_ENTITLEMENTS = entitlements/network_elevated_logging.entitlements
1063*bbb1b6f9SApple OSS Distributions
1064*bbb1b6f9SApple OSS Distributionsrvi_doublefree: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
1065*bbb1b6f9SApple OSS Distributions
1066*bbb1b6f9SApple OSS Distributionsipc/platform_restrictions_entitlements: CODE_SIGN_ENTITLEMENTS = entitlements/platform-restrictions.plist
1067*bbb1b6f9SApple OSS Distributions
1068*bbb1b6f9SApple OSS Distributionsipc/tpro_entitlements: CODE_SIGN_ENTITLEMENTS = entitlements/tpro.plist
1069*bbb1b6f9SApple OSS Distributions
1070*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += ipc/control_port_movability_common.c
1071*bbb1b6f9SApple OSS Distributions
1072*bbb1b6f9SApple OSS Distributionsipc/entitled_control_port_movability: CODE_SIGN_ENTITLEMENTS = entitlements/entitled_control_port_movability.entitlements
1073*bbb1b6f9SApple OSS Distributionsipc/entitled_control_port_movability: ipc/control_port_movability_common.c
1074*bbb1b6f9SApple OSS Distributionsipc/entitled_control_port_movability: $(IPC_UTILS)
1075*bbb1b6f9SApple OSS Distributions
1076*bbb1b6f9SApple OSS Distributions
1077*bbb1b6f9SApple OSS Distributionsifeq ($(PLATFORM),MacOSX)
1078*bbb1b6f9SApple OSS Distributions
1079*bbb1b6f9SApple OSS Distributionsipc/rosetta_control_port_movability: INVALID_ARCHS = arm64 arm64e arm
1080*bbb1b6f9SApple OSS Distributionsipc/rosetta_control_port_movability: ipc/control_port_movability_common.c $(IPC_UTILS)
1081*bbb1b6f9SApple OSS Distributions
1082*bbb1b6f9SApple OSS Distributionselse
1083*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += ipc/rosetta_control_port_movability.c
1084*bbb1b6f9SApple OSS Distributionsendif
1085*bbb1b6f9SApple OSS Distributions
1086*bbb1b6f9SApple OSS Distributions
1087*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += posix_spawn_archpref_helper
1088*bbb1b6f9SApple OSS Distributions
1089*bbb1b6f9SApple OSS Distributionsposix_spawn_archpref_helper: posix_spawn_archpref_helper.c
1090*bbb1b6f9SApple OSS Distributions	$(CC) $(LDFLAGS) $(CFLAGS) posix_spawn_archpref_helper.c -o $(SYMROOT)/$@;
1091*bbb1b6f9SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
1092*bbb1b6f9SApple OSS Distributions
1093*bbb1b6f9SApple OSS Distributionsinstall-posix_spawn_archpref_helper: posix_spawn_archpref_helper
1094*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
1095*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/posix_spawn_archpref_helper $(INSTALLDIR)/
1096*bbb1b6f9SApple OSS Distributions
1097*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += posix_spawn_alt_rosetta_helper
1098*bbb1b6f9SApple OSS Distributions
1099*bbb1b6f9SApple OSS Distributionsposix_spawn_alt_rosetta_helper: posix_spawn_alt_rosetta_helper.c
1100*bbb1b6f9SApple OSS Distributions	$(CC) $(LDFLAGS) $(CFLAGS) posix_spawn_alt_rosetta_helper.c -o $(SYMROOT)/$@;
1101*bbb1b6f9SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
1102*bbb1b6f9SApple OSS Distributions
1103*bbb1b6f9SApple OSS Distributionsinstall-posix_spawn_alt_rosetta_helper: posix_spawn_alt_rosetta_helper
1104*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
1105*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/posix_spawn_alt_rosetta_helper $(INSTALLDIR)/
1106*bbb1b6f9SApple OSS Distributions
1107*bbb1b6f9SApple OSS DistributionsMIG:=SDKROOT=$(SDKROOT) $(shell xcrun -sdk "$(TARGETSDK)" -find mig)
1108*bbb1b6f9SApple OSS Distributions
1109*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += excserver
1110*bbb1b6f9SApple OSS Distributions
1111*bbb1b6f9SApple OSS Distributionsexcserver:
1112*bbb1b6f9SApple OSS Distributions	$(MIG) $(CFLAGS) \
1113*bbb1b6f9SApple OSS Distributions		-sheader $(OBJROOT)/excserver.h \
1114*bbb1b6f9SApple OSS Distributions		-server $(OBJROOT)/excserver.c \
1115*bbb1b6f9SApple OSS Distributions		-header /dev/null -user /dev/null \
1116*bbb1b6f9SApple OSS Distributions		excserver.defs
1117*bbb1b6f9SApple OSS Distributionsinstall-excserver: ;
1118*bbb1b6f9SApple OSS Distributions
1119*bbb1b6f9SApple OSS Distributionsexcserver_protect:
1120*bbb1b6f9SApple OSS Distributions	$(MIG) $(CFLAGS) \
1121*bbb1b6f9SApple OSS Distributions		-DMACH_EXC_SERVER_TASKIDTOKEN \
1122*bbb1b6f9SApple OSS Distributions		-sheader $(OBJROOT)/excserver_protect.h \
1123*bbb1b6f9SApple OSS Distributions		-server $(OBJROOT)/excserver_protect.c \
1124*bbb1b6f9SApple OSS Distributions		-header /dev/null -user /dev/null \
1125*bbb1b6f9SApple OSS Distributions		excserver_protect.defs
1126*bbb1b6f9SApple OSS Distributionsinstall-excserver_protect: ;
1127*bbb1b6f9SApple OSS Distributions
1128*bbb1b6f9SApple OSS Distributionsexcserver_protect_state:
1129*bbb1b6f9SApple OSS Distributions	$(MIG) $(CFLAGS) \
1130*bbb1b6f9SApple OSS Distributions		-DMACH_EXC_SERVER_TASKIDTOKEN_STATE \
1131*bbb1b6f9SApple OSS Distributions		-DMACH_EXC_SERVER_TASKIDTOKEN \
1132*bbb1b6f9SApple OSS Distributions		-sheader $(OBJROOT)/excserver_protect_state.h \
1133*bbb1b6f9SApple OSS Distributions		-server $(OBJROOT)/excserver_protect_state.c \
1134*bbb1b6f9SApple OSS Distributions		-header /dev/null -user /dev/null \
1135*bbb1b6f9SApple OSS Distributions		excserver_protect.defs
1136*bbb1b6f9SApple OSS Distributionsinstall-excserver_protect_state: ;
1137*bbb1b6f9SApple OSS Distributions
1138*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += exc_helpers.c
1139*bbb1b6f9SApple OSS Distributions
1140*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += notifyserver
1141*bbb1b6f9SApple OSS Distributions
1142*bbb1b6f9SApple OSS Distributionsnotifyserver:
1143*bbb1b6f9SApple OSS Distributions	$(MIG) $(CFLAGS) \
1144*bbb1b6f9SApple OSS Distributions		-user /dev/null \
1145*bbb1b6f9SApple OSS Distributions		-header $(OBJROOT)/notify.h \
1146*bbb1b6f9SApple OSS Distributions		-sheader $(OBJROOT)/notifyServer.h \
1147*bbb1b6f9SApple OSS Distributions		-server $(OBJROOT)/notifyServer.c \
1148*bbb1b6f9SApple OSS Distributions		notifyserver.defs
1149*bbb1b6f9SApple OSS Distributionsinstall-notifyserver: ;
1150*bbb1b6f9SApple OSS Distributions
1151*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += rnserver
1152*bbb1b6f9SApple OSS Distributions
1153*bbb1b6f9SApple OSS Distributionsrnserver:
1154*bbb1b6f9SApple OSS Distributions	$(MIG) $(CFLAGS) \
1155*bbb1b6f9SApple OSS Distributions		-user /dev/null \
1156*bbb1b6f9SApple OSS Distributions		-header $(OBJROOT)/rn.h \
1157*bbb1b6f9SApple OSS Distributions		-sheader $(OBJROOT)/rnServer.h \
1158*bbb1b6f9SApple OSS Distributions		-server $(OBJROOT)/rnServer.c \
1159*bbb1b6f9SApple OSS Distributions		rnserver.defs
1160*bbb1b6f9SApple OSS Distributionsinstall-rnserver: ;
1161*bbb1b6f9SApple OSS Distributions
1162*bbb1b6f9SApple OSS DistributionsSKYWALK_COMMON_FILES := \
1163*bbb1b6f9SApple OSS Distributions	skywalk/skywalk_test_common.c \
1164*bbb1b6f9SApple OSS Distributions	skywalk/skywalk_test_utils.c
1165*bbb1b6f9SApple OSS DistributionsSKYWALK_TEST_FILES := \
1166*bbb1b6f9SApple OSS Distributions	skywalk/skywalk_test_driver.c \
1167*bbb1b6f9SApple OSS Distributions	skywalk/skt_simple.c \
1168*bbb1b6f9SApple OSS Distributions	skywalk/skt_features.c \
1169*bbb1b6f9SApple OSS Distributions	skywalk/skt_oneslot.c \
1170*bbb1b6f9SApple OSS Distributions	skywalk/skt_shutdown.c \
1171*bbb1b6f9SApple OSS Distributions	skywalk/skt_shutdown2.c \
1172*bbb1b6f9SApple OSS Distributions	skywalk/skt_nslots.c \
1173*bbb1b6f9SApple OSS Distributions	skywalk/skt_closecfd.c \
1174*bbb1b6f9SApple OSS Distributions	skywalk/skt_closenfd.c \
1175*bbb1b6f9SApple OSS Distributions	skywalk/skt_badring.c \
1176*bbb1b6f9SApple OSS Distributions	skywalk/skt_kqueue.c \
1177*bbb1b6f9SApple OSS Distributions	skywalk/skt_mangle.c \
1178*bbb1b6f9SApple OSS Distributions	skywalk/skt_features.c \
1179*bbb1b6f9SApple OSS Distributions	skywalk/skt_ringid.c \
1180*bbb1b6f9SApple OSS Distributions	skywalk/skt_closekq.c \
1181*bbb1b6f9SApple OSS Distributions	skywalk/skt_writemem.c \
1182*bbb1b6f9SApple OSS Distributions	skywalk/skt_debug_verify.c \
1183*bbb1b6f9SApple OSS Distributions	skywalk/skt_utun27302538.c \
1184*bbb1b6f9SApple OSS Distributions	skywalk/skt_utunleak.c \
1185*bbb1b6f9SApple OSS Distributions	skywalk/skt_utunloop.c \
1186*bbb1b6f9SApple OSS Distributions	skywalk/skt_flowswitch_ns_reserve.c \
1187*bbb1b6f9SApple OSS Distributions	skywalk/skt_netifcompat.c \
1188*bbb1b6f9SApple OSS Distributions	skywalk/skt_fswloop.c \
1189*bbb1b6f9SApple OSS Distributions	skywalk/skt_teardown.c \
1190*bbb1b6f9SApple OSS Distributions	skywalk/skt_bind.c \
1191*bbb1b6f9SApple OSS Distributions	skywalk/skt_fsw29301703.c \
1192*bbb1b6f9SApple OSS Distributions	skywalk/skt_fswbinds.c \
1193*bbb1b6f9SApple OSS Distributions	skywalk/skt_manyflows.c \
1194*bbb1b6f9SApple OSS Distributions	skywalk/skt_pllupipe.c \
1195*bbb1b6f9SApple OSS Distributions	skywalk/skt_fullupipe.c \
1196*bbb1b6f9SApple OSS Distributions	skywalk/skt_listener.c \
1197*bbb1b6f9SApple OSS Distributions	skywalk/skt_copy_cksum.c \
1198*bbb1b6f9SApple OSS Distributions	skywalk/skt_reass.c \
1199*bbb1b6f9SApple OSS Distributions	skywalk/skt_memory.c \
1200*bbb1b6f9SApple OSS Distributions	skywalk/skt_flow.c \
1201*bbb1b6f9SApple OSS Distributions	skywalk/skt_flowlookup.c \
1202*bbb1b6f9SApple OSS Distributions	skywalk/skt_libcuckoo.c \
1203*bbb1b6f9SApple OSS Distributions	skywalk/skt_restricted_port.c \
1204*bbb1b6f9SApple OSS Distributions	skywalk/skt_steering.c
1205*bbb1b6f9SApple OSS DistributionsSKYWALK_MPTEST_FILES := \
1206*bbb1b6f9SApple OSS Distributions	skywalk/skywalk_mptests.c \
1207*bbb1b6f9SApple OSS Distributions	skywalk/skywalk_mptest_driver.c \
1208*bbb1b6f9SApple OSS Distributions	skywalk/skt_mpsimple.c \
1209*bbb1b6f9SApple OSS Distributions	skywalk/skt_mpprotons.c \
1210*bbb1b6f9SApple OSS Distributions	skywalk/skt_xfer.c \
1211*bbb1b6f9SApple OSS Distributions	skywalk/skt_netifdirect.c \
1212*bbb1b6f9SApple OSS Distributions	skywalk/skt_filter.c
1213*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += $(SKYWALK_COMMON_FILES) $(SKYWALK_TEST_FILES) $(SKYWALK_MPTEST_FILES)
1214*bbb1b6f9SApple OSS Distributions
1215*bbb1b6f9SApple OSS Distributionsskywalk_tests: excserver
1216*bbb1b6f9SApple OSS Distributionsskywalk_tests: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
1217*bbb1b6f9SApple OSS Distributionsskywalk_tests: CODE_SIGN_ENTITLEMENTS = skywalk_test.entitlements
1218*bbb1b6f9SApple OSS Distributionsskywalk_tests: $(SKYWALK_COMMON_FILES) $(SKYWALK_TEST_FILES) $(SKYWALK_MPTEST_FILES) $(SDKROOT)/usr/local/lib/libCrashReporterClient.a
1219*bbb1b6f9SApple OSS Distributions
1220*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += arm_matrix_sme.c
1221*bbb1b6f9SApple OSS Distributions
1222*bbb1b6f9SApple OSS Distributionsarm_matrix: INVALID_ARCHS = $(filter-out arm64%,$(ARCH_CONFIGS))
1223*bbb1b6f9SApple OSS Distributionsarm_matrix: excserver exc_helpers.c arm_matrix_sme.c
1224*bbb1b6f9SApple OSS Distributionsarm_matrix: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT) -Wno-language-extension-token -Wno-c++98-compat -mcpu=firestorm+nofp+sme2
1225*bbb1b6f9SApple OSS Distributionsarm_matrix: CODE_SIGN_ENTITLEMENTS = arm_matrix.entitlements
1226*bbb1b6f9SApple OSS Distributions
1227*bbb1b6f9SApple OSS DistributionsMTE_CFLAGS = -march=armv8.5a+memtag -Wno-declaration-after-statement -Wno-format-pedantic -Wno-language-extension-token
1228*bbb1b6f9SApple OSS Distributions
1229*bbb1b6f9SApple OSS Distributionsarm_mte: arm_mte_spawn_client_with_hardened_process_entitlement arm_mte_spawn_client_without_hardened_process_entitlement arm_mte_utilities.c
1230*bbb1b6f9SApple OSS Distributionsarm_mte: INVALID_ARCHS = $(filter-out arm64%,$(ARCH_CONFIGS))
1231*bbb1b6f9SApple OSS Distributionsarm_mte: OTHER_CFLAGS += $(MTE_CFLAGS)
1232*bbb1b6f9SApple OSS Distributionsarm_mte: OTHER_LDFLAGS += -ldarwintest_utils
1233*bbb1b6f9SApple OSS Distributionsarm_mte: CODE_SIGN_ENTITLEMENTS = arm_mte.entitlements
1234*bbb1b6f9SApple OSS Distributions
1235*bbb1b6f9SApple OSS Distributionsproc_core_name_mte: proc_core_name_mte.c
1236*bbb1b6f9SApple OSS Distributionsproc_core_name_mte: INVALID_ARCHS = $(filter-out arm64%,$(ARCH_CONFIGS))
1237*bbb1b6f9SApple OSS Distributionsproc_core_name_mte: OTHER_CFLAGS += $(MTE_CFLAGS)
1238*bbb1b6f9SApple OSS Distributionsproc_core_name_mte: OTHER_LDFLAGS += -ldarwintest_utils
1239*bbb1b6f9SApple OSS Distributionsproc_core_name_mte: CODE_SIGN_ENTITLEMENTS = arm_mte.entitlements
1240*bbb1b6f9SApple OSS Distributions
1241*bbb1b6f9SApple OSS Distributions
1242*bbb1b6f9SApple OSS Distributionsarm_mte_compress: arm_mte_utilities.c
1243*bbb1b6f9SApple OSS Distributionsarm_mte_compress: INVALID_ARCHS = $(filter-out arm64%,$(ARCH_CONFIGS))
1244*bbb1b6f9SApple OSS Distributionsarm_mte_compress: OTHER_CFLAGS += $(MTE_CFLAGS)
1245*bbb1b6f9SApple OSS Distributionsarm_mte_compress: CODE_SIGN_ENTITLEMENTS = arm_mte.entitlements
1246*bbb1b6f9SApple OSS Distributions
1247*bbb1b6f9SApple OSS Distributionsarm_mte_unentitled: arm_mte_utilities.c arm_mte_debugger_helper
1248*bbb1b6f9SApple OSS Distributionsarm_mte_unentitled: INVALID_ARCHS = $(filter-out arm64%,$(ARCH_CONFIGS))
1249*bbb1b6f9SApple OSS Distributionsarm_mte_unentitled: OTHER_CFLAGS += $(MTE_CFLAGS)
1250*bbb1b6f9SApple OSS Distributions
1251*bbb1b6f9SApple OSS Distributionsarm_mte_stress: arm_mte_utilities.c
1252*bbb1b6f9SApple OSS Distributionsarm_mte_stress: INVALID_ARCHS = $(filter-out arm64%,$(ARCH_CONFIGS))
1253*bbb1b6f9SApple OSS Distributionsarm_mte_stress: OTHER_CFLAGS += $(MTE_CFLAGS)
1254*bbb1b6f9SApple OSS Distributionsarm_mte_stress: OTHER_LDFLAGS += -ldarwintest_utils
1255*bbb1b6f9SApple OSS Distributionsarm_mte_stress: CODE_SIGN_ENTITLEMENTS = arm_mte.entitlements
1256*bbb1b6f9SApple OSS Distributions
1257*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += arm_mte_debugger_helper.c
1258*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += arm_mte_debugger_helper
1259*bbb1b6f9SApple OSS Distributionsarm_mte_debugger_helper: INVALID_ARCHS = $(filter-out arm64%,$(ARCH_CONFIGS))
1260*bbb1b6f9SApple OSS Distributionsarm_mte_debugger_helper: OTHER_CFLAGS += -march=armv8.5a+memtag
1261*bbb1b6f9SApple OSS Distributionsarm_mte_debugger_helper: CODE_SIGN_ENTITLEMENTS = arm_mte.entitlements
1262*bbb1b6f9SApple OSS Distributionsarm_mte_debugger_helper: arm_mte_debugger_helper.c
1263*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \
1264*bbb1b6f9SApple OSS Distributions	$^ -o $(SYMROOT)/$@
1265*bbb1b6f9SApple OSS Distributions	$(CODESIGN) -f -s- --entitlements $(SRCROOT)/$(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@
1266*bbb1b6f9SApple OSS Distributions
1267*bbb1b6f9SApple OSS Distributionsinstall-arm_mte_debugger_helper: arm_mte_debugger_helper
1268*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
1269*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/$< $(INSTALLDIR)/
1270*bbb1b6f9SApple OSS Distributions
1271*bbb1b6f9SApple OSS Distributionsarm_mte_mach_msg: arm_mte_utilities.c
1272*bbb1b6f9SApple OSS Distributionsarm_mte_mach_msg: INVALID_ARCHS = $(filter-out arm64%,$(ARCH_CONFIGS))
1273*bbb1b6f9SApple OSS Distributionsarm_mte_mach_msg: OTHER_CFLAGS += $(MTE_CFLAGS)
1274*bbb1b6f9SApple OSS Distributionsarm_mte_mach_msg: OTHER_LDFLAGS += -ldarwintest_utils
1275*bbb1b6f9SApple OSS Distributions
1276*bbb1b6f9SApple OSS Distributionsarm_mte_knobs_policies: arm_mte_utilities.c
1277*bbb1b6f9SApple OSS Distributionsarm_mte_knobs_policies: arm_mte_spawn_client_with_top_level_hardened_proc_entitlement_and_in_amfi_opt_out
1278*bbb1b6f9SApple OSS Distributionsarm_mte_knobs_policies: INVALID_ARCHS = $(filter-out arm64%,$(ARCH_CONFIGS))
1279*bbb1b6f9SApple OSS Distributionsarm_mte_knobs_policies: OTHER_CFLAGS += -march=armv8.5a+memtag -Wno-declaration-after-statement -Wno-format-pedantic -Wno-language-extension-token -Wno-bad-function-cast
1280*bbb1b6f9SApple OSS Distributionsarm_mte_knobs_policies: OTHER_LDFLAGS += -ldarwintest_utils
1281*bbb1b6f9SApple OSS Distributionsarm_mte_knobs_policies: CODE_SIGN_ENTITLEMENTS = arm_mte.entitlements
1282*bbb1b6f9SApple OSS Distributions
1283*bbb1b6f9SApple OSS Distributionsarm_mte_launchd: arm_mte_launchd.c
1284*bbb1b6f9SApple OSS Distributionsarm_mte_launchd: INVALID_ARCHS = $(filter-out arm64%,$(ARCH_CONFIGS))
1285*bbb1b6f9SApple OSS Distributionsarm_mte_launchd: OTHER_CFLAGS += -march=armv8.5a+memtag -Wno-declaration-after-statement -Wno-format-pedantic -Wno-language-extension-token
1286*bbb1b6f9SApple OSS Distributionsarm_mte_launchd: OTHER_LDFLAGS += -ldarwintest_utils
1287*bbb1b6f9SApple OSS Distributionsarm_mte_launchd: CODE_SIGN_ENTITLEMENTS = arm_mte.entitlements
1288*bbb1b6f9SApple OSS Distributions
1289*bbb1b6f9SApple OSS Distributionsarm_mte_spawn_policies: arm_mte_utilities.c
1290*bbb1b6f9SApple OSS Distributionsarm_mte_spawn_policies: arm_mte_spawn_client_without_hardened_process_entitlement
1291*bbb1b6f9SApple OSS Distributionsarm_mte_spawn_policies: arm_mte_spawn_client_with_hardened_process_entitlement
1292*bbb1b6f9SApple OSS Distributionsarm_mte_spawn_policies: arm_mte_spawn_client_with_top_level_hardened_proc_entitlement_and_in_amfi_opt_out
1293*bbb1b6f9SApple OSS Distributionsarm_mte_spawn_policies: arm_mte_driverkit_standin
1294*bbb1b6f9SApple OSS Distributionsarm_mte_spawn_policies: arm_mte_spawn_client_with_invalid_entitlement_setting
1295*bbb1b6f9SApple OSS Distributionsarm_mte_spawn_policies: INVALID_ARCHS = $(filter-out arm64%,$(ARCH_CONFIGS))
1296*bbb1b6f9SApple OSS Distributionsarm_mte_spawn_policies: OTHER_CFLAGS += $(MTE_CFLAGS)
1297*bbb1b6f9SApple OSS Distributions
1298*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += arm_mte_spawn_policies_helper.c
1299*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += arm_mte_utilities.c
1300*bbb1b6f9SApple OSS Distributions
1301*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += arm_mte_spawn_client_without_hardened_process_entitlement
1302*bbb1b6f9SApple OSS Distributionsarm_mte_spawn_client_without_hardened_process_entitlement: INVALID_ARCHS = $(filter-out arm64%,$(ARCH_CONFIGS))
1303*bbb1b6f9SApple OSS Distributionsarm_mte_spawn_client_without_hardened_process_entitlement: OTHER_CFLAGS += -march=armv8.5a+memtag
1304*bbb1b6f9SApple OSS Distributionsarm_mte_spawn_client_without_hardened_process_entitlement: arm_mte_spawn_policies_helper.c arm_mte_utilities.c
1305*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(MTE_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \
1306*bbb1b6f9SApple OSS Distributions	$^ -o $(SYMROOT)/$@
1307*bbb1b6f9SApple OSS Distributions	$(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@
1308*bbb1b6f9SApple OSS Distributions
1309*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += arm_mte_spawn_client_with_hardened_process_entitlement
1310*bbb1b6f9SApple OSS Distributionsarm_mte_spawn_client_with_hardened_process_entitlement: INVALID_ARCHS = $(filter-out arm64%,$(ARCH_CONFIGS))
1311*bbb1b6f9SApple OSS Distributionsarm_mte_spawn_client_with_hardened_process_entitlement: OTHER_CFLAGS += -march=armv8.5a+memtag
1312*bbb1b6f9SApple OSS Distributionsarm_mte_spawn_client_with_hardened_process_entitlement: arm_mte_spawn_policies_helper.c arm_mte_utilities.c
1313*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(MTE_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \
1314*bbb1b6f9SApple OSS Distributions	$^ -o $(SYMROOT)/$@
1315*bbb1b6f9SApple OSS Distributions	$(CODESIGN) -f -s- --entitlements $(SRCROOT)/entitlements/hardened-proc.entitlements $(SYMROOT)/$@
1316*bbb1b6f9SApple OSS Distributions
1317*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += arm_mte_spawn_client_with_top_level_hardened_proc_entitlement_and_in_amfi_opt_out
1318*bbb1b6f9SApple OSS Distributionsarm_mte_spawn_client_with_top_level_hardened_proc_entitlement_and_in_amfi_opt_out: INVALID_ARCHS = $(filter-out arm64%,$(ARCH_CONFIGS))
1319*bbb1b6f9SApple OSS Distributionsarm_mte_spawn_client_with_top_level_hardened_proc_entitlement_and_in_amfi_opt_out: OTHER_CFLAGS += -march=armv8.5a+memtag
1320*bbb1b6f9SApple OSS Distributionsarm_mte_spawn_client_with_top_level_hardened_proc_entitlement_and_in_amfi_opt_out: arm_mte_spawn_policies_helper.c arm_mte_utilities.c
1321*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(MTE_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \
1322*bbb1b6f9SApple OSS Distributions	$^ -o $(SYMROOT)/$@
1323*bbb1b6f9SApple OSS Distributions	$(CODESIGN) -i com.apple.internal.arm_mte_opt_out_test -s- -f --entitlements $(SRCROOT)/entitlements/hardened-proc.entitlements $(SYMROOT)/$@
1324*bbb1b6f9SApple OSS Distributions
1325*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += arm_mte_spawn_client_with_invalid_entitlement_setting
1326*bbb1b6f9SApple OSS Distributionsarm_mte_spawn_client_with_invalid_entitlement_setting: INVALID_ARCHS = $(filter-out arm64%,$(ARCH_CONFIGS))
1327*bbb1b6f9SApple OSS Distributionsarm_mte_spawn_client_with_invalid_entitlement_setting: OTHER_CFLAGS += -march=armv8.5a+memtag
1328*bbb1b6f9SApple OSS Distributionsarm_mte_spawn_client_with_invalid_entitlement_setting: arm_mte_spawn_policies_helper.c arm_mte_utilities.c
1329*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(MTE_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \
1330*bbb1b6f9SApple OSS Distributions	$^ -o $(SYMROOT)/$@
1331*bbb1b6f9SApple OSS Distributions	$(CODESIGN) -s- -f --entitlements $(SRCROOT)/entitlements/hardened-proc-invalid.entitlements $(SYMROOT)/$@
1332*bbb1b6f9SApple OSS Distributions
1333*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += mte_posix_spawn_tool
1334*bbb1b6f9SApple OSS Distributionsmte_posix_spawn_tool: INVALID_ARCHS = i386
1335*bbb1b6f9SApple OSS Distributionsmte_posix_spawn_tool: mte_posix_spawn_tool.c
1336*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) mte_posix_spawn_tool.c -o $(SYMROOT)/mte_posix_spawn_tool -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
1337*bbb1b6f9SApple OSS Distributions	$(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@
1338*bbb1b6f9SApple OSS Distributions
1339*bbb1b6f9SApple OSS Distributionsinstall-mte_posix_spawn_tool: mte_posix_spawn_tool
1340*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)/tools
1341*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/mte_posix_spawn_tool $(INSTALLDIR)/tools/
1342*bbb1b6f9SApple OSS Distributions
1343*bbb1b6f9SApple OSS Distributionsinstall-arm_mte_spawn_client_without_hardened_process_entitlement: arm_mte_spawn_client_without_hardened_process_entitlement
1344*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
1345*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/$< $(INSTALLDIR)/
1346*bbb1b6f9SApple OSS Distributions
1347*bbb1b6f9SApple OSS Distributionsinstall-arm_mte_spawn_client_with_hardened_process_entitlement: arm_mte_spawn_client_with_hardened_process_entitlement
1348*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
1349*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/$< $(INSTALLDIR)/
1350*bbb1b6f9SApple OSS Distributions
1351*bbb1b6f9SApple OSS Distributionsinstall-arm_mte_spawn_client_with_top_level_hardened_proc_entitlement_and_in_amfi_opt_out: arm_mte_spawn_client_with_top_level_hardened_proc_entitlement_and_in_amfi_opt_out
1352*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
1353*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/$< $(INSTALLDIR)/
1354*bbb1b6f9SApple OSS Distributions
1355*bbb1b6f9SApple OSS Distributionsinstall-arm_mte_spawn_client_with_invalid_entitlement_setting: arm_mte_spawn_client_with_invalid_entitlement_setting
1356*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)/tools
1357*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/$< $(INSTALLDIR)/tools/
1358*bbb1b6f9SApple OSS Distributions
1359*bbb1b6f9SApple OSS Distributionsvm/vm_mteinfo: INVALID_ARCHS = $(filter-out arm64%,$(ARCH_CONFIGS))
1360*bbb1b6f9SApple OSS Distributionsvm/vm_mteinfo: OTHER_CFLAGS += -Wno-implicit-int-conversion -Wno-sign-conversion -Wno-sign-compare -Wno-format-pedantic
1361*bbb1b6f9SApple OSS Distributions
1362*bbb1b6f9SApple OSS Distributionsvm/vm_mte_reclamation_withmte: arm_mte_utilities.c
1363*bbb1b6f9SApple OSS Distributionsvm/vm_mte_reclamation_withmte: INVALID_ARCHS = $(filter-out arm64%,$(ARCH_CONFIGS))
1364*bbb1b6f9SApple OSS Distributionsvm/vm_mte_reclamation_withmte: OTHER_CFLAGS += $(MTE_CFLAGS)
1365*bbb1b6f9SApple OSS Distributionsvm/vm_mte_reclamation_withmte: OTHER_LDFLAGS += -ldarwintest_utils
1366*bbb1b6f9SApple OSS Distributionsvm/vm_mte_reclamation_withmte: CODE_SIGN_ENTITLEMENTS = arm_mte.entitlements
1367*bbb1b6f9SApple OSS Distributions
1368*bbb1b6f9SApple OSS DistributionsCODESIGN_MTE_SOFT:=$(CODESIGN) -i com.apple.internal.arm_mte_soft_mode_test
1369*bbb1b6f9SApple OSS Distributionsarm_mte_soft_mode: arm_mte_utilities.c
1370*bbb1b6f9SApple OSS Distributionsarm_mte_soft_mode: INVALID_ARCHS = $(filter-out arm64%,$(ARCH_CONFIGS))
1371*bbb1b6f9SApple OSS Distributionsarm_mte_soft_mode: OTHER_CFLAGS += $(MTE_CFLAGS)
1372*bbb1b6f9SApple OSS Distributionsarm_mte_soft_mode: CODE_SIGN_ENTITLEMENTS = arm_mte.entitlements
1373*bbb1b6f9SApple OSS Distributionsarm_mte_soft_mode: CODESIGN = $(CODESIGN_MTE_SOFT)
1374*bbb1b6f9SApple OSS Distributions
1375*bbb1b6f9SApple OSS DistributionsCODESIGN_MTE_API:=$(CODESIGN) -i com.apple.internal.arm_mte_api_test
1376*bbb1b6f9SApple OSS Distributionsarm_mte_api: arm_mte_utilities.c
1377*bbb1b6f9SApple OSS Distributionsarm_mte_api: INVALID_ARCHS = $(filter-out arm64%,$(ARCH_CONFIGS))
1378*bbb1b6f9SApple OSS Distributionsarm_mte_api: OTHER_CFLAGS += $(MTE_CFLAGS)
1379*bbb1b6f9SApple OSS Distributionsarm_mte_api: CODE_SIGN_ENTITLEMENTS = arm_mte.entitlements
1380*bbb1b6f9SApple OSS Distributionsarm_mte_api: CODESIGN = $(CODESIGN_MTE_API)
1381*bbb1b6f9SApple OSS Distributions
1382*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += arm_mte_alias_restriction
1383*bbb1b6f9SApple OSS Distributionsarm_mte_alias_restriction: arm_mte_utilities.c
1384*bbb1b6f9SApple OSS Distributionsarm_mte_alias_restriction: INVALID_ARCHS = $(filter-out arm64%,$(ARCH_CONFIGS))
1385*bbb1b6f9SApple OSS Distributionsarm_mte_alias_restriction: CODE_SIGN_ENTITLEMENTS = arm_mte.entitlements
1386*bbb1b6f9SApple OSS Distributionsarm_mte_alias_restriction: OTHER_CFLAGS += $(MTE_CFLAGS)
1387*bbb1b6f9SApple OSS Distributionsarm_mte_alias_restriction: arm_mte_alias_restriction.c
1388*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(MTE_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \
1389*bbb1b6f9SApple OSS Distributions	arm_mte_alias_restriction.c arm_mte_utilities.c -o $(SYMROOT)/$@
1390*bbb1b6f9SApple OSS Distributions	$(CODESIGN) -f -s- --entitlements $(SRCROOT)/$(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@
1391*bbb1b6f9SApple OSS Distributions
1392*bbb1b6f9SApple OSS Distributionsinstall-arm_mte_alias_restriction: arm_mte_alias_restriction
1393*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
1394*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/$< $(INSTALLDIR)/
1395*bbb1b6f9SApple OSS Distributions
1396*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += arm_mte_alias_restriction_helper
1397*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += arm_mte_alias_restriction_helper.c
1398*bbb1b6f9SApple OSS DistributionsCODESIGN_MTE_ALIAS_RESTRICTION:=$(CODESIGN) -i com.apple.internal.arm_mte_alias_restriction_opt_in_test
1399*bbb1b6f9SApple OSS Distributionsarm_mte_alias_restriction_helper: CODESIGN = $(CODESIGN_MTE_ALIAS_RESTRICTION)
1400*bbb1b6f9SApple OSS Distributionsarm_mte_alias_restriction_helper: INVALID_ARCHS = $(filter-out arm64%,$(ARCH_CONFIGS))
1401*bbb1b6f9SApple OSS Distributionsarm_mte_alias_restriction_helper: CODE_SIGN_ENTITLEMENTS = arm_mte.entitlements
1402*bbb1b6f9SApple OSS Distributionsarm_mte_alias_restriction_helper: arm_mte_alias_restriction_helper.c
1403*bbb1b6f9SApple OSS Distributions
1404*bbb1b6f9SApple OSS Distributionsinstall-arm_mte_alias_restriction_helper: arm_mte_alias_restriction_helper
1405*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
1406*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/$< $(INSTALLDIR)/
1407*bbb1b6f9SApple OSS Distributions
1408*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += arm_mte_driverkit_standin
1409*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += arm_mte_driverkit_standin.c
1410*bbb1b6f9SApple OSS Distributionsarm_mte_driverkit_standin: INVALID_ARCHS = $(filter-out arm64%,$(ARCH_CONFIGS))
1411*bbb1b6f9SApple OSS Distributionsarm_mte_driverkit_standin: CODE_SIGN_ENTITLEMENTS = arm_mte_driverkit_standin.entitlements
1412*bbb1b6f9SApple OSS Distributionsarm_mte_driverkit_standin: arm_mte_driverkit_standin.c
1413*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \
1414*bbb1b6f9SApple OSS Distributions	$^ -o $(SYMROOT)/$@
1415*bbb1b6f9SApple OSS Distributions	$(CODESIGN) -f -s- --entitlements $(SRCROOT)/$(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@
1416*bbb1b6f9SApple OSS Distributions
1417*bbb1b6f9SApple OSS Distributionsinstall-arm_mte_driverkit_standin: arm_mte_driverkit_standin
1418*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
1419*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/$< $(INSTALLDIR)/
1420*bbb1b6f9SApple OSS Distributions
1421*bbb1b6f9SApple OSS Distributionsx18_entitled: OTHER_CFLAGS += -ffixed-x18 -Wno-language-extension-token
1422*bbb1b6f9SApple OSS Distributionsx18_entitled: CODE_SIGN_ENTITLEMENTS = x18-entitlements.plist
1423*bbb1b6f9SApple OSS Distributionsx18_unentitled: OTHER_CFLAGS += -ffixed-x18 -Wno-language-extension-token
1424*bbb1b6f9SApple OSS Distributionsifneq ($(PLATFORM),MacOSX)
1425*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += x18_legacy.c
1426*bbb1b6f9SApple OSS Distributionselse
1427*bbb1b6f9SApple OSS Distributionsx18_legacy: OTHER_CFLAGS += -ffixed-x18 -Wno-language-extension-token -Wl,-platform_version -Wl,macos -Wl,10.12 -Wl,10.12
1428*bbb1b6f9SApple OSS Distributionsendif
1429*bbb1b6f9SApple OSS Distributions
1430*bbb1b6f9SApple OSS Distributionsifeq ($(findstring arm64,$(ARCH_CONFIGS)),)
1431*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += apple_generic_timer.c apple_generic_timer_legacy.c
1432*bbb1b6f9SApple OSS Distributionselse
1433*bbb1b6f9SApple OSS Distributionsapple_generic_timer: INVALID_ARCHS = armv7k x86_64 x86_64h
1434*bbb1b6f9SApple OSS Distributions
1435*bbb1b6f9SApple OSS Distributionsapple_generic_timer_legacy: INVALID_ARCHS = armv7k x86_64 x86_64h
1436*bbb1b6f9SApple OSS Distributionsifeq ($(PLATFORM),MacOSX)
1437*bbb1b6f9SApple OSS Distributionsapple_generic_timer_legacy: OTHER_CFLAGS += -Wl,-platform_version,macos,14.6,14.6
1438*bbb1b6f9SApple OSS Distributionselse ifeq ($(PLATFORM),iPhoneOS)
1439*bbb1b6f9SApple OSS Distributionsapple_generic_timer_legacy: OTHER_CFLAGS += -Wl,-platform_version,ios,14.6,14.6
1440*bbb1b6f9SApple OSS Distributionselse ifeq ($(PLATFORM),tvOS)
1441*bbb1b6f9SApple OSS Distributionsapple_generic_timer_legacy: OTHER_CFLAGS += -Wl,-platform_version,tvos,14.6,14.6
1442*bbb1b6f9SApple OSS Distributionselse ifeq ($(PLATFORM),WatchOS)
1443*bbb1b6f9SApple OSS Distributionsapple_generic_timer_legacy: OTHER_CFLAGS += -Wl,-platform_version,watchos,10.6,10.6
1444*bbb1b6f9SApple OSS Distributionselse
1445*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += apple_generic_timer_legacy.c
1446*bbb1b6f9SApple OSS Distributionsendif
1447*bbb1b6f9SApple OSS Distributions
1448*bbb1b6f9SApple OSS Distributionsifneq ($(PLATFORM),MacOSX)
1449*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += apple_generic_timer_vmm.c
1450*bbb1b6f9SApple OSS Distributionselse
1451*bbb1b6f9SApple OSS Distributionsapple_generic_timer_vmm: INVALID_ARCHS = armv7k x86_64 x86_64h
1452*bbb1b6f9SApple OSS Distributionsapple_generic_timer_vmm: CODE_SIGN_ENTITLEMENTS = hv_private.entitlements
1453*bbb1b6f9SApple OSS Distributionsendif
1454*bbb1b6f9SApple OSS Distributions
1455*bbb1b6f9SApple OSS Distributionsendif
1456*bbb1b6f9SApple OSS Distributions
1457*bbb1b6f9SApple OSS Distributionsbingrade: bingrade_helper_arm32 bingrade_helper_arm64 bingrade_helper_arm_fat
1458*bbb1b6f9SApple OSS Distributionsbingrade: INVALID_ARCHS = x86_64 x86_64h
1459*bbb1b6f9SApple OSS Distributions# libdarwintest.a doesn't have an arm64 slice on watchOS
1460*bbb1b6f9SApple OSS Distributionsifeq ($(PLATFORM),WatchOS)
1461*bbb1b6f9SApple OSS Distributionsbingrade: INVALID_ARCHS += arm64
1462*bbb1b6f9SApple OSS Distributionsendif
1463*bbb1b6f9SApple OSS Distributions
1464*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += bingrade_helper.c
1465*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += bingrade_helper_arm32
1466*bbb1b6f9SApple OSS Distributionsbingrade_helper_arm32: CFLAGS = -arch arm64_32 -static -nostdlib
1467*bbb1b6f9SApple OSS Distributionsbingrade_helper_arm32: bingrade_helper.c
1468*bbb1b6f9SApple OSS Distributions	$(CC) $(CFLAGS) $< -o $(SYMROOT)/$@
1469*bbb1b6f9SApple OSS Distributions	$(CODESIGN) -f -s- $(SYMROOT)/$@
1470*bbb1b6f9SApple OSS Distributions
1471*bbb1b6f9SApple OSS Distributionsinstall-bingrade_helper_arm32: bingrade_helper_arm32
1472*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
1473*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/$< $(INSTALLDIR)/
1474*bbb1b6f9SApple OSS Distributions
1475*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += bingrade_helper_arm64
1476*bbb1b6f9SApple OSS Distributionsbingrade_helper_arm64: CFLAGS = -arch arm64 -static -nostdlib
1477*bbb1b6f9SApple OSS Distributionsbingrade_helper_arm64: bingrade_helper.c
1478*bbb1b6f9SApple OSS Distributions	$(CC) $(CFLAGS) $< -o $(SYMROOT)/$@
1479*bbb1b6f9SApple OSS Distributions	$(CODESIGN) -f -s- $(SYMROOT)/$@
1480*bbb1b6f9SApple OSS Distributions
1481*bbb1b6f9SApple OSS Distributionsinstall-bingrade_helper_arm64: bingrade_helper_arm64
1482*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
1483*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/$< $(INSTALLDIR)/
1484*bbb1b6f9SApple OSS Distributions
1485*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += bingrade_helper_arm_fat
1486*bbb1b6f9SApple OSS Distributionsbingrade_helper_arm_fat: CFLAGS = -arch arm64 -arch arm64_32 -arch arm64e -static -nostdlib
1487*bbb1b6f9SApple OSS Distributionsbingrade_helper_arm_fat: bingrade_helper.c
1488*bbb1b6f9SApple OSS Distributions	$(CC) $(CFLAGS) $< -o $(SYMROOT)/$@
1489*bbb1b6f9SApple OSS Distributions	$(CODESIGN) -f -s- $(SYMROOT)/$@
1490*bbb1b6f9SApple OSS Distributions
1491*bbb1b6f9SApple OSS Distributionsinstall-bingrade_helper_arm_fat: bingrade_helper_arm_fat
1492*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
1493*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/$< $(INSTALLDIR)/
1494*bbb1b6f9SApple OSS Distributions
1495*bbb1b6f9SApple OSS Distributionspmap_bench: INVALID_ARCHS = $(filter-out arm%,$(ARCH_CONFIGS))
1496*bbb1b6f9SApple OSS Distributionspmap_stress: INVALID_ARCHS = $(filter-out arm%,$(ARCH_CONFIGS))
1497*bbb1b6f9SApple OSS Distributionspmap_fault_on_commpage: INVALID_ARCHS = $(filter-out arm%,$(ARCH_CONFIGS))
1498*bbb1b6f9SApple OSS Distributions
1499*bbb1b6f9SApple OSS Distributionshw_breakpoint_step_arm64: CODE_SIGN_ENTITLEMENTS = hw_breakpoint_step_arm64_entitlements.plist
1500*bbb1b6f9SApple OSS Distributionshw_breakpoint_step_arm64: INVALID_ARCHS = $(filter-out arm64%,$(ARCH_CONFIGS))
1501*bbb1b6f9SApple OSS Distributionshw_breakpoint_step_arm64: excserver
1502*bbb1b6f9SApple OSS Distributionshw_breakpoint_step_arm64: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
1503*bbb1b6f9SApple OSS Distributions
1504*bbb1b6f9SApple OSS Distributionsexc_resource_threads: excserver
1505*bbb1b6f9SApple OSS Distributionsexc_resource_threads: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
1506*bbb1b6f9SApple OSS Distributionsexc_resource_threads: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
1507*bbb1b6f9SApple OSS Distributions
1508*bbb1b6f9SApple OSS Distributionsmach_service_port: notifyserver
1509*bbb1b6f9SApple OSS Distributionsmach_service_port: OTHER_CFLAGS += $(OBJROOT)/notifyServer.c -I $(OBJROOT)
1510*bbb1b6f9SApple OSS Distributions
1511*bbb1b6f9SApple OSS Distributionsfp_exception: excserver exc_helpers.c
1512*bbb1b6f9SApple OSS Distributionsfp_exception: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
1513*bbb1b6f9SApple OSS Distributionsfp_exception: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
1514*bbb1b6f9SApple OSS Distributions
1515*bbb1b6f9SApple OSS Distributionsptrauth_failure: excserver exc_helpers.c
1516*bbb1b6f9SApple OSS Distributionsptrauth_failure: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT) -Wno-language-extension-token
1517*bbb1b6f9SApple OSS Distributionsptrauth_failure: CODESIGN = $(CODESIGN_HARDENED_RUNTIME)
1518*bbb1b6f9SApple OSS Distributionsptrauth_failure: CODE_SIGN_ENTITLEMENTS = entitlements/set_state_and_exception_port.entitlement
1519*bbb1b6f9SApple OSS Distributions
1520*bbb1b6f9SApple OSS Distributionsdecompression_failure: excserver exc_helpers.c try_read_write.c
1521*bbb1b6f9SApple OSS Distributionsdecompression_failure: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
1522*bbb1b6f9SApple OSS Distributionsdecompression_failure: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
1523*bbb1b6f9SApple OSS Distributions
1524*bbb1b6f9SApple OSS Distributionsipc/kernel_signed_pac_thread_state: excserver
1525*bbb1b6f9SApple OSS Distributionsipc/kernel_signed_pac_thread_state: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
1526*bbb1b6f9SApple OSS Distributionsipc/kernel_signed_pac_thread_state: CODE_SIGN_ENTITLEMENTS = pac_exception_entitlement.plist
1527*bbb1b6f9SApple OSS Distributions
1528*bbb1b6f9SApple OSS Distributionsifeq ($(findstring arm64e,$(ARCH_CONFIGS)),)
1529*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += pac_exception_entitlement.c
1530*bbb1b6f9SApple OSS Distributionselse
1531*bbb1b6f9SApple OSS Distributionspac_exception_entitlement: excserver exc_helpers.c
1532*bbb1b6f9SApple OSS Distributionspac_exception_entitlement: OTHER_CFLAGS += $(OBJROOT)/excserver.c -Wno-language-extension-token
1533*bbb1b6f9SApple OSS Distributionspac_exception_entitlement: CODE_SIGN_ENTITLEMENTS = pac_exception_entitlement.plist
1534*bbb1b6f9SApple OSS Distributionsendif
1535*bbb1b6f9SApple OSS Distributions
1536*bbb1b6f9SApple OSS Distributionsunrecoverable_trap_test: excserver exc_helpers.c
1537*bbb1b6f9SApple OSS Distributionsunrecoverable_trap_test: OTHER_CFLAGS += $(OBJROOT)/excserver.c -Wno-language-extension-token
1538*bbb1b6f9SApple OSS Distributionsunrecoverable_trap_test: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
1539*bbb1b6f9SApple OSS Distributions# libdarwintest.a doesn't have an arm64 slice on watchOS
1540*bbb1b6f9SApple OSS Distributionsifeq ($(PLATFORM),WatchOS)
1541*bbb1b6f9SApple OSS Distributionsunrecoverable_trap_test: INVALID_ARCHS += arm64
1542*bbb1b6f9SApple OSS Distributionsendif
1543*bbb1b6f9SApple OSS Distributions
1544*bbb1b6f9SApple OSS Distributionsifeq ($(findstring arm64,$(ARCH_CONFIGS)),)
1545*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += arm_cpu_capabilities.c
1546*bbb1b6f9SApple OSS Distributionselse
1547*bbb1b6f9SApple OSS Distributionsarm_cpu_capabilities: INVALID_ARCHS = armv7k x86_64 x86_64h
1548*bbb1b6f9SApple OSS Distributionsarm_cpu_capabilities: excserver exc_helpers.c
1549*bbb1b6f9SApple OSS Distributionsarm_cpu_capabilities: OTHER_CFLAGS += $(OBJROOT)/excserver.c -Wno-language-extension-token -mcpu=apple-a15
1550*bbb1b6f9SApple OSS Distributions#if HAS_ARM_FEAT_SME
1551*bbb1b6f9SApple OSS Distributionsarm_cpu_capabilities: OTHER_CFLAGS += -mcpu=apple-a15+sme2
1552*bbb1b6f9SApple OSS Distributions#endif
1553*bbb1b6f9SApple OSS Distributions# Including PrivateHeaders from both Kernel.framework and System.framework makes
1554*bbb1b6f9SApple OSS Distributions# a mess out of the Mach headers we need to build exception handling support.
1555*bbb1b6f9SApple OSS Distributions# Work around this by only including the arm/ directory.
1556*bbb1b6f9SApple OSS Distributionsarm_cpu_capabilities: OTHER_CFLAGS += -isystem $(SDKROOT)/System/Library/Frameworks/Kernel.framework/PrivateHeaders/arm
1557*bbb1b6f9SApple OSS Distributionsarm_cpu_capabilities: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
1558*bbb1b6f9SApple OSS Distributionsendif
1559*bbb1b6f9SApple OSS Distributions
1560*bbb1b6f9SApple OSS Distributions# Disabling building of ldt files as dt_extractmeta crashes
1561*bbb1b6f9SApple OSS Distributions# in build systems. Ref rdar://110251082
1562*bbb1b6f9SApple OSS Distributions# Leaving commented bits for future re-enablement
1563*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += ldt_code32.s ldt.c
1564*bbb1b6f9SApple OSS Distributions
1565*bbb1b6f9SApple OSS Distributions#\ifeq ($(findstring x86_64,$(ARCH_CONFIGS)),)
1566*bbb1b6f9SApple OSS Distributions#EXCLUDED_SOURCES += ldt_code32.s ldt.c
1567*bbb1b6f9SApple OSS Distributions#\else # target = osx
1568*bbb1b6f9SApple OSS Distributions#$(OBJROOT)/ldt_mach_exc_server.c:
1569*bbb1b6f9SApple OSS Distributions#	$(MIG) $(CFLAGS) \
1570*bbb1b6f9SApple OSS Distributions#		-user /dev/null \
1571*bbb1b6f9SApple OSS Distributions#		-server $(OBJROOT)/ldt_mach_exc_server.c \
1572*bbb1b6f9SApple OSS Distributions#		-header $(OBJROOT)/ldt_mach_exc.h \
1573*bbb1b6f9SApple OSS Distributions#		mach_exc.defs
1574*bbb1b6f9SApple OSS Distributions#
1575*bbb1b6f9SApple OSS Distributions#ldt: INVALID_ARCHS = $(ARCH_CONFIGS)
1576*bbb1b6f9SApple OSS Distributions#ldt: $(OBJROOT)/ldt_mach_exc_server.c
1577*bbb1b6f9SApple OSS Distributions#ldt: OTHER_CFLAGS += -arch x86_64 -I $(OBJROOT) $(SRCROOT)/ldt_code32.s -Wl,-pagezero_size,0x1000 -Wno-missing-variable-declarations
1578*bbb1b6f9SApple OSS Distributions#ldt: CODE_SIGN_ENTITLEMENTS=ldt_entitlement.plist
1579*bbb1b6f9SApple OSS Distributions#\endif
1580*bbb1b6f9SApple OSS Distributions
1581*bbb1b6f9SApple OSS Distributionsifneq ($(PLATFORM),BridgeOS)
1582*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += remote_time.c
1583*bbb1b6f9SApple OSS Distributionselse
1584*bbb1b6f9SApple OSS Distributionsremote_time: INVALID_ARCHS = armv7 armv7s arm64_32
1585*bbb1b6f9SApple OSS Distributionsendif
1586*bbb1b6f9SApple OSS Distributions
1587*bbb1b6f9SApple OSS Distributionsvm_phys_footprint: OTHER_LDFLAGS += -framework CoreFoundation -framework IOSurface
1588*bbb1b6f9SApple OSS Distributions
1589*bbb1b6f9SApple OSS Distributionsvm_kern_count_wired_kernelcache: OTHER_CFLAGS += -I$(SDKROOT)/System/Library/Frameworks/Kernel.framework/PrivateHeaders/mach
1590*bbb1b6f9SApple OSS Distributions
1591*bbb1b6f9SApple OSS Distributionsdebug_control_port_for_pid: CODE_SIGN_ENTITLEMENTS = ./debug_control_port_for_pid_entitlement.plist
1592*bbb1b6f9SApple OSS Distributions
1593*bbb1b6f9SApple OSS Distributionsprng: OTHER_LDFLAGS += -ldarwintest_utils
1594*bbb1b6f9SApple OSS Distributions
1595*bbb1b6f9SApple OSS Distributionspreoslog: OTHER_LDFLAGS += -ldarwintest_utils
1596*bbb1b6f9SApple OSS Distributionspreoslog: OTHER_CFLAGS += test_utils.c
1597*bbb1b6f9SApple OSS Distributions
1598*bbb1b6f9SApple OSS Distributionstask_policy: CODE_SIGN_ENTITLEMENTS = ./task_policy_entitlement.plist
1599*bbb1b6f9SApple OSS Distributions
1600*bbb1b6f9SApple OSS DistributionsOTHER_TEST_TARGETS += task_policy_unentitled
1601*bbb1b6f9SApple OSS Distributionstask_policy_unentitled: CODE_SIGN_ENTITLEMENTS = task_for_pid_entitlement.plist
1602*bbb1b6f9SApple OSS Distributionstask_policy_unentitled: OTHER_CFLAGS += -DUNENTITLED
1603*bbb1b6f9SApple OSS Distributionstask_policy_unentitled: task_policy.c
1604*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
1605*bbb1b6f9SApple OSS Distributions	$(CODESIGN) --force --sign - --timestamp=none --entitlements $(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@
1606*bbb1b6f9SApple OSS Distributions
1607*bbb1b6f9SApple OSS Distributions
1608*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += get_shared_cache_address.c
1609*bbb1b6f9SApple OSS Distributions
1610*bbb1b6f9SApple OSS Distributions
1611*bbb1b6f9SApple OSS Distributionsifneq ($(filter iPhoneOS MacOSX, $(PLATFORM)),)
1612*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += get_shared_cache_address
1613*bbb1b6f9SApple OSS Distributions
1614*bbb1b6f9SApple OSS Distributionsget_shared_cache_address: INVALID_ARCHS = arm64 i386 x86_64
1615*bbb1b6f9SApple OSS Distributionsget_shared_cache_address: get_shared_cache_address.c
1616*bbb1b6f9SApple OSS Distributions	$(CC) $(OTHER_CFLAGS) $(CFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/get_shared_cache_address
1617*bbb1b6f9SApple OSS Distributions
1618*bbb1b6f9SApple OSS Distributionsinstall-get_shared_cache_address: get_shared_cache_address
1619*bbb1b6f9SApple OSS Distributions	$(CODESIGN) --force --sign - --timestamp=none --identifier=com.apple.get_shared_cache_address $(SYMROOT)/get_shared_cache_address
1620*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
1621*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/get_shared_cache_address $(INSTALLDIR)/
1622*bbb1b6f9SApple OSS Distributionsendif
1623*bbb1b6f9SApple OSS Distributions
1624*bbb1b6f9SApple OSS Distributions
1625*bbb1b6f9SApple OSS DistributionsOTHER_TEST_TARGETS += vm_memory_share_tests
1626*bbb1b6f9SApple OSS Distributions
1627*bbb1b6f9SApple OSS Distributionsvm_memory_share_tests: INVALID_ARCHS = i386
1628*bbb1b6f9SApple OSS Distributionsvm_memory_share_tests: CODE_SIGN_ENTITLEMENTS = ./task_for_pid_entitlement.plist
1629*bbb1b6f9SApple OSS Distributionsvm_memory_share_tests: vm_memory_tests_src/main.c vm_memory_tests_src/common.c vm_memory_tests_src/vm_tests.c
1630*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
1631*bbb1b6f9SApple OSS Distributions	echo $(CODESIGN) --force --sign - --timestamp=none --entitlements $(SRCROOT)/$(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@;
1632*bbb1b6f9SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements "$(SRCROOT)/$(CODE_SIGN_ENTITLEMENTS)" $(SYMROOT)/$@;
1633*bbb1b6f9SApple OSS Distributions
1634*bbb1b6f9SApple OSS Distributions# build the mach server as individual helper which does not use libdarwintest
1635*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += vm_memory_share_tests_server
1636*bbb1b6f9SApple OSS Distributionsvm_memory_share_tests_server: CODE_SIGN_ENTITLEMENTS = ./task_for_pid_entitlement.plist
1637*bbb1b6f9SApple 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
1638*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/vm_memory_share_tests_server
1639*bbb1b6f9SApple OSS Distributions	echo $(CODESIGN) --force --sign - --timestamp=none --entitlements $(SRCROOT)/$(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@;
1640*bbb1b6f9SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements "$(SRCROOT)/$(CODE_SIGN_ENTITLEMENTS)" $(SYMROOT)/$@;
1641*bbb1b6f9SApple OSS Distributions
1642*bbb1b6f9SApple OSS Distributionsinstall-vm_memory_share_tests_server: vm_memory_share_tests_server
1643*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
1644*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/vm_memory_share_tests_server $(INSTALLDIR)/
1645*bbb1b6f9SApple OSS Distributions
1646*bbb1b6f9SApple OSS Distributionsifeq ($(PLATFORM),MacOSX)
1647*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += vm/kern_max_task_pmem.c
1648*bbb1b6f9SApple OSS Distributionsendif
1649*bbb1b6f9SApple OSS Distributions
1650*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += benchmark/helpers.c
1651*bbb1b6f9SApple OSS Distributions
1652*bbb1b6f9SApple OSS Distributionsvm/fault_throughput: OTHER_CFLAGS += benchmark/helpers.c
1653*bbb1b6f9SApple OSS Distributionsvm/fault_throughput: CODE_SIGN_ENTITLEMENTS = arm_mte.entitlements
1654*bbb1b6f9SApple OSS Distributions
1655*bbb1b6f9SApple OSS Distributions.PHONY: install-vm/fault_throughput
1656*bbb1b6f9SApple OSS Distributionsinstall-vm/fault_throughput: vm/fault_throughput
1657*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)/vm
1658*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/vm/fault_throughput $(INSTALLDIR)/vm/
1659*bbb1b6f9SApple OSS Distributions
1660*bbb1b6f9SApple OSS Distributions$(SYMROOT)/vm/fault_throughput.lua: $(SRCROOT)/vm/fault_throughput.lua
1661*bbb1b6f9SApple OSS Distributions	mkdir -p $(SYMROOT)/vm
1662*bbb1b6f9SApple OSS Distributions	cp $< $@
1663*bbb1b6f9SApple OSS Distributions	chmod +x $@
1664*bbb1b6f9SApple OSS Distributions
1665*bbb1b6f9SApple OSS Distributions.PHONY: install-fault_throughput_benchrun
1666*bbb1b6f9SApple OSS Distributionsinstall-$(SYMROOT)/vm/fault_throughput.lua: $(SYMROOT)/vm/fault_throughput.lua
1667*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)/vm
1668*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/vm/fault_throughput.lua $(INSTALLDIR)/vm/
1669*bbb1b6f9SApple OSS Distributions	chmod +x $(INSTALLDIR)/vm/fault_throughput.lua
1670*bbb1b6f9SApple OSS Distributions
1671*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += vm/fault_throughput.plist
1672*bbb1b6f9SApple OSS Distributions
1673*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += $(SYMROOT)/vm/fault_throughput.lua vm/fault_throughput
1674*bbb1b6f9SApple OSS Distributions
1675*bbb1b6f9SApple OSS Distributionsifeq ($(PLATFORM),MacOSX)
1676*bbb1b6f9SApple OSS Distributionsmixed_pagesize: vm/mixed_pagesize.c
1677*bbb1b6f9SApple OSS Distributions	mkdir -p $(SYMROOT)/vm
1678*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/vm/$@
1679*bbb1b6f9SApple OSS Distributions
1680*bbb1b6f9SApple OSS Distributionsinstall-mixed_pagesize: mixed_pagesize
1681*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)/vm
1682*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/vm/mixed_pagesize $(INSTALLDIR)/vm/
1683*bbb1b6f9SApple OSS Distributions
1684*bbb1b6f9SApple OSS DistributionsBATS_PLISTS += $(SRCROOT)/vm/mixed_pagesize.plist
1685*bbb1b6f9SApple OSS Distributions
1686*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += vm/mixed_pagesize.c vm/mixed_pagesize.plist
1687*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += mixed_pagesize
1688*bbb1b6f9SApple OSS Distributionselse
1689*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += vm/mixed_pagesize.c vm/mixed_pagesize.plist
1690*bbb1b6f9SApple OSS Distributionsendif
1691*bbb1b6f9SApple OSS Distributions
1692*bbb1b6f9SApple OSS Distributionsmanual_wq_cooperative: manual_wq_cooperative.c
1693*bbb1b6f9SApple OSS Distributions	mkdir -p $(SYMROOT)
1694*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
1695*bbb1b6f9SApple OSS Distributions
1696*bbb1b6f9SApple OSS Distributionsinstall-manual_wq_cooperative: manual_wq_cooperative
1697*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
1698*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/manual_wq_cooperative $(INSTALLDIR)
1699*bbb1b6f9SApple OSS Distributions
1700*bbb1b6f9SApple OSS DistributionsBATS_PLISTS += $(SRCROOT)/workqueue.plist
1701*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += manual_wq_cooperative.c workqueue.plist
1702*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += manual_wq_cooperative
1703*bbb1b6f9SApple OSS Distributions
1704*bbb1b6f9SApple OSS Distributions# VM madvise(2) benchmark
1705*bbb1b6f9SApple OSS Distributions
1706*bbb1b6f9SApple OSS DistributionsBATS_PLISTS += $(SRCROOT)/vm/perf_madvise.plist
1707*bbb1b6f9SApple OSS Distributions
1708*bbb1b6f9SApple OSS Distributionsvm/perf_madvise: OTHER_CFLAGS += benchmark/helpers.c
1709*bbb1b6f9SApple OSS Distributionsvm/perf_madvise: CODE_SIGN_ENTITLEMENTS = arm_mte.entitlements
1710*bbb1b6f9SApple OSS Distributions
1711*bbb1b6f9SApple OSS Distributions.PHONY: install-vm/perf_madvise
1712*bbb1b6f9SApple OSS Distributionsinstall-vm/perf_madvise: vm/perf_madvise
1713*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)/vm
1714*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/vm/perf_madvise $(INSTALLDIR)/vm/
1715*bbb1b6f9SApple OSS Distributions
1716*bbb1b6f9SApple OSS Distributions$(SYMROOT)/vm/perf_madvise.lua: $(SRCROOT)/vm/perf_madvise.lua
1717*bbb1b6f9SApple OSS Distributions	mkdir -p $(SYMROOT)/vm
1718*bbb1b6f9SApple OSS Distributions	cp $< $@
1719*bbb1b6f9SApple OSS Distributions	chmod +x $@
1720*bbb1b6f9SApple OSS Distributions
1721*bbb1b6f9SApple OSS Distributions.PHONY: install-perf_madvise_benchrun
1722*bbb1b6f9SApple OSS Distributionsinstall-$(SYMROOT)/vm/perf_madvise.lua: $(SYMROOT)/vm/perf_madvise.lua
1723*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)/vm
1724*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/vm/perf_madvise.lua $(INSTALLDIR)/vm
1725*bbb1b6f9SApple OSS Distributions	chmod +x $(INSTALLDIR)/vm/perf_madvise.lua
1726*bbb1b6f9SApple OSS Distributions
1727*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += $(SYMROOT)/vm/perf_madvise.lua vm/perf_madvise
1728*bbb1b6f9SApple OSS Distributions
1729*bbb1b6f9SApple OSS DistributionsBATS_PLISTS += $(SRCROOT)/vm/perf_compressor.plist
1730*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += vm/perf_compressor.plist
1731*bbb1b6f9SApple OSS Distributions
1732*bbb1b6f9SApple OSS Distributionsvm/perf_compressor: OTHER_CFLAGS += benchmark/helpers.c
1733*bbb1b6f9SApple OSS Distributionsvm/perf_compressor: CODE_SIGN_ENTITLEMENTS = arm_mte.entitlements
1734*bbb1b6f9SApple OSS Distributions
1735*bbb1b6f9SApple OSS Distributions.PHONY: install-vm/perf_compressor
1736*bbb1b6f9SApple OSS Distributionsinstall-vm/perf_compressor: vm/perf_compressor
1737*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)/vm
1738*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/vm/perf_compressor $(INSTALLDIR)/vm/
1739*bbb1b6f9SApple OSS Distributions
1740*bbb1b6f9SApple OSS Distributions$(SYMROOT)/vm/perf_compressor.lua: $(SRCROOT)/vm/perf_compressor.lua
1741*bbb1b6f9SApple OSS Distributions	mkdir -p $(SYMROOT)/vm
1742*bbb1b6f9SApple OSS Distributions	cp $< $@
1743*bbb1b6f9SApple OSS Distributions	chmod +x $@
1744*bbb1b6f9SApple OSS Distributions
1745*bbb1b6f9SApple OSS Distributions.PHONY: install-$(SYMROOT)/vm/perf_compressor_benchrun
1746*bbb1b6f9SApple OSS Distributionsinstall-$(SYMROOT)/vm/perf_compressor.lua: $(SYMROOT)/vm/perf_compressor.lua
1747*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)/vm
1748*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/vm/perf_compressor.lua $(INSTALLDIR)/vm/
1749*bbb1b6f9SApple OSS Distributions	chmod +x $(INSTALLDIR)/vm/perf_compressor.lua
1750*bbb1b6f9SApple OSS Distributions
1751*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += $(SYMROOT)/vm/perf_compressor.lua vm/perf_compressor
1752*bbb1b6f9SApple OSS Distributions
1753*bbb1b6f9SApple OSS Distributionsioconnectasyncmethod_57641955: OTHER_LDFLAGS += -framework IOKit
1754*bbb1b6f9SApple OSS Distributions
1755*bbb1b6f9SApple OSS Distributionsifeq ($(PLATFORM),BridgeOS)
1756*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += ipsec.m
1757*bbb1b6f9SApple OSS Distributionselse
1758*bbb1b6f9SApple OSS Distributionsipsec: OTHER_LDFLAGS += -framework Foundation -framework CoreFoundation -framework NetworkExtension
1759*bbb1b6f9SApple OSS Distributionsipsec: CODE_SIGN_ENTITLEMENTS = ipsec.entitlements
1760*bbb1b6f9SApple OSS Distributionsendif
1761*bbb1b6f9SApple OSS Distributions
1762*bbb1b6f9SApple OSS Distributionstest_sysctl_kern_procargs_25397314: OTHER_LDFLAGS += -framework Foundation -ldarwintest_utils
1763*bbb1b6f9SApple OSS Distributions
1764*bbb1b6f9SApple OSS DistributionsINCLUDED_TEST_SOURCE_DIRS += counter
1765*bbb1b6f9SApple OSS Distributions
1766*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += counter/common.c
1767*bbb1b6f9SApple OSS Distributionscounter/counter: OTHER_CFLAGS += counter/common.c test_utils.c
1768*bbb1b6f9SApple OSS Distributionscounter/counter: OTHER_LDFLAGS += -ldarwintest_utils -ldarwintest
1769*bbb1b6f9SApple OSS Distributions
1770*bbb1b6f9SApple OSS Distributionscounter/benchmark: OTHER_CFLAGS += counter/common.c benchmark/helpers.c
1771*bbb1b6f9SApple OSS Distributions
1772*bbb1b6f9SApple OSS Distributions.PHONY: install-counter/benchmark
1773*bbb1b6f9SApple OSS Distributionsinstall-counter/benchmark: counter/benchmark
1774*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)/counter
1775*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/counter/benchmark $(INSTALLDIR)/counter/
1776*bbb1b6f9SApple OSS Distributions
1777*bbb1b6f9SApple OSS Distributions$(SYMROOT)/counter/benchmark.lua: $(SRCROOT)/counter/benchmark.lua
1778*bbb1b6f9SApple OSS Distributions	mkdir -p $(SYMROOT)/counter
1779*bbb1b6f9SApple OSS Distributions	cp $< $@
1780*bbb1b6f9SApple OSS Distributions	chmod +x $@
1781*bbb1b6f9SApple OSS Distributions
1782*bbb1b6f9SApple OSS Distributions.PHONY: install-counter_benchrun
1783*bbb1b6f9SApple OSS Distributionsinstall-$(SYMROOT)/counter/benchmark.lua: $(SYMROOT)/counter/benchmark.lua
1784*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)/counter
1785*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/counter/benchmark.lua $(INSTALLDIR)/counter/
1786*bbb1b6f9SApple OSS Distributions	chmod +x $(INSTALLDIR)/counter/benchmark.lua
1787*bbb1b6f9SApple OSS Distributions
1788*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += $(SYMROOT)/counter/benchmark.lua counter/benchmark
1789*bbb1b6f9SApple OSS Distributions
1790*bbb1b6f9SApple OSS Distributionsifneq ($(PLATFORM),MacOSX)
1791*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += vm/page_size_globals.c
1792*bbb1b6f9SApple OSS Distributionselse
1793*bbb1b6f9SApple OSS Distributionsvm/page_size_globals: INVALID_ARCHS = arm64 arm64e
1794*bbb1b6f9SApple OSS Distributionsendif
1795*bbb1b6f9SApple OSS Distributions
1796*bbb1b6f9SApple OSS Distributions# Same helper used in execperf, different build system.
1797*bbb1b6f9SApple OSS Distributionsstatic_binary: ../tools/tests/execperf/exit-asm.S
1798*bbb1b6f9SApple 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
1799*bbb1b6f9SApple OSS Distributions	CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/static_binary
1800*bbb1b6f9SApple OSS Distributions
1801*bbb1b6f9SApple OSS Distributionsinstall-static_binary: static_binary
1802*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
1803*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/static_binary $(INSTALLDIR)
1804*bbb1b6f9SApple OSS Distributions
1805*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += static_binary
1806*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += static_binary.c
1807*bbb1b6f9SApple OSS Distributions
1808*bbb1b6f9SApple OSS Distributionstest_static_binary_csflags: static_binary
1809*bbb1b6f9SApple OSS Distributionstest_static_binary_csflags: OTHER_LDFLAGS += -ldarwintest_utils
1810*bbb1b6f9SApple OSS Distributions
1811*bbb1b6f9SApple OSS Distributions
1812*bbb1b6f9SApple OSS Distributionslibmalloc_apple_array: CODE_SIGN_ENTITLEMENTS = entitlements/libmalloc_apple_array.entitlements
1813*bbb1b6f9SApple OSS Distributionslibmalloc_apple_array: OTHER_CFLAGS += -DENTITLED=1 drop_priv.c test_utils.c
1814*bbb1b6f9SApple OSS Distributionslibmalloc_apple_array: OTHER_LDFLAGS += -ldarwintest_utils
1815*bbb1b6f9SApple 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_proc_security print_apple_array_hardened_heap print_apple_array_hardened_heap_security
1816*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
1817*bbb1b6f9SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements $(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@;
1818*bbb1b6f9SApple OSS Distributions
1819*bbb1b6f9SApple OSS Distributionslibmalloc_apple_array_unentitled: OTHER_CFLAGS += drop_priv.c test_utils.c
1820*bbb1b6f9SApple OSS Distributionslibmalloc_apple_array_unentitled: OTHER_LDFLAGS += -ldarwintest_utils
1821*bbb1b6f9SApple 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
1822*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $(OTHER_CFLAGS) $< -o $(SYMROOT)/$@
1823*bbb1b6f9SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
1824*bbb1b6f9SApple OSS Distributions
1825*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += print_apple_array
1826*bbb1b6f9SApple OSS Distributionsprint_apple_array: print_apple_array.c
1827*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
1828*bbb1b6f9SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
1829*bbb1b6f9SApple OSS Distributions
1830*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += print_apple_array_HR1
1831*bbb1b6f9SApple OSS Distributionsprint_apple_array_HR1: CODE_SIGN_ENTITLEMENTS=entitlements/enhanced-security-binary-entitlements-1.plist
1832*bbb1b6f9SApple OSS Distributionsprint_apple_array_HR1: print_apple_array.c
1833*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
1834*bbb1b6f9SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --entitlements $(SRCROOT)/$(CODE_SIGN_ENTITLEMENTS) --timestamp=none $(SYMROOT)/$@;
1835*bbb1b6f9SApple OSS Distributions
1836*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += print_apple_array_HR2
1837*bbb1b6f9SApple OSS Distributionsprint_apple_array_HR2: CODE_SIGN_ENTITLEMENTS=entitlements/enhanced-security-binary-entitlements-2.plist
1838*bbb1b6f9SApple OSS Distributionsprint_apple_array_HR2: print_apple_array.c
1839*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
1840*bbb1b6f9SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --entitlements $(SRCROOT)/$(CODE_SIGN_ENTITLEMENTS) --timestamp=none $(SYMROOT)/$@;
1841*bbb1b6f9SApple OSS Distributions
1842*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += print_apple_array_hardened_proc
1843*bbb1b6f9SApple OSS Distributionsprint_apple_array_hardened_proc: CODE_SIGN_ENTITLEMENTS=entitlements/hardened-proc.entitlements
1844*bbb1b6f9SApple OSS Distributionsprint_apple_array_hardened_proc: print_apple_array.c
1845*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
1846*bbb1b6f9SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --entitlements $(SRCROOT)/$(CODE_SIGN_ENTITLEMENTS) --timestamp=none $(SYMROOT)/$@;
1847*bbb1b6f9SApple OSS Distributions
1848*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += print_apple_array_hardened_proc_security
1849*bbb1b6f9SApple OSS Distributionsprint_apple_array_hardened_proc_security: CODE_SIGN_ENTITLEMENTS=entitlements/hardened-proc-security.entitlements
1850*bbb1b6f9SApple OSS Distributionsprint_apple_array_hardened_proc_security: print_apple_array.c
1851*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
1852*bbb1b6f9SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --entitlements $(SRCROOT)/$(CODE_SIGN_ENTITLEMENTS) --timestamp=none $(SYMROOT)/$@;
1853*bbb1b6f9SApple OSS Distributions
1854*bbb1b6f9SApple OSS Distributions
1855*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += print_apple_array_hardened_heap
1856*bbb1b6f9SApple OSS Distributionsprint_apple_array_hardened_heap: CODE_SIGN_ENTITLEMENTS=entitlements/hardened-heap.entitlements
1857*bbb1b6f9SApple OSS Distributionsprint_apple_array_hardened_heap: print_apple_array.c
1858*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
1859*bbb1b6f9SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --entitlements $(SRCROOT)/$(CODE_SIGN_ENTITLEMENTS) --timestamp=none $(SYMROOT)/$@;
1860*bbb1b6f9SApple OSS Distributions
1861*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += print_apple_array_hardened_heap_security
1862*bbb1b6f9SApple OSS Distributionsprint_apple_array_hardened_heap_security: CODE_SIGN_ENTITLEMENTS=entitlements/hardened-heap-security.entitlements
1863*bbb1b6f9SApple OSS Distributionsprint_apple_array_hardened_heap_security: print_apple_array.c
1864*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
1865*bbb1b6f9SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --entitlements $(SRCROOT)/$(CODE_SIGN_ENTITLEMENTS) --timestamp=none $(SYMROOT)/$@;
1866*bbb1b6f9SApple OSS Distributions
1867*bbb1b6f9SApple OSS Distributionsinstall-print_apple_array: print_apple_array
1868*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)/tools
1869*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/print_apple_array $(INSTALLDIR)/tools/
1870*bbb1b6f9SApple OSS Distributions
1871*bbb1b6f9SApple OSS Distributionsinstall-print_apple_array_HR1: print_apple_array_HR1
1872*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)/tools
1873*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/print_apple_array_HR1 $(INSTALLDIR)/tools/
1874*bbb1b6f9SApple OSS Distributions
1875*bbb1b6f9SApple OSS Distributionsinstall-print_apple_array_HR2: print_apple_array_HR2
1876*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)/tools
1877*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/print_apple_array_HR2 $(INSTALLDIR)/tools/
1878*bbb1b6f9SApple OSS Distributions
1879*bbb1b6f9SApple OSS Distributionsinstall-print_apple_array_hardened_proc: print_apple_array_hardened_proc
1880*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)/tools
1881*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/print_apple_array_hardened_proc $(INSTALLDIR)/tools/
1882*bbb1b6f9SApple OSS Distributions
1883*bbb1b6f9SApple OSS Distributionsinstall-print_apple_array_hardened_proc_security: print_apple_array_hardened_proc_security
1884*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)/tools
1885*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/print_apple_array_hardened_proc_security $(INSTALLDIR)/tools/
1886*bbb1b6f9SApple OSS Distributions
1887*bbb1b6f9SApple OSS Distributionsinstall-print_apple_array_hardened_heap: print_apple_array_hardened_heap
1888*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)/tools
1889*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/print_apple_array_hardened_heap $(INSTALLDIR)/tools/
1890*bbb1b6f9SApple OSS Distributions
1891*bbb1b6f9SApple OSS Distributions
1892*bbb1b6f9SApple OSS Distributionsinstall-print_apple_array_hardened_heap_security: print_apple_array_hardened_heap_security
1893*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)/tools
1894*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/print_apple_array_hardened_heap_security $(INSTALLDIR)/tools/
1895*bbb1b6f9SApple OSS Distributions
1896*bbb1b6f9SApple OSS Distributionspersona: CODE_SIGN_ENTITLEMENTS = persona.entitlements
1897*bbb1b6f9SApple OSS Distributionspersona_adoption: CODE_SIGN_ENTITLEMENTS = persona_adoption.entitlements
1898*bbb1b6f9SApple OSS Distributions
1899*bbb1b6f9SApple OSS DistributionsOTHER_TEST_TARGETS += libmalloc_apple_array libmalloc_apple_array_unentitled
1900*bbb1b6f9SApple OSS Distributions
1901*bbb1b6f9SApple OSS Distributionsentropy: OTHER_CFLAGS += -framework perfdata
1902*bbb1b6f9SApple OSS Distributions
1903*bbb1b6f9SApple OSS Distributionsdebug_enable_syscall_rejection: OTHER_LDFLAGS += -ldarwintest_utils
1904*bbb1b6f9SApple OSS Distributions
1905*bbb1b6f9SApple OSS Distributionsthread_set_state_arm64_cpsr: CODE_SIGN_ENTITLEMENTS = entitlements/thread_set_state.entitlement
1906*bbb1b6f9SApple OSS Distributions
1907*bbb1b6f9SApple OSS Distributionsvm/app_swap: OTHER_LDFLAGS += -ldarwintest_utils
1908*bbb1b6f9SApple OSS Distributions
1909*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += debug_syscall_rejection_helper
1910*bbb1b6f9SApple OSS Distributionsdebug_syscall_rejection_helper: debug_syscall_rejection_helper.c
1911*bbb1b6f9SApple OSS Distributions	$(CC) $(OTHER_CFLAGS) $(CFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@; \
1912*bbb1b6f9SApple OSS Distributions	echo $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@; \
1913*bbb1b6f9SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
1914*bbb1b6f9SApple OSS Distributions
1915*bbb1b6f9SApple OSS Distributions
1916*bbb1b6f9SApple OSS Distributionsinstall-debug_syscall_rejection_helper: debug_syscall_rejection_helper
1917*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
1918*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/debug_syscall_rejection_helper $(INSTALLDIR)/
1919*bbb1b6f9SApple OSS Distributions
1920*bbb1b6f9SApple OSS Distributionsfile_leases: OTHER_CFLAGS += test_utils.c
1921*bbb1b6f9SApple OSS Distributionsfile_leases: OTHER_LDFLAGS += -ldarwintest_utils
1922*bbb1b6f9SApple OSS Distributionsfile_leases: CODE_SIGN_ENTITLEMENTS = file_leases.entitlements
1923*bbb1b6f9SApple OSS Distributions
1924*bbb1b6f9SApple OSS Distributionsiopolicy: OTHER_LDFLAGS += -ldarwintest_utils
1925*bbb1b6f9SApple OSS Distributionsiopolicy: CODE_SIGN_ENTITLEMENTS = iopolicy.entitlements
1926*bbb1b6f9SApple OSS Distributions
1927*bbb1b6f9SApple OSS DistributionsINCLUDED_TEST_SOURCE_DIRS += vfs
1928*bbb1b6f9SApple OSS Distributionsvfs/freeable_vnodes: OTHER_LDFLAGS += -ldarwintest_utils
1929*bbb1b6f9SApple OSS Distributionsvfs/statfs_ext: OTHER_LDFLAGS += -lsandbox
1930*bbb1b6f9SApple OSS Distributionsvfs/sandbox_fstat: OTHER_LDFLAGS += -lsandbox
1931*bbb1b6f9SApple OSS Distributionsvfs/named_fork_path: OTHER_LDFLAGS += -lsandbox
1932*bbb1b6f9SApple OSS Distributionsvfs/sandbox_type_error: OTHER_LDFLAGS += -lsandbox
1933*bbb1b6f9SApple OSS Distributionsvfs/sandbox_appledouble_write: OTHER_LDFLAGS += -lsandbox
1934*bbb1b6f9SApple OSS Distributions
1935*bbb1b6f9SApple OSS Distributions# tests/vm/configurator_*.c use the VM configurator
1936*bbb1b6f9SApple OSS Distributions
1937*bbb1b6f9SApple OSS DistributionsVM_CONFIGURATOR_SRCS = $(wildcard vm/configurator_*.c)
1938*bbb1b6f9SApple OSS DistributionsVM_CONFIGURATOR_TARGETS = $(VM_CONFIGURATOR_SRCS:%.c=%)
1939*bbb1b6f9SApple OSS Distributions
1940*bbb1b6f9SApple OSS Distributions$(VM_CONFIGURATOR_TARGETS): vm/configurator/vm_configurator.c
1941*bbb1b6f9SApple OSS Distributions$(VM_CONFIGURATOR_TARGETS): vm/configurator/vm_configurator.h vm/configurator/vm_configurator_tests.h
1942*bbb1b6f9SApple OSS Distributions$(VM_CONFIGURATOR_TARGETS): OTHER_CFLAGS += -Wall -Wextra -g
1943*bbb1b6f9SApple OSS Distributions
1944*bbb1b6f9SApple OSS Distributions# exception handling helpers
1945*bbb1b6f9SApple OSS Distributions$(VM_CONFIGURATOR_TARGETS): exc_guard_helper.c try_read_write.c exc_helpers.c test_utils.c excserver
1946*bbb1b6f9SApple OSS Distributions$(VM_CONFIGURATOR_TARGETS): OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
1947*bbb1b6f9SApple OSS Distributions$(VM_CONFIGURATOR_TARGETS): OTHER_LDFLAGS += -ldarwintest_utils
1948*bbb1b6f9SApple OSS Distributions$(VM_CONFIGURATOR_TARGETS): CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
1949*bbb1b6f9SApple OSS Distributions
1950*bbb1b6f9SApple OSS Distributions# Convenience target to build all tests that use vm_configurator.c
1951*bbb1b6f9SApple OSS Distributions.PHONY: all-vm-configurator-tests
1952*bbb1b6f9SApple OSS Distributionsall-vm-configurator-tests: $(VM_CONFIGURATOR_TARGETS)
1953*bbb1b6f9SApple OSS Distributions
1954*bbb1b6f9SApple OSS Distributions# Convenience target to list all test executables that use vm_configurator.c
1955*bbb1b6f9SApple OSS Distributions.PHONY: list-all-vm-configurator-executables
1956*bbb1b6f9SApple OSS Distributionslist-all-vm-configurator-executables:
1957*bbb1b6f9SApple OSS Distributions	@ echo $(addprefix $(SYMROOT)/,$(VM_CONFIGURATOR_TARGETS))
1958*bbb1b6f9SApple OSS Distributions
1959*bbb1b6f9SApple OSS Distributionsvm/corpse_footprint: OTHER_LDFLAGS += -ldarwintest_utils
1960*bbb1b6f9SApple OSS Distributions
1961*bbb1b6f9SApple OSS DistributionsEXCLUDED_SOURCES += constrained_ctypes_tests.c
1962*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += constrained_ctypes_tests_enabled constrained_ctypes_tests_enacted constrained_ctypes_tests_disabled
1963*bbb1b6f9SApple OSS Distributionsconstrained_ctypes_tests_enabled: OTHER_CFLAGS += -D__CCT_TEST_ENABLED
1964*bbb1b6f9SApple OSS Distributionsconstrained_ctypes_tests_enabled: OTHER_LDFLAGS += -ldarwintest_utils
1965*bbb1b6f9SApple OSS Distributionsconstrained_ctypes_tests_enabled: constrained_ctypes_tests.c
1966*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) constrained_ctypes_tests.c -o $(SYMROOT)/constrained_ctypes_tests_enabled
1967*bbb1b6f9SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/constrained_ctypes_tests_enabled;
1968*bbb1b6f9SApple OSS Distributions
1969*bbb1b6f9SApple OSS Distributionsinstall-constrained_ctypes_tests_enabled: constrained_ctypes_tests_enabled
1970*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
1971*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/constrained_ctypes_tests_enabled $(INSTALLDIR)/
1972*bbb1b6f9SApple OSS Distributions
1973*bbb1b6f9SApple OSS Distributionsconstrained_ctypes_tests_enacted: OTHER_CFLAGS += -D__CCT_TEST_ENABLED
1974*bbb1b6f9SApple OSS Distributionsconstrained_ctypes_tests_enacted: OTHER_CFLAGS += -D__CCT_TEST_ENACTED
1975*bbb1b6f9SApple OSS Distributionsconstrained_ctypes_tests_enacted: OTHER_CFLAGS += -fbounds-safety
1976*bbb1b6f9SApple OSS Distributionsconstrained_ctypes_tests_enacted: OTHER_LDFLAGS += -ldarwintest_utils
1977*bbb1b6f9SApple OSS Distributionsconstrained_ctypes_tests_enacted: constrained_ctypes_tests.c
1978*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) constrained_ctypes_tests.c -o $(SYMROOT)/constrained_ctypes_tests_enacted
1979*bbb1b6f9SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/constrained_ctypes_tests_enacted;
1980*bbb1b6f9SApple OSS Distributions
1981*bbb1b6f9SApple OSS Distributionsinstall-constrained_ctypes_tests_enacted: constrained_ctypes_tests_enacted
1982*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
1983*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/constrained_ctypes_tests_enacted $(INSTALLDIR)/
1984*bbb1b6f9SApple OSS Distributions
1985*bbb1b6f9SApple OSS Distributions
1986*bbb1b6f9SApple OSS Distributionsconstrained_ctypes_tests_disabled: OTHER_LDFLAGS += -ldarwintest_utils
1987*bbb1b6f9SApple OSS Distributionsconstrained_ctypes_tests_disabled: constrained_ctypes_tests.c
1988*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) constrained_ctypes_tests.c -o $(SYMROOT)/constrained_ctypes_tests_disabled
1989*bbb1b6f9SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/constrained_ctypes_tests_disabled;
1990*bbb1b6f9SApple OSS Distributions
1991*bbb1b6f9SApple OSS Distributionsinstall-constrained_ctypes_tests_disabled: constrained_ctypes_tests_disabled
1992*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
1993*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/constrained_ctypes_tests_disabled $(INSTALLDIR)/
1994*bbb1b6f9SApple OSS Distributions
1995*bbb1b6f9SApple OSS Distributionstask_suspend_stats: OTHER_LDFLAGS += -ldarwintest_utils
1996*bbb1b6f9SApple OSS Distributionstask_suspend_stats: CODE_SIGN_ENTITLEMENTS = task_for_pid_entitlement.plist
1997*bbb1b6f9SApple OSS Distributions
1998*bbb1b6f9SApple OSS Distributionsexec_set_proc_name: OTHER_LDFLAGS += -ldarwintest_utils
1999*bbb1b6f9SApple OSS Distributions
2000*bbb1b6f9SApple OSS Distributions
2001*bbb1b6f9SApple OSS Distributionsinclude $(DEVELOPER_DIR)/AppleInternal/Makefiles/darwintest/Makefile.targets
2002*bbb1b6f9SApple OSS Distributions
2003*bbb1b6f9SApple OSS Distributionsexception_ports_info: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
2004*bbb1b6f9SApple OSS Distributions
2005*bbb1b6f9SApple OSS Distributionsvfs/longpaths: vfs/longpaths.c
2006*bbb1b6f9SApple OSS Distributionsvfs/longpaths: OTHER_LDFLAGS += -ldarwintest_utils
2007*bbb1b6f9SApple OSS Distributionsvfs/longpaths: CODE_SIGN_ENTITLEMENTS = vfs/longpaths.entitlements
2008*bbb1b6f9SApple OSS Distributions
2009*bbb1b6f9SApple OSS Distributionsvfs/devfs_fdesc: vfs/devfs_fdesc.c
2010*bbb1b6f9SApple OSS Distributionsvfs/devfs_fdesc: CODE_SIGN_ENTITLEMENTS = vfs/devfs_fdesc.entitlements
2011*bbb1b6f9SApple OSS Distributions
2012*bbb1b6f9SApple OSS Distributionsvfs/openbyid_stress: vfs/openbyid_stress.c
2013*bbb1b6f9SApple OSS Distributionsvfs/openbyid_stress: CODE_SIGN_ENTITLEMENTS = vfs/openbyid_stress.entitlements
2014*bbb1b6f9SApple OSS Distributions
2015*bbb1b6f9SApple OSS DistributionsOTHER_TEST_TARGETS += trial_experiment_factors_entitled
2016*bbb1b6f9SApple OSS Distributionstrial_experiment_factors_entitled: OTHER_CFLAGS += -DENTITLED=1
2017*bbb1b6f9SApple OSS Distributionstrial_experiment_factors_entitled: CODE_SIGN_ENTITLEMENTS=kern-trial.entitlements
2018*bbb1b6f9SApple OSS Distributionstrial_experiment_factors_entitled: trial_experiment_factors.c
2019*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
2020*bbb1b6f9SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements $(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@;
2021*bbb1b6f9SApple OSS Distributions
2022*bbb1b6f9SApple OSS Distributionsmemorystatus_experiment_factors: CODESIGN_ENTITLEMENTS=./memorystatus/memorystatus_experiment_factors.entitlements
2023*bbb1b6f9SApple OSS Distributionsmemorystatus_experiment_factors: memorystatus/memorystatus_experiment_factors.c
2024*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
2025*bbb1b6f9SApple OSS Distributions	$(ENV) CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements $(CODESIGN_ENTITLEMENTS) $(SYMROOT)/$@;
2026*bbb1b6f9SApple OSS Distributions
2027*bbb1b6f9SApple OSS Distributionsifeq ($(PLATFORM),MacOSX)
2028*bbb1b6f9SApple OSS DistributionsCUSTOM_TARGETS += nox86exec_helper
2029*bbb1b6f9SApple OSS Distributions
2030*bbb1b6f9SApple OSS Distributionsnox86exec_helper: INVALID_ARCHS = arm64e arm64
2031*bbb1b6f9SApple OSS Distributionsnox86exec_helper: nox86exec_helper.c
2032*bbb1b6f9SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
2033*bbb1b6f9SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
2034*bbb1b6f9SApple OSS Distributions
2035*bbb1b6f9SApple OSS Distributionsinstall-posix_spawn_alt_rosetta_helper: nox86exec_helper
2036*bbb1b6f9SApple OSS Distributions	mkdir -p $(INSTALLDIR)
2037*bbb1b6f9SApple OSS Distributions	cp $(SYMROOT)/nox86exec_helper $(INSTALLDIR)/
2038*bbb1b6f9SApple OSS Distributionsendif
2039*bbb1b6f9SApple OSS Distributions
2040*bbb1b6f9SApple OSS Distributionsvm/memorystatus_rearm: excserver
2041*bbb1b6f9SApple OSS Distributionsvm/memorystatus_rearm: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
2042*bbb1b6f9SApple OSS Distributionsvm/memorystatus_rearm: CODE_SIGN_ENTITLEMENTS = vm/memorystatus_rearm.entitlements
2043*bbb1b6f9SApple OSS Distributions
2044*bbb1b6f9SApple OSS Distributionsksancov: OTHER_LDFLAGS += -framework IOKit
2045*bbb1b6f9SApple OSS Distributionsksancov: CODE_SIGN_ENTITLEMENTS = ksancov.entitlements
2046