xref: /xnu-11215/tests/Makefile (revision 4f1223e8)
1cc9a6355SApple OSS DistributionsPROJECT := xnu/darwintests
2cc9a6355SApple OSS Distributions
3*4f1223e8SApple OSS Distributionsinclude disabled.mk
4*4f1223e8SApple OSS Distributions
5cc9a6355SApple OSS Distributions# When building as part of xnu_tests, we get passed a DSTROOT that's got the
6cc9a6355SApple OSS Distributions# unit test path in it already.  But, BASEDSTROOT doesn't, so use that instead.
7cc9a6355SApple OSS Distributionsifdef BASEDSTROOT
8cc9a6355SApple OSS Distributionsoverride DSTROOT = $(BASEDSTROOT)
9cc9a6355SApple OSS Distributionsendif
10cc9a6355SApple OSS Distributions
115c2921b0SApple OSS DistributionsINVALID_ARCHS = i386 $(filter armv7%,$(ARCH_CONFIGS))
12cc9a6355SApple OSS DistributionsENABLE_LTE_TESTS=YES
13cc9a6355SApple OSS Distributions
14cc9a6355SApple OSS DistributionsOTHER_LTE_INCLUDE_FILES += \
15cc9a6355SApple OSS Distributions	/System/Library/PrivateFrameworks/LoggingSupport.framework, \
16cc9a6355SApple OSS Distributions	/System/Library/PrivateFrameworks/MobileKeyBag.framework, \
17a5e72196SApple OSS Distributions	/System/Library/Frameworks/IOSurface.framework, \
18cc9a6355SApple OSS Distributions	/usr/local/lib/libdarwintest_utils.dylib, \
19cc9a6355SApple OSS Distributions	/usr/lib/libapple_crypto.dylib,
20cc9a6355SApple OSS Distributions
21*4f1223e8SApple OSS DistributionsENV = /usr/bin/env
22*4f1223e8SApple OSS Distributions
23cc9a6355SApple OSS DistributionsDEVELOPER_DIR ?= $(shell xcode-select -p)
24cc9a6355SApple OSS Distributions
2594d3b452SApple OSS Distributions
268d741a5dSApple OSS Distributionsifeq ($(origin TIGHTBEAM_MODULE_DIR),undefined)
278d741a5dSApple OSS Distributions	export TIGHTBEAM_MODULE_DIR := $(shell /usr/bin/xcrun --show-sdk-path -sdk $(SDKROOT))/usr/local/lib/kernel/tightbeam
288d741a5dSApple OSS Distributionsendif
298d741a5dSApple OSS Distributions
308d741a5dSApple OSS DistributionsUSE_WERROR := 1
318d741a5dSApple OSS Distributionsifneq ($(BUILD_WERROR),)
328d741a5dSApple OSS DistributionsUSE_WERROR := $(BUILD_WERROR)
338d741a5dSApple OSS Distributionsendif
348d741a5dSApple OSS Distributions
358d741a5dSApple OSS Distributionsifeq ($(USE_WERROR),1)
368d741a5dSApple OSS DistributionsWERROR := -Werror
378d741a5dSApple OSS Distributionsendif
388d741a5dSApple OSS Distributions
39cc9a6355SApple OSS Distributions# the xnu build system will only ever call us with the default target
40cc9a6355SApple OSS Distributions.DEFAULT_GOAL := install
41cc9a6355SApple OSS Distributions
42cc9a6355SApple OSS Distributionsinclude $(DEVELOPER_DIR)/AppleInternal/Makefiles/darwintest/Makefile.common
43cc9a6355SApple OSS Distributions
44cc9a6355SApple OSS DistributionsOTHER_CFLAGS  = -Weverything -Wno-gnu-union-cast -Wno-missing-field-initializers -Wno-partial-availability
45cc9a6355SApple OSS DistributionsOTHER_CFLAGS += -Wno-missing-noreturn -Wno-vla -Wno-reserved-id-macro -Wno-documentation-unknown-command
46cc9a6355SApple OSS DistributionsOTHER_CFLAGS += -Wno-padded -Wno-used-but-marked-unused -Wno-covered-switch-default -Wno-nullability-extension
47a5e72196SApple OSS DistributionsOTHER_CFLAGS += -Wno-gnu-empty-initializer -Wno-unused-macros -Wno-undef -Wno-fixed-enum-extension
488d741a5dSApple OSS DistributionsOTHER_CFLAGS += -Wno-gnu-auto-type -Wno-switch-enum -Wno-variadic-macros -Wno-declaration-after-statement
498d741a5dSApple OSS DistributionsOTHER_CFLAGS += -Wno-cast-function-type-strict -Wno-gcc-compat -Wno-c2x-extensions
50cc9a6355SApple OSS DistributionsOTHER_CFLAGS += --std=gnu11 -isystem $(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
51e7776783SApple OSS DistributionsOTHER_CFLAGS += -UT_NAMESPACE_PREFIX -DT_NAMESPACE_PREFIX=xnu -DT_LEAKS_DISABLE=1
52cc9a6355SApple OSS DistributionsOTHER_CFLAGS += -F $(SDKROOT)/System/Library/PrivateFrameworks
53cc9a6355SApple OSS Distributions
54bb611c8fSApple OSS Distributions
55cc9a6355SApple OSS DistributionsCODESIGN:=$(shell xcrun -sdk "$(TARGETSDK)" -find codesign)
56bb611c8fSApple OSS DistributionsCODESIGN_HARDENED_RUNTIME:=$(CODESIGN) -o runtime
57cc9a6355SApple OSS DistributionsCODESIGN_ALLOCATE:=$(shell xcrun -sdk "$(TARGETSDK)" -find codesign_allocate)
58cc9a6355SApple OSS Distributions
598d741a5dSApple OSS DistributionsLIPO:=$(shell xcrun -sdk "$(TARGETSDK)" -find lipo)
608d741a5dSApple OSS Distributions
61e6231be0SApple OSS Distributionsifeq ($(PLATFORM),iPhoneOS)
62e6231be0SApple OSS Distributions  IOS_TEST_COMPAT = YES
63e6231be0SApple OSS Distributionselse
64e6231be0SApple OSS Distributions  IOS_TEST_COMPAT = NO
65e6231be0SApple OSS Distributionsendif
66e6231be0SApple OSS Distributions
678d741a5dSApple OSS Distributions# Generate tightbeam header for ExclavesCHelloServer from tbmodule in the SDK
688d741a5dSApple OSS Distributionsifneq ($(wildcard $(SDKROOT)/System/Library/PrivateFrameworks/Tightbeam.framework/Headers/tightbeam.h),)
698d741a5dSApple OSS DistributionsTIGHTBEAM_MODULES := \
708d741a5dSApple OSS Distributions	ExclavesCHelloServer.tbmodule
718d741a5dSApple OSS Distributions
728d741a5dSApple OSS DistributionsTIGHTBEAM_MODULE_HEADERS := $(patsubst %.tbmodule,%.tightbeam.h,$(TIGHTBEAM_MODULES))
738d741a5dSApple OSS DistributionsTIGHTBEAM_MODULE_IMPL := $(patsubst %.tbmodule,%.tightbeam.c,$(TIGHTBEAM_MODULES))
748d741a5dSApple OSS Distributions
758d741a5dSApple OSS Distributions# This makes sure to not include any tbmodules which don't exist in the SDK and
768d741a5dSApple OSS Distributions# expand the modules listed above to their full path in the SDK. The modules
778d741a5dSApple OSS Distributions# should only be needed when actually building with CONFIG_EXCLAVES
788d741a5dSApple OSS Distributions# (which can't easily be checked here).
798d741a5dSApple OSS DistributionsTIGHTBEAM_MODULES := $(patsubst %.tbmodule,$(TIGHTBEAM_MODULE_DIR)/%.tbmodule,$(TIGHTBEAM_MODULES))
808d741a5dSApple OSS DistributionsTIGHTBEAM_MODULES := $(wildcard $(TIGHTBEAM_MODULES))
818d741a5dSApple OSS DistributionsTIGHTBEAM_MODULE_IMPL_PATH := $(addprefix $(OBJROOT)/, $(TIGHTBEAM_MODULE_IMPL))
828d741a5dSApple OSS Distributions
838d741a5dSApple OSS Distributions$(TIGHTBEAM_MODULE_IMPL) : \
848d741a5dSApple OSS Distributions	%.tightbeam.c : $(TIGHTBEAM_MODULES)
858d741a5dSApple OSS Distributions	$(TIGHTBEAMC) build generate-c --output-base $(OBJROOT)/$*.tightbeam.c --codegen-version 2 $<
868d741a5dSApple OSS Distributions
878d741a5dSApple OSS Distributions$(TIGHTBEAM_MODULE_HEADERS) : $(TIGHTBEAM_MODULE_IMPL)
888d741a5dSApple OSS Distributionsendif
898d741a5dSApple OSS Distributions
905c2921b0SApple OSS Distributions# Subsystems
915c2921b0SApple OSS Distributions
925c2921b0SApple OSS Distributionsinclude ktrace/Makefile
935c2921b0SApple OSS Distributions
945c2921b0SApple OSS DistributionsINCLUDED_TEST_SOURCE_DIRS += recount
955c2921b0SApple OSS Distributionsinclude recount/Makefile
961031c584SApple OSS DistributionsINCLUDED_TEST_SOURCE_DIRS += cpu_counters
971031c584SApple OSS Distributionsinclude cpu_counters/Makefile
985c2921b0SApple OSS Distributions
995c2921b0SApple OSS Distributions# Miscellaneous Tests
100cc9a6355SApple OSS Distributions
1018d741a5dSApple OSS Distributionssignal_exit_reason: CODE_SIGN_ENTITLEMENTS = signal_exit_reason.entitlements
1028d741a5dSApple OSS Distributions
103cc9a6355SApple OSS Distributionsatm_diagnostic_flag: OTHER_CFLAGS += drop_priv.c
104cc9a6355SApple OSS Distributions
105bb611c8fSApple OSS Distributionsatm_diagnostic_flag_entitled: CODE_SIGN_ENTITLEMENTS = atm_diagnostic_flag.entitlements
106bb611c8fSApple OSS Distributionsatm_diagnostic_flag_entitled: OTHER_CFLAGS += drop_priv.c
107a5e72196SApple OSS Distributions
108bb611c8fSApple OSS Distributionsavx: INVALID_ARCHS = $(filter arm%,$(ARCH_CONFIGS))
109cc9a6355SApple OSS Distributionsavx: OTHER_CFLAGS += -mavx512f -mavx512bw -mavx512vl
110cc9a6355SApple OSS Distributionsavx: OTHER_CFLAGS += -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
111cc9a6355SApple OSS Distributionsavx: CONFIG_FLAGS := $(filter-out -O%,$(CONFIG_FLAGS))
1125c2921b0SApple OSS Distributions# Add -mno-implicit-float to prevent the compiler from touching SIMD regs
1135c2921b0SApple OSS Distributions# unexpectedly
1145c2921b0SApple OSS Distributionsavx: CONFIG_FLAGS += -mno-implicit-float
115cc9a6355SApple OSS Distributions# Disable vzeroupper insertion to work around rdar://problem/35035096
116cc9a6355SApple OSS Distributionsavx: CONFIG_FLAGS += -mllvm -x86-use-vzeroupper=0
117cc9a6355SApple OSS Distributionsifneq (osx,$(TARGET_NAME))
118cc9a6355SApple OSS DistributionsEXCLUDED_SOURCES += avx.c
119cc9a6355SApple OSS Distributionsendif
120cc9a6355SApple OSS Distributions
121bb611c8fSApple OSS DistributionsCUSTOM_TARGETS = sr_entitlement_helper
122bb611c8fSApple OSS Distributions
123bb611c8fSApple OSS Distributionssr_entitlement_helper: sr_entitlement_helper.c
124bb611c8fSApple OSS Distributions	mkdir -p $(SYMROOT)
125bb611c8fSApple OSS Distributions	$(CC) -I $(OBJROOT) $(CFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) sr_entitlement_helper.c -o $(SYMROOT)/$@
126bb611c8fSApple OSS Distributions	echo $(CODESIGN) --force --sign - --timestamp=none --entitlements sr_entitlement.entitlements $(SYMROOT)/$@; \
127bb611c8fSApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements sr_entitlement.entitlements $(SYMROOT)/$@;
128bb611c8fSApple OSS Distributions
129bb611c8fSApple OSS Distributionsinstall-sr_entitlement_helper: sr_entitlement_helper
130bb611c8fSApple OSS Distributions	mkdir -p $(INSTALLDIR)
131bb611c8fSApple OSS Distributions	cp $(SYMROOT)/sr_entitlement_helper $(INSTALLDIR)
132bb611c8fSApple OSS Distributions
133bb611c8fSApple OSS Distributionssr_entitlement: OTHER_LDFLAGS += -ldarwintest_utils
134bb611c8fSApple OSS Distributions
135e6231be0SApple OSS Distributionsrestrict_jit: CODE_SIGN_ENTITLEMENTS = restrict_jit.entitlements
136e6231be0SApple OSS Distributions
137e6231be0SApple OSS Distributionsbacktracing_tests: OTHER_LDFLAGS += -framework CoreSymbolication
138e6231be0SApple OSS Distributionsbacktracing_tests: CODE_SIGN_ENTITLEMENTS = kernel_symbolication_entitlements.plist
139cc9a6355SApple OSS Distributions
1405c2921b0SApple OSS DistributionsCUSTOM_TARGETS += corpse_backtrace2
141cc9a6355SApple OSS Distributions
1425c2921b0SApple OSS Distributionscorpse_backtrace2:
1435c2921b0SApple OSS Distributions		$(MIG) $(CFLAGS) \
1445c2921b0SApple OSS Distributions		-DMACH_EXC_SERVER_TASKIDTOKEN \
1455c2921b0SApple OSS Distributions		-DMACH_EXC_SERVER_BACKTRACE \
1465c2921b0SApple OSS Distributions		-sheader $(OBJROOT)/excserver_backtrace.h \
1475c2921b0SApple OSS Distributions		-server $(OBJROOT)/excserver_backtrace.c \
1485c2921b0SApple OSS Distributions		-header /dev/null -user /dev/null \
1495c2921b0SApple OSS Distributions		excserver_backtrace.defs
1505c2921b0SApple OSS Distributions
1515c2921b0SApple OSS Distributionsinstall-corpse_backtrace2: ;
1525c2921b0SApple OSS Distributions
1535c2921b0SApple OSS Distributionscorpse_backtrace: corpse_backtrace2 exc_helpers.c
1545c2921b0SApple OSS Distributionscorpse_backtrace: OTHER_CFLAGS += $(OBJROOT)/excserver_backtrace.c
1555c2921b0SApple OSS Distributionscorpse_backtrace: OTHER_CFLAGS += -I $(OBJROOT)
1568d741a5dSApple OSS Distributionscorpse_backtrace: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
1578d741a5dSApple OSS Distributions
1588d741a5dSApple OSS Distributions
1598d741a5dSApple OSS DistributionsOTHER_TEST_TARGETS += vm/vm_parameter_validation
1608d741a5dSApple OSS Distributions
1618d741a5dSApple OSS Distributions# vm_parameter_validation builds each arch as a separate build command
1628d741a5dSApple OSS Distributions# so we can pass architecture-specific linker flags.
1638d741a5dSApple OSS Distributions# and generate arch-specific MIG files.
1648d741a5dSApple OSS Distributions
1658d741a5dSApple OSS Distributions# libdarwintest.a doesn't have an arm64 slice on watchOS
1668d741a5dSApple OSS Distributionsifeq ($(PLATFORM),WatchOS)
1678d741a5dSApple OSS DistributionsVM_PARAMETER_VALIDATION_INVALID_ARCHS = arm64
1688d741a5dSApple OSS Distributionsvm/vm_parameter_validation: INVALID_ARCHS += arm64
1698d741a5dSApple OSS Distributionsendif
1708d741a5dSApple OSS Distributions
1718d741a5dSApple OSS DistributionsVM_PARAMETER_VALIDATION_ARCHS = $(filter-out $(VM_PARAMETER_VALIDATION_INVALID_ARCHS),$(ARCH_CONFIGS))
1728d741a5dSApple OSS Distributions
1738d741a5dSApple OSS Distributions# Some tests map-overwrite wildly at addresses near 0.
1748d741a5dSApple OSS Distributions# Use a large PAGEZERO so our executable and other data do not land there.
1758d741a5dSApple OSS Distributions# (This is 32-bit only. 64-bit uses 4GB PAGEZERO by default which is fine.)
1768d741a5dSApple OSS DistributionsVM_PARAMETER_VALIDATION_LDFLAGS_i386     = -Xlinker -pagezero_size -Xlinker 0x1000000
1778d741a5dSApple OSS DistributionsVM_PARAMETER_VALIDATION_LDFLAGS_armv7    = -Xlinker -pagezero_size -Xlinker 0x1000000
1788d741a5dSApple OSS DistributionsVM_PARAMETER_VALIDATION_LDFLAGS_armv7s   = -Xlinker -pagezero_size -Xlinker 0x1000000
1798d741a5dSApple OSS DistributionsVM_PARAMETER_VALIDATION_LDFLAGS_armv7k   = -Xlinker -pagezero_size -Xlinker 0x1000000
1808d741a5dSApple OSS DistributionsVM_PARAMETER_VALIDATION_LDFLAGS_arm64_32 = -Xlinker -pagezero_size -Xlinker 0x1000000
1818d741a5dSApple OSS Distributions
1828d741a5dSApple OSS DistributionsVM_PARAMETER_VALIDATION_SLICES=$(addprefix $(SYMROOT)/vm/vm_parameter_validation_,$(VM_PARAMETER_VALIDATION_ARCHS))
1838d741a5dSApple OSS Distributions
184*4f1223e8SApple OSS Distributionsvm/vm_parameter_validation: assets $(VM_PARAMETER_VALIDATION_SLICES)
1858d741a5dSApple OSS Distributions	$(LIPO) -create $(VM_PARAMETER_VALIDATION_SLICES) -output $(SYMROOT)/$@
1868d741a5dSApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@
1878d741a5dSApple OSS Distributions
1888d741a5dSApple OSS Distributions$(SYMROOT)/vm/vm_parameter_validation_%: ../osfmk/tests/vm_parameter_validation.h \
189*4f1223e8SApple OSS Distributions                                         $(OBJROOT)/vm_parameter_validation_%_vm32_map_user.c \
1908d741a5dSApple OSS Distributions                                         $(OBJROOT)/vm_parameter_validation_%_mach_vm_user.c \
1918d741a5dSApple OSS Distributions                                         $(OBJROOT)/vm_parameter_validation_%_replacement_mach_host.c \
1928d741a5dSApple OSS Distributions                                         $(OBJROOT)/vm_parameter_validation_%_replacement_host_priv.c \
1938d741a5dSApple OSS Distributions                                         vm/vm_parameter_validation.c
1948d741a5dSApple OSS Distributions	mkdir -p $(SYMROOT)/vm
1958d741a5dSApple OSS Distributions	$(CC) -I $(OBJROOT) \
1968d741a5dSApple OSS Distributions	    $(DT_CFLAGS) $(OTHER_CFLAGS) $(filter-out $(ARCH_FLAGS),$(CFLAGS)) -arch $* \
1978d741a5dSApple OSS Distributions	    $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $(VM_PARAMETER_VALIDATION_LDFLAGS_$*) \
198*4f1223e8SApple OSS Distributions	    -DVM32_SUPPORT=1 -DKERNEL_VM_TEST=1 \
199*4f1223e8SApple OSS Distributions	    $(OBJROOT)/vm_parameter_validation_$*_vm32_map_user.c \
2008d741a5dSApple OSS Distributions	    $(OBJROOT)/vm_parameter_validation_$*_mach_vm_user.c \
2018d741a5dSApple OSS Distributions	    $(OBJROOT)/vm_parameter_validation_$*_replacement_mach_host.c \
2028d741a5dSApple OSS Distributions	    $(OBJROOT)/vm_parameter_validation_$*_replacement_host_priv.c \
2038d741a5dSApple OSS Distributions	    vm/vm_parameter_validation.c -o $@
2048d741a5dSApple OSS Distributions
2058d741a5dSApple OSS Distributions# xnu/libsyscall/mach/mach_vm.c intercepts some VM calls from userspace,
2068d741a5dSApple OSS Distributions# sometimes doing something other than the expected MIG call.
207*4f1223e8SApple OSS Distributions# And on 64-bit platforms libsystem has no interface to reach the 32-bit entrypoints.
208*4f1223e8SApple OSS Distributions# We generate our own MIG userspace call sites to call the kernel entrypoints directly.
209*4f1223e8SApple OSS Distributions$(OBJROOT)/vm_parameter_validation_%_vm32_map_user.c: ../osfmk/mach/vm32_map.defs
2108d741a5dSApple OSS Distributions	$(MIG) $(filter-out $(ARCH_FLAGS),$(CFLAGS)) -arch $* \
211*4f1223e8SApple OSS Distributions	 -I../osfmk -novouchers -DKERNEL_USER=1 -DKOBJECT_SERVER -DKERNEL_VM_TEST=1 \
2128d741a5dSApple OSS Distributions	 -user $@ -header $(subst _$*_,_,$(@:.c=.h)) \
2138d741a5dSApple OSS Distributions	 -server /dev/null -sheader /dev/null \
2148d741a5dSApple OSS Distributions	 $<
2158d741a5dSApple OSS Distributions$(OBJROOT)/vm_parameter_validation_%_mach_vm_user.c: ../osfmk/mach/mach_vm.defs
2168d741a5dSApple OSS Distributions	$(MIG) $(filter-out $(ARCH_FLAGS),$(CFLAGS)) -arch $* \
217*4f1223e8SApple OSS Distributions	 -I../osfmk -novouchers -DKERNEL_USER=1 -DKOBJECT_SERVER -DKERNEL_VM_TEST=1 \
2188d741a5dSApple OSS Distributions	 -user $@ -header $(subst _$*_,_,$(@:.c=.h)) \
2198d741a5dSApple OSS Distributions	 -server /dev/null -sheader /dev/null \
2208d741a5dSApple OSS Distributions	 $<
2218d741a5dSApple OSS Distributions# The declaration of mach_memory_object_memory_entry is buggy on U32.
2228d741a5dSApple OSS Distributions# We compile in our own MIG user stub for it with a "replacement_" prefix.
2238d741a5dSApple OSS Distributions# rdar://117927965
2248d741a5dSApple OSS Distributions$(OBJROOT)/vm_parameter_validation_%_replacement_mach_host.c: vm/vm_parameter_validation_replacement_mach_host.defs
2258d741a5dSApple OSS Distributions	$(MIG) $(filter-out $(ARCH_FLAGS),$(CFLAGS)) -arch $* \
226*4f1223e8SApple OSS Distributions	 -I../osfmk -novouchers -DKERNEL_USER=1 -DKOBJECT_SERVER -DKERNEL_VM_TEST=1 \
2278d741a5dSApple OSS Distributions	 -user $@ -header $(subst _$*_,_,$(@:.c=.h)) \
2288d741a5dSApple OSS Distributions	 -server /dev/null -sheader /dev/null \
2298d741a5dSApple OSS Distributions	 $<
2308d741a5dSApple OSS Distributions# The declaration of vm_wire is buggy on U32.
2318d741a5dSApple OSS Distributions# We compile in our own MIG user stub for it with a "replacement_" prefix.
2328d741a5dSApple OSS Distributions# rdar://118258929
2338d741a5dSApple OSS Distributions$(OBJROOT)/vm_parameter_validation_%_replacement_host_priv.c: vm/vm_parameter_validation_replacement_host_priv.defs
2348d741a5dSApple OSS Distributions	$(MIG) $(filter-out $(ARCH_FLAGS),$(CFLAGS)) -arch $* \
235*4f1223e8SApple OSS Distributions	 -I../osfmk -novouchers -DKERNEL_USER=1 -DKOBJECT_SERVER -DKERNEL_VM_TEST=1 \
2368d741a5dSApple OSS Distributions	 -user $@ -header $(subst _$*_,_,$(@:.c=.h)) \
2378d741a5dSApple OSS Distributions	 -server /dev/null -sheader /dev/null \
2388d741a5dSApple OSS Distributions	 $<
2398d741a5dSApple OSS Distributions
2405c2921b0SApple OSS Distributions
24194d3b452SApple 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
2428d741a5dSApple OSS DistributionsCUSTOM_TARGETS += ipc/hardened_exceptions_entitled_debugger ipc/hardened_exceptions_entitled
2438d741a5dSApple OSS DistributionsCUSTOM_TARGETS += excserver_protect
2448d741a5dSApple OSS DistributionsCUSTOM_TARGETS += excserver_protect_state
245e6231be0SApple OSS Distributions
246e6231be0SApple OSS Distributionsexception_tests: excserver_protect exc_helpers.c
247e6231be0SApple OSS Distributionsexception_tests: CODE_SIGN_ENTITLEMENTS = exception_tests.entitlements
248e6231be0SApple OSS Distributionsexception_tests: OTHER_CFLAGS += $(OBJROOT)/excserver_protect.c
249e6231be0SApple OSS Distributionsexception_tests: OTHER_CFLAGS += -I $(OBJROOT)
250e6231be0SApple OSS Distributionsexception_tests: OTHER_CFLAGS += -DENTITLED=1
251e6231be0SApple OSS Distributions
2528d741a5dSApple OSS Distributionsipc/hardened_exceptions: excserver_protect_state exc_helpers.c
2538d741a5dSApple OSS Distributionsipc/hardened_exceptions: ipc/hardened_exceptions_entitled ipc/hardened_exceptions_entitled_debugger
2548d741a5dSApple OSS Distributionsipc/hardened_exceptions: OTHER_CFLAGS += $(OBJROOT)/excserver_protect_state.c -I $(OBJROOT)
2558d741a5dSApple OSS Distributions
2568d741a5dSApple OSS Distributionsipc/hardened_exceptions_entitled: excserver_protect_state
2578d741a5dSApple OSS Distributionsipc/hardened_exceptions_entitled: CODE_SIGN_ENTITLEMENTS = entitlements/only_one_exception_port.entitlement
2588d741a5dSApple OSS Distributionsipc/hardened_exceptions_entitled: OTHER_CFLAGS += -I $(OBJROOT)
2598d741a5dSApple OSS Distributionsipc/hardened_exceptions_entitled: exc_helpers.c ipc/hardened_exceptions.c
2608d741a5dSApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(OTHER_CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \
2618d741a5dSApple OSS Distributions	$(filter-out $(CUSTOM_TARGETS), $^) -o $(SYMROOT)/$@
2628d741a5dSApple OSS Distributions	$(CODESIGN) --force --sign - --entitlements $(CODE_SIGN_ENTITLEMENTS) --timestamp=none $(SYMROOT)/$@
2638d741a5dSApple OSS Distributions
2648d741a5dSApple OSS Distributionsipc/hardened_exceptions_entitled_debugger: excserver_protect_state
2658d741a5dSApple OSS Distributionsipc/hardened_exceptions_entitled_debugger: CODE_SIGN_ENTITLEMENTS = entitlements/only_one_exception_port_debugger.entitlement
2668d741a5dSApple OSS Distributionsipc/hardened_exceptions_entitled_debugger: OTHER_CFLAGS += -I $(OBJROOT)
2678d741a5dSApple OSS Distributionsipc/hardened_exceptions_entitled_debugger: exc_helpers.c ipc/hardened_exceptions.c
2688d741a5dSApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(OTHER_CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \
2698d741a5dSApple OSS Distributions	$(filter-out $(CUSTOM_TARGETS), $^) -o $(SYMROOT)/$@
2708d741a5dSApple OSS Distributions	$(CODESIGN) --force --sign -  --entitlements $(CODE_SIGN_ENTITLEMENTS) --timestamp=none $(SYMROOT)/$@
2718d741a5dSApple OSS Distributions
2728d741a5dSApple OSS Distributionsinstall-ipc/hardened_exceptions_entitled_debugger: ipc/hardened_exceptions_entitled_debugger
2738d741a5dSApple OSS Distributions	mkdir -p $(INSTALLDIR)
2748d741a5dSApple OSS Distributions	cp $(SYMROOT)/$< $(INSTALLDIR)/
2758d741a5dSApple OSS Distributions
2768d741a5dSApple OSS Distributionsinstall-ipc/hardened_exceptions_entitled: ipc/hardened_exceptions_entitled
2778d741a5dSApple OSS Distributions	mkdir -p $(INSTALLDIR)
2788d741a5dSApple OSS Distributions	cp $(SYMROOT)/$< $(INSTALLDIR)/
2798d741a5dSApple OSS Distributions
2808d741a5dSApple OSS Distributionsinstall-reply_port_defense_client: reply_port_defense_client
2818d741a5dSApple OSS Distributions	mkdir -p $(INSTALLDIR)
2828d741a5dSApple OSS Distributions	cp $(SYMROOT)/$< $(INSTALLDIR)/
2838d741a5dSApple OSS Distributions
284a5e72196SApple OSS Distributionsimmovable_send: excserver
285a5e72196SApple OSS Distributionsimmovable_send: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
286a5e72196SApple OSS Distributionsimmovable_send: OTHER_LDFLAGS += -ldarwintest_utils -lpthread -framework IOKit
287a5e72196SApple OSS Distributionsimmovable_send: immovable_send_client
2888d741a5dSApple OSS Distributionsimmovable_send: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
2891031c584SApple OSS Distributions
2901031c584SApple OSS Distributionslocks: OTHER_LDFLAGS += -ldarwintest_utils
291a5e72196SApple OSS Distributions
292e6231be0SApple OSS Distributionsimmovable_send_client: immovable_send_client.c
293e6231be0SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) immovable_send_client.c -o $(SYMROOT)/immovable_send_client
294e6231be0SApple OSS Distributions
295e6231be0SApple OSS Distributionsinstall-immovable_send_client: immovable_send_client
296e6231be0SApple OSS Distributions	mkdir -p $(INSTALLDIR)
297e6231be0SApple OSS Distributions	cp $(SYMROOT)/immovable_send_client $(INSTALLDIR)/
298e6231be0SApple OSS Distributions
2998d741a5dSApple OSS Distributionsipc/sys_perf_notify_test: excserver_protect_state
3008d741a5dSApple OSS Distributionsipc/sys_perf_notify_test: OTHER_CFLAGS += $(OBJROOT)/excserver_protect_state.c -I $(OBJROOT)
3018d741a5dSApple OSS Distributionsipc/sys_perf_notify_test: CODE_SIGN_ENTITLEMENTS=entitlements/sys_perf_notify_test.entitlements
3028d741a5dSApple OSS Distributions
3031031c584SApple OSS Distributions
3045c2921b0SApple OSS Distributionsposix_spawnattr_set_crash_behavior_np: posix_spawnattr_set_crash_behavior_np_child
3055c2921b0SApple OSS Distributionsposix_spawnattr_set_crash_behavior_np: CODE_SIGN_ENTITLEMENTS = posix_spawnattr_set_crash_behavior_np_entitlements.plist
3065c2921b0SApple OSS Distributions
3075c2921b0SApple OSS Distributionsposix_spawnattr_set_crash_behavior_np_child: posix_spawnattr_set_crash_behavior_np_child.c
3085c2921b0SApple 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
3095c2921b0SApple OSS Distributions	$(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@
3105c2921b0SApple OSS Distributions
3115c2921b0SApple OSS Distributionsinstall-posix_spawnattr_set_crash_behavior_np_child: posix_spawnattr_set_crash_behavior_np_child
3125c2921b0SApple OSS Distributions	mkdir -p $(INSTALLDIR)
3135c2921b0SApple OSS Distributions	cp $(SYMROOT)/posix_spawnattr_set_crash_behavior_np_child $(INSTALLDIR)/
3145c2921b0SApple OSS Distributions
3155c2921b0SApple OSS Distributionsposix_spawnattr_set_launch_type_np: posix_spawnattr_set_launch_type_test
3165c2921b0SApple OSS Distributionsposix_spawnattr_set_launch_type_np: OTHER_CFLAGS += -isystem $(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
3175c2921b0SApple OSS Distributions
3185c2921b0SApple OSS Distributionsposix_spawn_launch_type: CODE_SIGN_ENTITLEMENTS = posix_spawn_launch_type-entitlements.plist
3195c2921b0SApple OSS Distributions
320e6231be0SApple OSS Distributionsport_exhaustion: OTHER_LDFLAGS += -ldarwintest_utils -lpthread
321e6231be0SApple OSS Distributionsport_exhaustion: port_exhaustion_client
322e6231be0SApple OSS Distributions
323e6231be0SApple OSS Distributionsport_exhaustion_client: port_exhaustion_client.c
324e6231be0SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) port_exhaustion_client.c -o $(SYMROOT)/port_exhaustion_client
325e6231be0SApple OSS Distributions
326e6231be0SApple OSS Distributionsinstall-port_exhaustion_client: port_exhaustion_client
327e6231be0SApple OSS Distributions	mkdir -p $(INSTALLDIR)
328e6231be0SApple OSS Distributions	cp $(SYMROOT)/port_exhaustion_client $(INSTALLDIR)/
329e6231be0SApple OSS Distributions
330e6231be0SApple OSS Distributionsport_table_limits: rnserver
331e6231be0SApple OSS Distributionsport_table_limits: CODE_SIGN_ENTITLEMENTS = task_for_pid_entitlement.plist
332e6231be0SApple OSS Distributionsport_table_limits: OTHER_CFLAGS += $(OBJROOT)/rnServer.c -I $(OBJROOT)
333e6231be0SApple OSS Distributionsport_table_limits: OTHER_LDFLAGS += -ldarwintest_utils -lpthread
334e6231be0SApple OSS Distributionsport_table_limits: port_table_limits_client
335e6231be0SApple OSS Distributions
336e6231be0SApple OSS Distributionsport_table_limits_client: port_table_limits_client.c
337e6231be0SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) port_table_limits_client.c -o $(SYMROOT)/port_table_limits_client
338e6231be0SApple OSS Distributions	$(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@
339e6231be0SApple OSS Distributions
340e6231be0SApple OSS Distributionsinstall-port_table_limits_client: port_table_limits_client
341e6231be0SApple OSS Distributions	mkdir -p $(INSTALLDIR)
342e6231be0SApple OSS Distributions	cp $(SYMROOT)/port_table_limits_client $(INSTALLDIR)/
343e6231be0SApple OSS Distributions
34494d3b452SApple OSS DistributionsCUSTOM_TARGETS += kqwl_rnserver
34594d3b452SApple OSS Distributions
34694d3b452SApple OSS Distributionskqwl_rnserver:
34794d3b452SApple OSS Distributions	$(MIG) $(CFLAGS) \
34894d3b452SApple OSS Distributions		-DKQWORKLOOPS_VIOLATION_SUPPORTED \
34994d3b452SApple OSS Distributions		-user /dev/null \
35094d3b452SApple OSS Distributions		-header $(OBJROOT)/kqwl_rn.h \
35194d3b452SApple OSS Distributions		-sheader $(OBJROOT)/kqwl_rnServer.h \
35294d3b452SApple OSS Distributions		-server $(OBJROOT)/kqwl_rnServer.c \
35394d3b452SApple OSS Distributions		rnserver.defs
35494d3b452SApple OSS Distributionsinstall-kqwl_rnserver: ;
35594d3b452SApple OSS Distributions
35694d3b452SApple OSS Distributionskqworkloop_limits: kqwl_rnserver
35794d3b452SApple OSS Distributionskqworkloop_limits: OTHER_CFLAGS += $(OBJROOT)/kqwl_rnServer.c -I $(OBJROOT)
35894d3b452SApple OSS Distributionskqworkloop_limits: OTHER_LDFLAGS += -ldarwintest_utils -lpthread
35994d3b452SApple OSS Distributionskqworkloop_limits: kqworkloop_limits_client
36094d3b452SApple OSS Distributions
36194d3b452SApple OSS Distributionskqworkloop_limits_client: kqworkloop_limits_client.c
36294d3b452SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) kqworkloop_limits_client.c -o $(SYMROOT)/kqworkloop_limits_client
36394d3b452SApple OSS Distributions	$(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@
36494d3b452SApple OSS Distributions
36594d3b452SApple OSS Distributionsinstall-kqworkloop_limits_client: kqworkloop_limits_client
36694d3b452SApple OSS Distributions	mkdir -p $(INSTALLDIR)
36794d3b452SApple OSS Distributions	cp $(SYMROOT)/kqworkloop_limits_client $(INSTALLDIR)/
36894d3b452SApple OSS Distributions
369aca3beaaSApple OSS Distributionsipc/task_name_for_pid: CODE_SIGN_ENTITLEMENTS = ipc/task_name_for_pid_entitlement.plist
370aca3beaaSApple OSS Distributions
371e6231be0SApple OSS Distributionsfd_table_limits: rnserver
372e6231be0SApple OSS Distributionsfd_table_limits: OTHER_CFLAGS += $(OBJROOT)/rnServer.c -I $(OBJROOT)
373e6231be0SApple OSS Distributionsfd_table_limits: OTHER_LDFLAGS += -ldarwintest_utils -lpthread
374e6231be0SApple OSS Distributionsfd_table_limits: fd_table_limits_client
375e6231be0SApple OSS Distributions
376e6231be0SApple OSS Distributionsfd_table_limits_client: fd_table_limits_client.c
377e6231be0SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) fd_table_limits_client.c -o $(SYMROOT)/fd_table_limits_client
378e6231be0SApple OSS Distributions	$(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@
379e6231be0SApple OSS Distributions
380e6231be0SApple OSS Distributionsinstall-fd_table_limits_client: fd_table_limits_client
381e6231be0SApple OSS Distributions	mkdir -p $(INSTALLDIR)
382e6231be0SApple OSS Distributions	cp $(SYMROOT)/fd_table_limits_client $(INSTALLDIR)/
383e6231be0SApple OSS Distributions
384bb611c8fSApple OSS Distributionsvm_spawn_tool: INVALID_ARCHS = i386
385bb611c8fSApple OSS Distributionsvm_spawn_tool: vm_spawn_tool.c
386bb611c8fSApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) vm_spawn_tool.c -o $(SYMROOT)/vm_spawn_tool
387bb611c8fSApple OSS Distributions
388bb611c8fSApple OSS Distributionsinstall-vm_spawn_tool: vm_spawn_tool
389bb611c8fSApple OSS Distributions	mkdir -p $(INSTALLDIR)/tools
390bb611c8fSApple OSS Distributions	cp $(SYMROOT)/vm_spawn_tool $(INSTALLDIR)/tools/
391bb611c8fSApple OSS Distributions
392e6231be0SApple OSS DistributionsCUSTOM_TARGETS += imm_pinned_control_port_crasher
39394d3b452SApple OSS DistributionsCUSTOM_TARGETS += imm_pinned_control_port_crasher_3P_hardened
394a5e72196SApple OSS Distributions
39594d3b452SApple OSS Distributionsimm_pinned_control_port: excserver_protect
396e6231be0SApple OSS Distributionsimm_pinned_control_port: CODE_SIGN_ENTITLEMENTS = task_for_pid_entitlement.plist
39794d3b452SApple OSS Distributionsimm_pinned_control_port: OTHER_CFLAGS += $(OBJROOT)/excserver_protect.c -I $(OBJROOT)
398e6231be0SApple OSS Distributionsimm_pinned_control_port: OTHER_LDFLAGS += -ldarwintest_utils -lpthread
39994d3b452SApple OSS Distributionsimm_pinned_control_port: imm_pinned_control_port_crasher imm_pinned_control_port_crasher_3P_hardened
400e6231be0SApple OSS Distributions
40194d3b452SApple OSS Distributionsimm_pinned_control_port_crasher: imm_pinned_control_port_crasher.c cs_helpers.c
4025c2921b0SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \
40394d3b452SApple OSS Distributions	$^ -o $(SYMROOT)/$@
404e6231be0SApple OSS Distributions	$(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@
405e6231be0SApple OSS Distributions
40694d3b452SApple OSS Distributionsimm_pinned_control_port_crasher_3P_hardened: CODE_SIGN_ENTITLEMENTS = entitlements/hardened-binary-entitlements-1.plist
40794d3b452SApple OSS Distributionsimm_pinned_control_port_crasher_3P_hardened: imm_pinned_control_port_crasher.c cs_helpers.c
40894d3b452SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \
40994d3b452SApple OSS Distributions	$^ -o $(SYMROOT)/$@
41094d3b452SApple OSS Distributions	$(CODESIGN) --force --sign - --entitlements $(CODE_SIGN_ENTITLEMENTS) --timestamp=none $(SYMROOT)/$@
41194d3b452SApple OSS Distributions
412e6231be0SApple OSS Distributionsinstall-imm_pinned_control_port_crasher: imm_pinned_control_port_crasher
413a5e72196SApple OSS Distributions	mkdir -p $(INSTALLDIR)
41494d3b452SApple OSS Distributions	cp $(SYMROOT)/$^ $(INSTALLDIR)/
41594d3b452SApple OSS Distributions
41694d3b452SApple OSS Distributionsinstall-imm_pinned_control_port_crasher_3P_hardened: imm_pinned_control_port_crasher_3P_hardened
41794d3b452SApple OSS Distributions	mkdir -p $(INSTALLDIR)
41894d3b452SApple OSS Distributions	cp $(SYMROOT)/$^ $(INSTALLDIR)/
419bb611c8fSApple OSS Distributions
4205c2921b0SApple OSS DistributionsCUSTOM_TARGETS += reply_port_defense_client
42194d3b452SApple OSS DistributionsCUSTOM_TARGETS += reply_port_defense_client_3P_hardened
4225c2921b0SApple OSS Distributions
4238d741a5dSApple OSS Distributionsreply_port_defense: excserver_protect_state
4248d741a5dSApple OSS Distributionsreply_port_defense: OTHER_CFLAGS += $(OBJROOT)/excserver_protect_state.c -I $(OBJROOT)
4255c2921b0SApple OSS Distributionsreply_port_defense: OTHER_LDFLAGS += -ldarwintest_utils -lpthread
4268d741a5dSApple OSS Distributionsreply_port_defense: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
42794d3b452SApple OSS Distributionsreply_port_defense: reply_port_defense_client reply_port_defense_client_3P_hardened
4285c2921b0SApple OSS Distributions
42994d3b452SApple OSS Distributionsreply_port_defense_client: reply_port_defense_client.c cs_helpers.c
4305c2921b0SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \
43194d3b452SApple OSS Distributions	$^ -o $(SYMROOT)/$@
4325c2921b0SApple OSS Distributions	$(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@
4335c2921b0SApple OSS Distributions
43494d3b452SApple OSS Distributionsreply_port_defense_client_3P_hardened: CODE_SIGN_ENTITLEMENTS=entitlements/hardened-binary-entitlements-1.plist
43594d3b452SApple OSS Distributionsreply_port_defense_client_3P_hardened: reply_port_defense_client.c cs_helpers.c
43694d3b452SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \
43794d3b452SApple OSS Distributions	$^ -o $(SYMROOT)/$@
43894d3b452SApple OSS Distributions	$(CODESIGN) --force --sign - --entitlements $(CODE_SIGN_ENTITLEMENTS) --timestamp=none $(SYMROOT)/$@
43994d3b452SApple OSS Distributions
4405c2921b0SApple OSS Distributionsinstall-reply_port_defense_client: reply_port_defense_client
4415c2921b0SApple OSS Distributions	mkdir -p $(INSTALLDIR)
44294d3b452SApple OSS Distributions	cp $(SYMROOT)/$< $(INSTALLDIR)/
44394d3b452SApple OSS Distributions
44494d3b452SApple OSS Distributionsinstall-reply_port_defense_client_3P_hardened: reply_port_defense_client_3P_hardened
44594d3b452SApple OSS Distributions	mkdir -p $(INSTALLDIR)
44694d3b452SApple OSS Distributions	cp $(SYMROOT)/$< $(INSTALLDIR)/
4475c2921b0SApple OSS Distributions
448bb611c8fSApple OSS Distributionskas_info: OTHER_LDFLAGS += -framework CoreSymbolication
449bb611c8fSApple OSS Distributionskas_info: CODE_SIGN_ENTITLEMENTS = kernel_symbolication_entitlements.plist
450bb611c8fSApple OSS Distributions
4518d741a5dSApple OSS Distributionsnet_bounds_safety: OTHER_CFLAGS += -fbounds-safety
4528d741a5dSApple OSS Distributions
4538d741a5dSApple OSS Distributionsnet_no_bounds_safety: OTHER_CFLAGS += -fno-bounds-safety
4548d741a5dSApple OSS Distributionsnet_no_bounds_safety: net_bounds_safety.c
4558d741a5dSApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
4568d741a5dSApple OSS DistributionsOTHER_TEST_TARGETS += net_no_bounds_safety
4578d741a5dSApple OSS Distributions
45894d3b452SApple OSS Distributionshost_statistics_rate_limiting: cs_helpers.c host_statistics_rate_limiting.c
45994d3b452SApple OSS Distributions
46094d3b452SApple 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
461e6231be0SApple OSS Distributions
462e6231be0SApple OSS Distributionsifneq ($(IOS_TEST_COMPAT),YES)
46394d3b452SApple OSS DistributionsEXCLUDED_SOURCES += jumbo_va_spaces_28530648.c perf_compressor.c vm/entitlement_increased_memory_limit.c vm/ios13extended_footprint.c vm/entitlement_internal_bands.c
464cc9a6355SApple OSS Distributionsendif
465cc9a6355SApple OSS Distributions
466cc9a6355SApple OSS Distributionsperf_compressor: OTHER_LDFLAGS += -ldarwintest_utils
467cc9a6355SApple OSS Distributionsperf_compressor: CODE_SIGN_ENTITLEMENTS=./private_entitlement.plist
468cc9a6355SApple OSS Distributions
469bb611c8fSApple OSS Distributions
4705c2921b0SApple OSS Distributionsvm/memorystatus_freeze_test: CODE_SIGN_ENTITLEMENTS=./task_for_pid_entitlement.plist
4715c2921b0SApple OSS Distributionsvm/memorystatus_freeze_test: OTHER_LDFLAGS += -ldarwintest_utils
4725c2921b0SApple OSS Distributionsvm/memorystatus_freeze_test: memorystatus_assertion_helpers.c test_utils.c vm/memorystatus_freeze_test.c
4735c2921b0SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
4745c2921b0SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements $(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@;
4755c2921b0SApple OSS Distributions
4765c2921b0SApple OSS Distributionsvm/memorystatus_freeze_test_entitled: CODE_SIGN_ENTITLEMENTS=./vm/memorystatus_freeze_test_entitled.plist
4775c2921b0SApple OSS Distributionsvm/memorystatus_freeze_test_entitled: OTHER_LDFLAGS += -ldarwintest_utils
4785c2921b0SApple OSS Distributionsvm/memorystatus_freeze_test_entitled: test_utils.c vm/memorystatus_freeze_test_entitled.c
4795c2921b0SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
4805c2921b0SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements $(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@;
481cc9a6355SApple OSS Distributions
4828d741a5dSApple OSS Distributionsvm/memorystatus_jetsam_zprint_snapshot: CODE_SIGN_ENTITLEMENTS=./vm/memorystatus_jetsam_zprint_snapshot.entitlements
4838d741a5dSApple OSS Distributionsvm/memorystatus_jetsam_zprint_snapshot: OTHER_LDFLAGS += -ldarwintest_utils
4848d741a5dSApple OSS Distributions
4858d741a5dSApple OSS Distributionsvm/neural_footprint: CODE_SIGN_ENTITLEMENTS=./vm/neural_footprint.entitlement
4868d741a5dSApple OSS Distributionsvm/neural_footprint: OTHER_CFLAGS += -I $(OBJROOT)
4878d741a5dSApple OSS Distributionsvm/neural_footprint: OTHER_LDFLAGS += -ldarwintest_utils
4888d741a5dSApple OSS Distributionsvm/neural_footprint: test_utils.c vm/neural_footprint.c ./vm/neural_footprint.entitlement
4898d741a5dSApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
4908d741a5dSApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements $(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@;
4918d741a5dSApple OSS Distributions
492a5e72196SApple OSS Distributionsmemorystatus_is_assertion: OTHER_LDFLAGS += -ldarwintest_utils
493a5e72196SApple OSS Distributionsmemorystatus_is_assertion: OTHER_CFLAGS += memorystatus_assertion_helpers.c
494cc9a6355SApple OSS Distributions
495e6231be0SApple OSS Distributionsmemorystatus_vm_map_fork: OTHER_CFLAGS += test_utils.c
4965c2921b0SApple OSS Distributionsmemorystatus_vm_map_fork: OTHER_LDFLAGS += -ldarwintest_utils
497e6231be0SApple OSS Distributions
498a5e72196SApple OSS Distributionsshared_cache_tests: OTHER_LDFLAGS += -ldarwintest_utils
499a5e72196SApple OSS Distributions
5008d741a5dSApple OSS Distributionsifneq ($(wildcard $(SDKROOT)/System/Library/PrivateFrameworks/Tightbeam.framework/Headers/tightbeam.h),)
5018d741a5dSApple OSS Distributionsstackshot_tests: OTHER_LDFLAGS += -framework Tightbeam
5028d741a5dSApple OSS Distributionsstackshot_tests: OTHER_CFLAGS += -I$(OBJROOT)
5038d741a5dSApple OSS Distributionsstackshot_tests: OTHER_CFLAGS += $(TIGHTBEAM_MODULE_IMPL_PATH)
5048d741a5dSApple OSS Distributionsstackshot_tests.m: $(TIGHTBEAM_MODULE_HEADERS)
5058d741a5dSApple OSS Distributionsendif
50694d3b452SApple OSS Distributionsstackshot_tests: ./stackshot-entitlements.plist stackshot_tests.m
5075c2921b0SApple OSS Distributionsstackshot_tests: CODE_SIGN_ENTITLEMENTS=./stackshot-entitlements.plist
5088d741a5dSApple OSS Distributionsstackshot_tests: OTHER_CFLAGS += -Wno-objc-messaging-id test_utils.c
5095c2921b0SApple OSS Distributionsstackshot_tests: OTHER_LDFLAGS += -lkdd -lz -ldarwintest_utils -framework Foundation -framework IOKit
510a5e72196SApple OSS Distributions
5115c2921b0SApple OSS Distributionsstackshot_accuracy: ./stackshot-entitlements.plist
5125c2921b0SApple OSS Distributionsstackshot_accuracy: CODE_SIGN_ENTITLEMENTS=./stackshot-entitlements.plist
513bb611c8fSApple OSS Distributionsstackshot_accuracy: OTHER_CFLAGS += -ldarwintest_utils -Wno-objc-messaging-id
514bb611c8fSApple OSS Distributionsstackshot_accuracy: OTHER_LDFLAGS += -lkdd -ldarwintest_utils -framework Foundation
515bb611c8fSApple OSS Distributionsstackshot_accuracy: INVALID_ARCHS = i386
516cc9a6355SApple OSS Distributions
5175c2921b0SApple OSS Distributionsstackshot_spawn_exit_stress: ./stackshot-entitlements.plist
5185c2921b0SApple OSS Distributionsstackshot_spawn_exit_stress: CODE_SIGN_ENTITLEMENTS=./stackshot-entitlements.plist
5195c2921b0SApple OSS Distributions
520bb611c8fSApple OSS Distributionsifeq ($(PLATFORM),MacOSX)
521bb611c8fSApple OSS DistributionsCUSTOM_TARGETS += stackshot_translated_child
522bb611c8fSApple OSS Distributions
523bb611c8fSApple OSS Distributionsstackshot_translated_child: INVALID_ARCHS = arm64 arm64e
524bb611c8fSApple OSS Distributionsstackshot_translated_child: stackshot_translated_child.c
525bb611c8fSApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) stackshot_translated_child.c -o $(SYMROOT)/stackshot_translated_child
526bb611c8fSApple OSS Distributions
527bb611c8fSApple OSS Distributionsinstall-stackshot_translated_child: stackshot_translated_child
528bb611c8fSApple OSS Distributions	mkdir -p $(INSTALLDIR)
529bb611c8fSApple OSS Distributions	cp $(SYMROOT)/stackshot_translated_child $(INSTALLDIR)/
530bb611c8fSApple OSS Distributionselse
531bb611c8fSApple OSS DistributionsEXCLUDED_SOURCES += stackshot_translated_child.c
532bb611c8fSApple OSS Distributionsendif
533bb611c8fSApple OSS Distributions
5345c2921b0SApple OSS Distributionsmicrostackshot_tests: ./stackshot-entitlements.plist
5355c2921b0SApple OSS Distributionsmicrostackshot_tests: CODE_SIGN_ENTITLEMENTS=./stackshot-entitlements.plist
536e7776783SApple OSS Distributionsmicrostackshot_tests: OTHER_LDFLAGS = -ldarwintest_utils -framework ktrace -framework kperf -framework CoreFoundation
537bb611c8fSApple OSS Distributions
5385c2921b0SApple OSS Distributionsmemorystatus_zone_test: ./stackshot-entitlements.plist
5395c2921b0SApple OSS Distributionsmemorystatus_zone_test: CODE_SIGN_ENTITLEMENTS=./stackshot-entitlements.plist
540cc9a6355SApple OSS Distributionsmemorystatus_zone_test: OTHER_CFLAGS += -isystem $(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
541cc9a6355SApple OSS Distributionsmemorystatus_zone_test: OTHER_LDFLAGS += -framework ktrace
542cc9a6355SApple OSS Distributionsmemorystatus_zone_test: OTHER_LDFLAGS += -ldarwintest_utils
543cc9a6355SApple OSS Distributions
544bb611c8fSApple OSS Distributionsmemcmp_zero: OTHER_CFLAGS += ../osfmk/arm64/memcmp_zero.s
545bb611c8fSApple OSS Distributions
546e6231be0SApple OSS Distributionstext_corruption: OTHER_LDFLAGS += -ldarwintest_utils
547e6231be0SApple OSS DistributionsCUSTOM_TARGETS += text_corruption_helper
548e6231be0SApple OSS Distributions
549e6231be0SApple OSS Distributionstext_corruption_helper:
550e6231be0SApple OSS Distributions	$(CC) $(LDFLAGS) $(CFLAGS) text_corruption_helper.c -lm -o $(SYMROOT)/$@;
551e6231be0SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
552e6231be0SApple OSS Distributions
553e6231be0SApple OSS Distributionsinstall-text_corruption_helper: text_corruption_helper
554e6231be0SApple OSS Distributions	mkdir -p $(INSTALLDIR)
555e6231be0SApple OSS Distributions	cp $(SYMROOT)/text_corruption_helper $(INSTALLDIR)/
556cc9a6355SApple OSS Distributions
557e7776783SApple OSS Distributionscodesigntests: CODE_SIGN_ENTITLEMENTS=codesigntests-entitlements.plist
558e7776783SApple OSS Distributionscodesigntests: OTHER_CFLAGS += -DTESTNAME=codesigntests
559e7776783SApple OSS Distributions# Adding a custom target and build/install rules since CODE_SIGN_ENTITLEMENTS
560e7776783SApple OSS Distributions# does not take in arguments, and we need to sign this test using a sha256T
561e7776783SApple OSS Distributions# digest
562e7776783SApple OSS Distributions
563e7776783SApple OSS DistributionsOTHER_TEST_TARGETS += codesigntests_sha256t
564e7776783SApple OSS Distributionscodesigntests_sha256t: OTHER_CFLAGS += -DTESTNAME=codesigntests_sha256t
565e7776783SApple OSS Distributions
566e7776783SApple OSS Distributionscodesigntests_sha256t: codesigntests.c
567e7776783SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(DT_LDFLAGS) $(LDFLAGS) $(CFLAGS) codesigntests.c -o $(SYMROOT)/$@;
568e7776783SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --digest=sha256T -s - --entitlements codesigntests-entitlements.plist $(SYMROOT)/$@;
569e7776783SApple OSS Distributionsinstall-codesigntests_sha256t: codesigntests_sha256t
570e7776783SApple OSS Distributions	mkdir -p $(INSTALLDIR)
571e7776783SApple OSS Distributions	cp $(SYMROOT)/codesigntests_sha256t $(INSTALLDIR)/
572e7776783SApple OSS Distributions
573e7776783SApple OSS Distributions
5745c2921b0SApple OSS Distributionsecc_test: OTHER_LDFLAGS += -ldarwintest_utils
5755c2921b0SApple OSS DistributionsCUSTOM_TARGETS += ecc_test_helper
5765c2921b0SApple OSS Distributions
5775c2921b0SApple OSS Distributionsecc_test_helper:
5785c2921b0SApple OSS Distributions	$(CC) $(LDFLAGS) $(CFLAGS) ecc_test_helper.c -lm -o $(SYMROOT)/$@;
5795c2921b0SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
5805c2921b0SApple OSS Distributions
5815c2921b0SApple OSS Distributionsinstall-ecc_test_helper: ecc_test_helper
5825c2921b0SApple OSS Distributions	mkdir -p $(INSTALLDIR)
5835c2921b0SApple OSS Distributions	cp $(SYMROOT)/ecc_test_helper $(INSTALLDIR)/
584e7776783SApple OSS Distributions
58594d3b452SApple OSS Distributionsvm/test_vm_no_pager: excserver
58694d3b452SApple OSS Distributionsvm/test_vm_no_pager: OTHER_LDFLAGS += -ldarwintest_utils -lpthread -lkdd -framework Foundation
58794d3b452SApple OSS Distributionsvm/test_vm_no_pager: OTHER_CFLAGS += -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders $(OBJROOT)/excserver.c -I$(OBJROOT)
5888d741a5dSApple OSS Distributionsvm/test_vm_no_pager: vm/test_vm_no_pager_helper
5898d741a5dSApple OSS Distributionsvm/test_vm_no_pager: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
59094d3b452SApple OSS DistributionsCUSTOM_TARGETS += vm/test_vm_no_pager_helper
59194d3b452SApple OSS Distributions
59294d3b452SApple OSS Distributionsvm/test_vm_no_pager_helper: vm/test_vm_no_pager_helper.c
59394d3b452SApple OSS Distributions	$(CC) $(CFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -lm -o $(SYMROOT)/$@;
59494d3b452SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
59594d3b452SApple OSS Distributions
59694d3b452SApple OSS Distributionsinstall-vm/test_vm_no_pager_helper: vm/test_vm_no_pager_helper
59794d3b452SApple OSS Distributions	mkdir -p $(INSTALLDIR)/vm
59894d3b452SApple OSS Distributions	cp $(SYMROOT)/vm/test_vm_no_pager_helper $(INSTALLDIR)/vm/
59994d3b452SApple OSS Distributions
60094d3b452SApple OSS Distributions
601cc9a6355SApple OSS Distributionskevent_qos: OTHER_CFLAGS += -Wno-unused-macros
602cc9a6355SApple OSS Distributionskevent_qos: OTHER_CFLAGS += -I $(OBJROOT)/
603cc9a6355SApple OSS Distributions
6045c2921b0SApple OSS Distributionstest_knote_use_after_free: OTHER_CFLAGS += -Wno-unused-macros
6055c2921b0SApple OSS Distributionstest_knote_use_after_free: OTHER_LDFLAGS += -ldarwintest_utils -lpthread
6065c2921b0SApple OSS Distributions
607cc9a6355SApple OSS Distributionsmach_get_times: OTHER_LDFLAGS += -ldarwintest_utils
608cc9a6355SApple OSS Distributions
6095c2921b0SApple OSS Distributionsmonotonic_core: ./stackshot-entitlements.plist
6105c2921b0SApple OSS Distributionsmonotonic_core: CODE_SIGN_ENTITLEMENTS=./stackshot-entitlements.plist
611cc9a6355SApple OSS Distributionsmonotonic_core: OTHER_LDFLAGS += -framework ktrace
612cc9a6355SApple OSS Distributions
613cc9a6355SApple OSS Distributionsperf_exit: perf_exit_proc
6145c2921b0SApple OSS Distributionsperf_exit: ./stackshot-entitlements.plist
6155c2921b0SApple OSS Distributionsperf_exit: CODE_SIGN_ENTITLEMENTS=./stackshot-entitlements.plist
616a5e72196SApple OSS Distributionsperf_exit: OTHER_LDFLAGS = -framework ktrace -ldarwintest_utils
617cc9a6355SApple OSS Distributionsperf_exit: CODE_SIGN_ENTITLEMENTS=./private_entitlement.plist
618cc9a6355SApple OSS Distributions
619aca3beaaSApple OSS Distributionsipc/mach_exc_port_substitute: excserver
620aca3beaaSApple OSS Distributionsipc/mach_exc_port_substitute: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
6211031c584SApple OSS Distributionsipc/mach_exc_port_substitute: CODE_SIGN_ENTITLEMENTS = ipc/mach_exc_port_substitute.plist
622aca3beaaSApple OSS Distributions
623a5e72196SApple OSS DistributionsCUSTOM_TARGETS += prioritize_process_launch_helper
624a5e72196SApple OSS Distributionsprioritize_process_launch: prioritize_process_launch_helper
625a5e72196SApple OSS Distributions
626a5e72196SApple OSS Distributionsprioritize_process_launch_helper: prioritize_process_launch_helper.c
627a5e72196SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) prioritize_process_launch_helper.c -o $(SYMROOT)/prioritize_process_launch_helper
628a5e72196SApple OSS Distributions	echo $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@; \
629a5e72196SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
630a5e72196SApple OSS Distributions
631a5e72196SApple OSS Distributionsinstall-prioritize_process_launch_helper: prioritize_process_launch_helper
632a5e72196SApple OSS Distributions	mkdir -p $(INSTALLDIR)
633a5e72196SApple OSS Distributions	cp $(SYMROOT)/prioritize_process_launch_helper $(INSTALLDIR)/
634a5e72196SApple OSS Distributions
635a5e72196SApple OSS Distributions
636cc9a6355SApple OSS Distributionsperf_spawn_fork: CODE_SIGN_ENTITLEMENTS=./private_entitlement.plist
637cc9a6355SApple OSS Distributions
638a5e72196SApple OSS Distributionsmach_exception_reply: OTHER_CFLAGS += -Wno-cast-align
6398d741a5dSApple OSS Distributionsmach_exception_reply: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
640a5e72196SApple OSS Distributions
641cc9a6355SApple OSS Distributionsos_thread_self_restrict: os_thread_self_restrict.c os_thread_self_restrict-entitlements.plist
642cc9a6355SApple OSS Distributionsos_thread_self_restrict: CODE_SIGN_ENTITLEMENTS=os_thread_self_restrict-entitlements.plist
643e6231be0SApple OSS Distributionsos_thread_self_restrict: OTHER_LDFLAGS += -sectcreate __TEXT __info_plist os_thread_self_restrict-identifier.plist
644cc9a6355SApple OSS Distributions
64594d3b452SApple OSS Distributions# Temporarily disabled.  See rdar://121952316
64694d3b452SApple OSS DistributionsEXCLUDED_SOURCES += os_thread_self_restrict.c
64794d3b452SApple OSS Distributions
648bb611c8fSApple OSS Distributionssubsystem_root_path: subsystem_root_path.c subsystem_root_path-entitlements.plist
649bb611c8fSApple OSS Distributionssubsystem_root_path: CODE_SIGN_ENTITLEMENTS=subsystem_root_path-entitlements.plist
650a5e72196SApple OSS Distributions
651bb611c8fSApple OSS DistributionsEXCLUDED_SOURCES += $(wildcard bounded_ptr_src/*.cpp)
652bb611c8fSApple OSS Distributionsbounded_ptr: OTHER_CXXFLAGS += -Werror=implicit-int-conversion -Werror=shorten-64-to-32 -I$(SRCROOT)/../libkern -std=c++17
653bb611c8fSApple OSS Distributionsbounded_ptr: $(wildcard bounded_ptr_src/*.cpp) bounded_ptr.cpp
654a5e72196SApple OSS Distributions
655bb611c8fSApple OSS DistributionsEXCLUDED_SOURCES += bounded_ptr_03.cpp
656aca3beaaSApple OSS Distributionsbounded_ptr_03: OTHER_CXXFLAGS += -Werror=implicit-int-conversion -Werror=shorten-64-to-32 -I$(SRCROOT)/../libkern -std=c++03 $(DT_LDFLAGS)
657bb611c8fSApple OSS Distributionsbounded_ptr_03: bounded_ptr_03.cpp
658bb611c8fSApple OSS Distributions
659bb611c8fSApple OSS DistributionsEXCLUDED_SOURCES += $(wildcard bounded_array_src/*.cpp)
660bb611c8fSApple OSS Distributionsbounded_array: OTHER_CXXFLAGS += -Werror=implicit-int-conversion -Werror=shorten-64-to-32 -I$(SRCROOT)/../libkern -std=c++17
661bb611c8fSApple OSS Distributionsbounded_array: $(wildcard bounded_array_src/*.cpp) bounded_array.cpp
662bb611c8fSApple OSS Distributions
663bb611c8fSApple OSS DistributionsEXCLUDED_SOURCES += $(wildcard bounded_array_ref_src/*.cpp)
664bb611c8fSApple OSS Distributionsbounded_array_ref: OTHER_CXXFLAGS += -Werror=implicit-int-conversion -Werror=shorten-64-to-32 -I$(SRCROOT)/../libkern -std=c++17
665bb611c8fSApple OSS Distributionsbounded_array_ref: $(wildcard bounded_array_ref_src/*.cpp) bounded_array_ref.cpp
666bb611c8fSApple OSS Distributions
667bb611c8fSApple OSS DistributionsEXCLUDED_SOURCES += $(wildcard intrusive_shared_ptr_src/*.cpp)
668bb611c8fSApple OSS Distributionsintrusive_shared_ptr: OTHER_CXXFLAGS += -Werror=implicit-int-conversion -Werror=shorten-64-to-32 -I$(SRCROOT)/../libkern -std=c++17
669bb611c8fSApple OSS Distributionsintrusive_shared_ptr: $(wildcard intrusive_shared_ptr_src/*.cpp) intrusive_shared_ptr.cpp
670bb611c8fSApple OSS Distributions
671bb611c8fSApple OSS DistributionsEXCLUDED_SOURCES += $(wildcard safe_allocation_src/*.cpp)
672bb611c8fSApple OSS Distributionssafe_allocation: OTHER_CXXFLAGS += -Werror=implicit-int-conversion -Werror=shorten-64-to-32 -I$(SRCROOT)/../libkern -std=c++17
673bb611c8fSApple OSS Distributionssafe_allocation: $(wildcard safe_allocation_src/*.cpp) safe_allocation.cpp
674bb611c8fSApple OSS Distributions
6758d741a5dSApple OSS DistributionsEXCLUDED_SOURCES += $(wildcard cxx_safe_buffers_src/*.cpp)
6768d741a5dSApple OSS Distributionscxx_safe_buffers: OTHER_CXXFLAGS += -Werror=unsafe-buffer-usage -I$(SRCROOT)/../libkern -std=c++20
6778d741a5dSApple OSS Distributionscxx_safe_buffers: $(wildcard cxx_safe_buffers_src/*.cpp) cxx_safe_buffers.cpp
6788d741a5dSApple OSS Distributions
679bb611c8fSApple OSS DistributionsEXCLUDED_SOURCES += osptr_compat.cpp
680bb611c8fSApple OSS Distributionsosptr_98: OTHER_CXXFLAGS += -I$(SRCROOT)/../libkern -std=c++98 -DOSPTR_STD="98"
681bb611c8fSApple OSS Distributionsosptr_98: osptr_compat.cpp
682bb611c8fSApple OSS Distributions	$(CXX) $(DT_CXXFLAGS) $(OTHER_CXXFLAGS) $(CXXFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
683bb611c8fSApple OSS Distributionsosptr_11: OTHER_CXXFLAGS += -I$(SRCROOT)/../libkern -std=c++11 -DOSPTR_STD="11"
684bb611c8fSApple OSS Distributionsosptr_11: osptr_compat.cpp
685bb611c8fSApple OSS Distributions	$(CXX) $(DT_CXXFLAGS) $(OTHER_CXXFLAGS) $(CXXFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
686bb611c8fSApple OSS Distributionsosptr_14: OTHER_CXXFLAGS += -I$(SRCROOT)/../libkern -std=c++14 -DOSPTR_STD="14"
687bb611c8fSApple OSS Distributionsosptr_14: osptr_compat.cpp
688bb611c8fSApple OSS Distributions	$(CXX) $(DT_CXXFLAGS) $(OTHER_CXXFLAGS) $(CXXFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
689bb611c8fSApple OSS Distributionsosptr_17: OTHER_CXXFLAGS += -I$(SRCROOT)/../libkern -std=c++17 -DOSPTR_STD="17"
690bb611c8fSApple OSS Distributionsosptr_17: osptr_compat.cpp
691a5e72196SApple OSS Distributions	$(CXX) $(DT_CXXFLAGS) $(OTHER_CXXFLAGS) $(CXXFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
692a5e72196SApple OSS Distributions
693bb611c8fSApple OSS Distributionspriority_queue: OTHER_CXXFLAGS += -std=c++17
6948d741a5dSApple OSS Distributionsqueue: OTHER_CFLAGS += -I$(SRCROOT)/../osfmk
6958d741a5dSApple OSS Distributions
696e7776783SApple OSS Distributionsvm/zalloc: OTHER_LDFLAGS += -ldarwintest_utils
697e7776783SApple OSS Distributionsvm/zalloc_buddy: OTHER_CFLAGS += -Wno-format-pedantic
698a5e72196SApple OSS Distributions
6998d741a5dSApple OSS Distributionsos_refcnt: OTHER_CFLAGS += -I$(SRCROOT)/../libkern/ -Wno-gcc-compat -Wno-undef -O3 -flto -ldarwintest_utils
700a5e72196SApple OSS Distributions
701e6231be0SApple OSS Distributionskernel_inspection: CODE_SIGN_ENTITLEMENTS = ./task_for_pid_entitlement.plist
702e6231be0SApple OSS Distributionskernel_inspection: OTHER_CFLAGS += -DENTITLED=1
703cc9a6355SApple OSS Distributions
704cc9a6355SApple OSS Distributionsturnstile_multihop: OTHER_CFLAGS += -Wno-unused-macros
705cc9a6355SApple OSS Distributionsturnstile_multihop: OTHER_CFLAGS += -I $(OBJROOT)/
706cc9a6355SApple OSS Distributions
707cc9a6355SApple OSS DistributionsCUSTOM_TARGETS += perf_exit_proc
708cc9a6355SApple OSS Distributions
709cc9a6355SApple OSS Distributionsperf_exit_proc:
710cc9a6355SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) perf_exit_proc.c -o $(SYMROOT)/perf_exit_proc
711cc9a6355SApple OSS Distributions
712cc9a6355SApple OSS Distributionsinstall-perf_exit_proc: perf_exit_proc
713cc9a6355SApple OSS Distributions	mkdir -p $(INSTALLDIR)
714cc9a6355SApple OSS Distributions	cp $(SYMROOT)/perf_exit_proc $(INSTALLDIR)/
715cc9a6355SApple OSS Distributions
71694d3b452SApple OSS Distributions# Stackshot
71794d3b452SApple OSS Distributions
71894d3b452SApple OSS Distributions
7195c2921b0SApple OSS Distributionsstackshot_idle_25570396: ./stackshot-entitlements.plist
7205c2921b0SApple OSS Distributionsstackshot_idle_25570396: CODE_SIGN_ENTITLEMENTS=./stackshot-entitlements.plist
7215c2921b0SApple OSS Distributionsstackshot_idle_25570396: OTHER_LDFLAGS += -lkdd -framework Foundation
722cc9a6355SApple OSS Distributionsstackshot_idle_25570396: OTHER_LDFLAGS += -lkdd -framework Foundation
723cc9a6355SApple OSS Distributions
7245c2921b0SApple OSS Distributionsstackshot_block_owner_14362384: ./stackshot-entitlements.plist
7255c2921b0SApple OSS Distributionsstackshot_block_owner_14362384: CODE_SIGN_ENTITLEMENTS=./stackshot-entitlements.plist
726cc9a6355SApple OSS Distributionsstackshot_block_owner_14362384: OTHER_LDFLAGS += -framework Foundation -lpthread -lkdd
727cc9a6355SApple OSS Distributionsifeq ($(PLATFORM),MacOSX)
728cc9a6355SApple OSS Distributionsstackshot_block_owner_14362384: OTHER_LDFLAGS += -lpcre
729cc9a6355SApple OSS Distributionsendif
730cc9a6355SApple OSS Distributions
731cc9a6355SApple OSS Distributionsall: $(DSTROOT)/usr/local/bin/kcdata
732cc9a6355SApple OSS Distributions
733cc9a6355SApple OSS Distributions$(DSTROOT)/usr/local/bin/kcdata: $(SRCROOT)/../tools/lldbmacros/kcdata.py
734cc9a6355SApple OSS Distributions	mkdir -p $(dir $@)
735cc9a6355SApple OSS Distributions	cp $< $@
736cc9a6355SApple OSS Distributions	chmod a+x $@
737cc9a6355SApple OSS Distributions
738cc9a6355SApple OSS Distributionsxnu_quick_test: OTHER_CFLAGS += xnu_quick_test_helpers.c
739cc9a6355SApple OSS Distributions
740cc9a6355SApple OSS DistributionsCUSTOM_TARGETS += vm_set_max_addr_helper
741cc9a6355SApple OSS Distributions
742cc9a6355SApple OSS Distributionsvm_set_max_addr_helper: vm_set_max_addr_helper.c
743cc9a6355SApple OSS Distributions	$(CC) $(OTHER_CFLAGS) $(CFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) vm_set_max_addr_helper.c -o $(SYMROOT)/vm_set_max_addr_helper; \
744cc9a6355SApple OSS Distributions	echo $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@; \
745cc9a6355SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
746cc9a6355SApple OSS Distributions
747cc9a6355SApple OSS Distributionsinstall-vm_set_max_addr_helper: vm_set_max_addr_helper
748cc9a6355SApple OSS Distributions	mkdir -p $(INSTALLDIR)
749cc9a6355SApple OSS Distributions	cp $(SYMROOT)/vm_set_max_addr_helper $(INSTALLDIR)/
750cc9a6355SApple OSS Distributions
751bb611c8fSApple OSS DistributionsCUSTOM_TARGETS += subsystem_root_path_helper_entitled
752bb611c8fSApple OSS DistributionsCUSTOM_TARGETS += subsystem_root_path_helper
753bb611c8fSApple OSS Distributions
754bb611c8fSApple OSS Distributionssubsystem_root_path_helper_entitled: subsystem_root_path_helper.c subsystem_root_path-entitlements.plist
755bb611c8fSApple OSS Distributions	$(CC) $(OTHER_CFLAGS) $(CFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) subsystem_root_path_helper.c -o $(SYMROOT)/subsystem_root_path_helper_entitled; \
756bb611c8fSApple OSS Distributions	echo $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@; \
757bb611c8fSApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements subsystem_root_path-entitlements.plist $(SYMROOT)/$@;
758bb611c8fSApple OSS Distributions
759bb611c8fSApple OSS Distributionsinstall-subsystem_root_path_helper_entitled: subsystem_root_path_helper_entitled
760bb611c8fSApple OSS Distributions	mkdir -p $(INSTALLDIR)
761bb611c8fSApple OSS Distributions	cp $(SYMROOT)/subsystem_root_path_helper_entitled $(INSTALLDIR)/
762bb611c8fSApple OSS Distributions
763bb611c8fSApple OSS Distributionssubsystem_root_path_helper: subsystem_root_path_helper.c
764bb611c8fSApple OSS Distributions	$(CC) $(OTHER_CFLAGS) $(CFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) subsystem_root_path_helper.c -o $(SYMROOT)/subsystem_root_path_helper; \
765bb611c8fSApple OSS Distributions	echo $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@; \
766bb611c8fSApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
767bb611c8fSApple OSS Distributions
768bb611c8fSApple OSS Distributionsinstall-subsystem_root_path_helper: subsystem_root_path_helper
769bb611c8fSApple OSS Distributions	mkdir -p $(INSTALLDIR)
770bb611c8fSApple OSS Distributions	cp $(SYMROOT)/subsystem_root_path_helper $(INSTALLDIR)/
771bb611c8fSApple OSS Distributions
772bb611c8fSApple OSS DistributionsCUSTOM_TARGETS += vm_test_code_signing_helper
773bb611c8fSApple OSS Distributions
774bb611c8fSApple OSS Distributionsvm_test_code_signing_helper: vm_test_code_signing_helper.c
775bb611c8fSApple OSS Distributions	$(CC) $(OTHER_CFLAGS) $(CFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) vm_test_code_signing_helper.c -o $(SYMROOT)/vm_test_code_signing_helper; \
776bb611c8fSApple OSS Distributions	echo $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@; \
777bb611c8fSApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
778bb611c8fSApple OSS Distributions
779bb611c8fSApple OSS Distributionsinstall-vm_test_code_signing_helper: vm_test_code_signing_helper
780bb611c8fSApple OSS Distributions	mkdir -p $(INSTALLDIR)
781bb611c8fSApple OSS Distributions	cp $(SYMROOT)/vm_test_code_signing_helper $(INSTALLDIR)/
782bb611c8fSApple OSS Distributions
783bb611c8fSApple OSS Distributionsvm_test_code_signing: OTHER_LDFLAGS += -ldarwintest_utils
784bb611c8fSApple OSS Distributions
785e7776783SApple OSS DistributionsINCLUDED_TEST_SOURCE_DIRS += vm ipc rm workq
786bb611c8fSApple OSS Distributions
787bb611c8fSApple OSS Distributions# Revert to legacy vm_test suite until <rdar://problem/56675212> gets solved
788bb611c8fSApple OSS DistributionsEXCLUDED_SOURCES += vm/vm_allocation.c
789bb611c8fSApple OSS Distributions
790e7776783SApple OSS DistributionsEXCLUDED_SOURCES += jumbo_va_spaces_common.c
791e7776783SApple OSS Distributions
792e6231be0SApple OSS Distributionsifeq ($(IOS_TEST_COMPAT),YES)
7938d741a5dSApple OSS DistributionsOTHER_TEST_TARGETS += jumbo_va_spaces_28530648_unentitled jumbo_va_spaces_52551256 vm_phys_footprint_legacy vm/entitlement_increased_memory_limit vm/entitlement_increased_memory_limit_unentitled vm/entitlement_increased_debugging_memory_limit vm/ios13extended_footprint vm/memorystatus_freeze_test vm/memorystatus_freeze_test_entitled vm/entitlement_internal_bands vm/entitlement_internal_bands_unentitled
7945c2921b0SApple OSS Distributions
795cc9a6355SApple OSS Distributionsjumbo_va_spaces_28530648: CODE_SIGN_ENTITLEMENTS = jumbo_va_spaces_28530648.entitlements
796bb611c8fSApple OSS Distributionsjumbo_va_spaces_28530648: OTHER_CFLAGS += -DENTITLED=1 -DTESTNAME=jumbo_va_spaces_28530648
797e7776783SApple OSS Distributionsjumbo_va_spaces_28530648: jumbo_va_spaces_common.c
798cc9a6355SApple OSS Distributionsjumbo_va_spaces_28530648: OTHER_LDFLAGS += -ldarwintest_utils
799e6231be0SApple OSS Distributionsjumbo_va_spaces_28530648: OTHER_LDFLAGS += -sectcreate __TEXT __info_plist jumbo_va_spaces_28530648-identifier.plist
800cc9a6355SApple OSS Distributions
801bb611c8fSApple OSS Distributionsjumbo_va_spaces_52551256: CODE_SIGN_ENTITLEMENTS = jumbo_va_spaces_52551256.entitlements
802bb611c8fSApple OSS Distributionsjumbo_va_spaces_52551256: OTHER_CFLAGS += -DENTITLED=1 -DTESTNAME=jumbo_va_spaces_52551256
803bb611c8fSApple OSS Distributionsjumbo_va_spaces_52551256: OTHER_LDFLAGS += -ldarwintest_utils
804e7776783SApple OSS Distributionsjumbo_va_spaces_52551256: jumbo_va_spaces_28530648.c jumbo_va_spaces_common.c
805e7776783SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
806bb611c8fSApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements $(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@;
807bb611c8fSApple OSS Distributions
808cc9a6355SApple OSS Distributionsjumbo_va_spaces_28530648_unentitled: OTHER_LDFLAGS += -ldarwintest_utils
809bb611c8fSApple OSS Distributionsjumbo_va_spaces_28530648_unentitled: OTHER_CFLAGS += -DTESTNAME=jumbo_va_spaces_28530648_unentitled
810e7776783SApple OSS Distributions
811e7776783SApple OSS Distributionsjumbo_va_spaces_28530648_unentitled: jumbo_va_spaces_28530648.c jumbo_va_spaces_common.c
812e7776783SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
813a5e72196SApple OSS Distributions
814bb611c8fSApple OSS Distributionsvm/entitlement_increased_memory_limit: CODE_SIGN_ENTITLEMENTS = vm/entitlement_increased_memory_limit.entitlements
815e7776783SApple OSS Distributionsvm/entitlement_increased_memory_limit: OTHER_CFLAGS += -DENTITLED=1 jumbo_va_spaces_common.c
816bb611c8fSApple OSS Distributionsvm/entitlement_increased_memory_limit: OTHER_LDFLAGS += -ldarwintest_utils memorystatus_assertion_helpers.c
817bb611c8fSApple OSS Distributionsvm/entitlement_increased_memory_limit: vm/entitlement_increased_memory_limit.c
818e7776783SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
819bb611c8fSApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements $(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@;
820bb611c8fSApple OSS Distributions
821bb611c8fSApple OSS Distributionsvm/entitlement_increased_memory_limit_unentitled: OTHER_LDFLAGS += -ldarwintest_utils memorystatus_assertion_helpers.c
822e7776783SApple OSS Distributionsvm/entitlement_increased_memory_limit_unentitled: vm/entitlement_increased_memory_limit.c jumbo_va_spaces_common.c
823e7776783SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
824bb611c8fSApple OSS Distributions
8258d741a5dSApple OSS Distributionsvm/entitlement_increased_debugging_memory_limit: CODE_SIGN_ENTITLEMENTS = vm/entitlement_increased_debugging_memory_limit.entitlements
8268d741a5dSApple OSS Distributionsvm/entitlement_increased_debugging_memory_limit: OTHER_CFLAGS += -DENTITLED_DEBUGGING=1 jumbo_va_spaces_common.c
8278d741a5dSApple OSS Distributionsvm/entitlement_increased_debugging_memory_limit: OTHER_LDFLAGS += -ldarwintest_utils memorystatus_assertion_helpers.c
8288d741a5dSApple OSS Distributionsvm/entitlement_increased_debugging_memory_limit: vm/entitlement_increased_memory_limit.c
8298d741a5dSApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
8308d741a5dSApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements $(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@;
8318d741a5dSApple OSS Distributions
8325c2921b0SApple OSS Distributionsvm/entitlement_internal_bands: CODE_SIGN_ENTITLEMENTS = vm/entitlement_internal_bands.entitlements
8335c2921b0SApple OSS Distributionsvm/entitlement_internal_bands: OTHER_CFLAGS += -DENTITLED=1
8345c2921b0SApple OSS Distributionsvm/entitlement_internal_bands: OTHER_LDFLAGS += -ldarwintest_utils
8355c2921b0SApple OSS Distributionsvm/entitlement_internal_bands: vm/entitlement_internal_bands.c memorystatus_assertion_helpers.c
8365c2921b0SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
8375c2921b0SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements $(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@;
8385c2921b0SApple OSS Distributions
8395c2921b0SApple OSS Distributionsvm/entitlement_internal_bands_unentitled: OTHER_LDFLAGS += -ldarwintest_utils
8405c2921b0SApple OSS Distributionsvm/entitlement_internal_bands_unentitled: vm/entitlement_internal_bands.c memorystatus_assertion_helpers.c
8415c2921b0SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
8425c2921b0SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
8435c2921b0SApple OSS Distributions
8445c2921b0SApple OSS Distributionsvm/ios13extended_footprint: CODE_SIGN_ENTITLEMENTS = vm/ios13extended_footprint.entitlements
8455c2921b0SApple OSS Distributionsvm/ios13extended_footprint: vm/ios13extended_footprint.c
8465c2921b0SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
8475c2921b0SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements $(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@;
8485c2921b0SApple OSS Distributions
849a5e72196SApple OSS Distributionsvm_phys_footprint_legacy: OTHER_LDFLAGS += -framework CoreFoundation -framework IOSurface
850a5e72196SApple OSS Distributionsvm_phys_footprint_legacy: OTHER_CFLAGS += -DLEGACY_FOOTPRINT_ENTITLED=1
851a5e72196SApple OSS Distributionsvm_phys_footprint_legacy: CODE_SIGN_ENTITLEMENTS=./legacy_footprint.entitlement
852a5e72196SApple OSS Distributionsvm_phys_footprint_legacy: vm_phys_footprint.c
853a5e72196SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
854a5e72196SApple OSS Distributions
855cc9a6355SApple OSS Distributionsendif
856cc9a6355SApple OSS Distributions
8571031c584SApple OSS DistributionsCUSTOM_TARGETS += vm/hello
8581031c584SApple OSS Distributions
8591031c584SApple OSS Distributionsvm/hello: vm/hello.c
8601031c584SApple OSS Distributions	$(CC) $(LDFLAGS) $(CFLAGS) $< -o $(SYMROOT)/$@
8611031c584SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
8621031c584SApple OSS Distributions
8631031c584SApple OSS Distributions.PHONY: install-vm/hello
8641031c584SApple OSS Distributionsinstall-vm/hello: vm/hello
8651031c584SApple OSS Distributions	mkdir -p $(INSTALLDIR)/vm
8661031c584SApple OSS Distributions	cp $(SYMROOT)/vm/hello $(INSTALLDIR)/vm/
8671031c584SApple OSS Distributions
8681031c584SApple OSS Distributionsvm/vm_tainted_executable: vm/hello
8691031c584SApple OSS Distributions
8708d741a5dSApple OSS Distributionsvm/vm_ranges: CODE_SIGN_ENTITLEMENTS = ./vm/vm_ranges_entitlement.plist
8718d741a5dSApple OSS Distributions
872*4f1223e8SApple OSS Distributionsvm_test_mach_map: CODE_SIGN_ENTITLEMENTS = ./vm_test_mach_map.plist
873*4f1223e8SApple OSS Distributions
8748d741a5dSApple OSS Distributionsbig_map_test: CODE_SIGN_ENTITLEMENTS = ./big_map_test_entitlement.plist
8758d741a5dSApple OSS Distributions
876cc9a6355SApple OSS Distributionstask_info_28439149: CODE_SIGN_ENTITLEMENTS = ./task_for_pid_entitlement.plist
877cc9a6355SApple OSS Distributions
8788d741a5dSApple OSS Distributionsipc/ipc_read_inspect: CODE_SIGN_ENTITLEMENTS = ./task_for_pid_entitlement.plist
879e6231be0SApple OSS Distributions
8808d741a5dSApple OSS Distributionsipc/ipc_thread_ports_race: CODE_SIGN_ENTITLEMENTS = ./task_for_pid_entitlement.plist
8818d741a5dSApple OSS Distributionsipc/ipc_thread_ports_race: OTHER_LDFLAGS += -ldarwintest_utils
882bb611c8fSApple OSS Distributions
883*4f1223e8SApple OSS Distributionsrm/pthread_setugid: OTHER_LDFLAGS += -ldarwintest_utils
884*4f1223e8SApple OSS Distributions
8855c2921b0SApple OSS Distributionsproc_info: recount/recount_test_utils.c
886cc9a6355SApple OSS Distributionsproc_info: CODE_SIGN_ENTITLEMENTS = ./task_for_pid_entitlement.plist
887cc9a6355SApple OSS Distributionsproc_info: OTHER_LDFLAGS += -ldarwintest_utils
888cc9a6355SApple OSS Distributions
889cc9a6355SApple OSS Distributionsproc_info_list_kthreads: CODE_SIGN_ENTITLEMENTS = ./proc_info_list_kthreads.entitlements
890cc9a6355SApple OSS Distributions
891a5e72196SApple OSS Distributionsproc_info_44873309: CODE_SIGN_ENTITLEMENTS = ./proc_info_44873309.entitlements
892a5e72196SApple OSS Distributions
893cc9a6355SApple OSS Distributionsdisk_mount_conditioner: disk_mount_conditioner*
894cc9a6355SApple OSS Distributionsdisk_mount_conditioner: CODE_SIGN_ENTITLEMENTS=./disk_mount_conditioner-entitlements.plist
895cc9a6355SApple OSS Distributionsdisk_mount_conditioner: OTHER_LDFLAGS += -ldarwintest_utils
896cc9a6355SApple OSS Distributions
897a5e72196SApple OSS Distributionsdisk_mount_conditioner: OTHER_TEST_TARGETS += disk_mount_conditioner_unentitled
898cc9a6355SApple OSS Distributionsdisk_mount_conditioner_unentitled: OTHER_CFLAGS += -DTEST_UNENTITLED
899cc9a6355SApple OSS Distributionsdisk_mount_conditioner_unentitled: OTHER_LDFLAGS += -ldarwintest_utils
900cc9a6355SApple OSS Distributionsdisk_mount_conditioner_unentitled: disk_mount_conditioner.c
901cc9a6355SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
902cc9a6355SApple OSS Distributions
903cc9a6355SApple OSS Distributionswork_interval_test: CODE_SIGN_ENTITLEMENTS = work_interval_test.entitlements
904cc9a6355SApple OSS Distributionswork_interval_test: OTHER_CFLAGS += -DENTITLED=1
905cc9a6355SApple OSS Distributions
9061031c584SApple OSS Distributionswork_interval_data_test: CODE_SIGN_ENTITLEMENTS = work_interval_test.entitlements
9071031c584SApple OSS Distributionswork_interval_data_test: OTHER_CFLAGS += -DENTITLED=1
9081031c584SApple OSS Distributionswork_interval_data_test: OTHER_LDFLAGS += -lpthread
9091031c584SApple OSS Distributions
9101031c584SApple OSS Distributionsgame_mode: CODE_SIGN_ENTITLEMENTS = game_mode.entitlements
9118d741a5dSApple OSS Distributionscarplay_mode: CODE_SIGN_ENTITLEMENTS = carplay_mode.entitlements
9128d741a5dSApple OSS Distributions
9138d741a5dSApple OSS Distributionscoalition_policy: CODE_SIGN_ENTITLEMENTS = coalition_policy.entitlements
9141031c584SApple OSS Distributions
915cc9a6355SApple OSS Distributionssettimeofday_29193041: OTHER_CFLAGS += drop_priv.c
916cc9a6355SApple OSS Distributions
917cc9a6355SApple OSS Distributionssettimeofday_29193041_entitled: CODE_SIGN_ENTITLEMENTS = settimeofday_29193041.entitlements
918cc9a6355SApple OSS Distributionssettimeofday_29193041_entitled: OTHER_CFLAGS += drop_priv.c
919cc9a6355SApple OSS Distributions
9205c2921b0SApple OSS Distributionsthread_group_set_32261625: ./stackshot-entitlements.plist
9215c2921b0SApple OSS Distributionsthread_group_set_32261625: CODE_SIGN_ENTITLEMENTS=./stackshot-entitlements.plist
922cc9a6355SApple OSS Distributionsthread_group_set_32261625: OTHER_LDFLAGS = -framework ktrace
923cc9a6355SApple OSS Distributions
924cc9a6355SApple OSS Distributionstask_info: CODE_SIGN_ENTITLEMENTS = task_for_pid_entitlement.plist
925e6231be0SApple OSS Distributionstask_info: OTHER_CFLAGS += test_utils.c
9265c2921b0SApple OSS Distributionstask_info: OTHER_LDFLAGS += -ldarwintest_utils
927cc9a6355SApple OSS Distributions
928e6231be0SApple OSS Distributionsextract_right_soft_fail: CODE_SIGN_ENTITLEMENTS = task_for_pid_entitlement.plist
929e6231be0SApple OSS Distributions
930e6231be0SApple OSS Distributionsifneq ($(IOS_TEST_COMPAT),YES)
931bb611c8fSApple OSS Distributions	EXCLUDED_SOURCES += task_vm_info_decompressions.c
932bb611c8fSApple OSS Distributionsendif
933a5e72196SApple OSS Distributions
9348d741a5dSApple OSS Distributionsifeq ($(PLATFORM),MacOSX)
935e6231be0SApple OSS Distributions	EXCLUDED_SOURCES += vm/compression_sweep.c
936e6231be0SApple OSS Distributionsendif
937e6231be0SApple OSS Distributions
9388d741a5dSApple OSS Distributionsunp_sock_release: CODE_SIGN_ENTITLEMENTS = unp_sock_release-entitlements.plist
9398d741a5dSApple OSS Distributions
9401031c584SApple OSS Distributionsbpf_write: bpflib.c in_cksum.c net_test_lib.c
9411031c584SApple OSS Distributionsbpf_write: OTHER_LDFLAGS += -ldarwintest_utils
9421031c584SApple OSS Distributions
94394d3b452SApple OSS Distributionsbpf_write_batch: bpflib.c in_cksum.c net_test_lib.c
94494d3b452SApple OSS Distributionsbpf_write_batch: OTHER_LDFLAGS += -ldarwintest_utils
94594d3b452SApple OSS Distributions
9468d741a5dSApple OSS Distributionsudp_disconnect: in_cksum.c net_test_lib.c
9478d741a5dSApple OSS Distributionsudp_disconnect: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
9488d741a5dSApple OSS Distributions
9498d741a5dSApple OSS Distributionsudp_bind_connect: in_cksum.c net_test_lib.c
9505c2921b0SApple OSS Distributionsudp_bind_connect: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
9518d741a5dSApple OSS Distributions
952e6231be0SApple OSS Distributionstcp_bind_connect: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
9535c2921b0SApple OSS Distributionstcp_send_implied_connect: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
954cc9a6355SApple OSS Distributionssocket_bind_35243417: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
955cc9a6355SApple OSS Distributionssocket_bind_35685803: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
956e7776783SApple OSS Distributionsicmp_fragmetned_payload: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
9578d741a5dSApple OSS Distributionstcp_invalid_address: OTHER_CFLAGS += -Wno-int-conversion
9588d741a5dSApple OSS Distributionstcp_invalid_address: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
959cc9a6355SApple OSS Distributions
960cc9a6355SApple OSS Distributionsnet_tuntests: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
961cc9a6355SApple OSS Distributions
9621031c584SApple OSS Distributionsnet_bridge: inet_transfer.c bpflib.c in_cksum.c net_test_lib.c
963bb611c8fSApple OSS Distributionsnet_bridge: OTHER_LDFLAGS += -ldarwintest_utils
964e6231be0SApple OSS Distributionsnet_bridge: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
965cc9a6355SApple OSS Distributions
9668d741a5dSApple OSS Distributionsnet_vlan: inet_transfer.c bpflib.c in_cksum.c net_test_lib.c
9678d741a5dSApple OSS Distributionsnet_vlan: OTHER_LDFLAGS += -ldarwintest_utils
9688d741a5dSApple OSS Distributionsnet_vlan: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
9698d741a5dSApple OSS Distributions
9708d741a5dSApple OSS Distributionsnet_bond: inet_transfer.c bpflib.c in_cksum.c net_test_lib.c
9718d741a5dSApple OSS Distributionsnet_bond: OTHER_LDFLAGS += -ldarwintest_utils
9728d741a5dSApple OSS Distributionsnet_bond: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
9738d741a5dSApple OSS Distributions
9741031c584SApple OSS Distributionsif_generation_id: net_test_lib.c in_cksum.c
9751031c584SApple OSS Distributionsif_generation_id: OTHER_LDFLAGS += -ldarwintest_utils
9761031c584SApple OSS Distributions
97794d3b452SApple OSS Distributionsinet6_addr_mode: net_test_lib.c in_cksum.c
97894d3b452SApple OSS Distributionsinet6_addr_mode: OTHER_LDFLAGS += -ldarwintest_utils
97994d3b452SApple OSS Distributions
9801031c584SApple OSS Distributionsbpf_direction: bpflib.c
9811031c584SApple OSS Distributionsbpf_direction: OTHER_LDFLAGS += -ldarwintest_utils
9821031c584SApple OSS Distributionsbpf_direction: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
9831031c584SApple OSS Distributions
9848d741a5dSApple OSS Distributionsbpf_timestamp: bpflib.c
9858d741a5dSApple OSS Distributionsbpf_timestamp: OTHER_LDFLAGS += -ldarwintest_utils
9868d741a5dSApple OSS Distributionsbpf_timestamp: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
9878d741a5dSApple OSS Distributions
9881031c584SApple OSS Distributionsipv6_bind_race: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
9891031c584SApple OSS Distributions
9908d741a5dSApple OSS Distributionsso_bindtodevice: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
9918d741a5dSApple OSS Distributions
9928d741a5dSApple OSS Distributionsv4mappedv6_dontfrag: net_test_lib.c in_cksum.c
9938d741a5dSApple OSS Distributionsv4mappedv6_dontfrag: OTHER_LDFLAGS += -ldarwintest_utils
9948d741a5dSApple OSS Distributionsv4mappedv6_dontfrag: CODE_SIGN_ENTITLEMENTS = network_entitlements.plist
9958d741a5dSApple OSS Distributions
9968d741a5dSApple OSS Distributions
997bb611c8fSApple OSS DistributionsCUSTOM_TARGETS += posix_spawn_archpref_helper
998a5e72196SApple OSS Distributions
999e6231be0SApple OSS Distributionsposix_spawn_archpref_helper: posix_spawn_archpref_helper.c
1000bb611c8fSApple OSS Distributions	$(CC) $(LDFLAGS) $(CFLAGS) posix_spawn_archpref_helper.c -o $(SYMROOT)/$@;
1001bb611c8fSApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
1002bb611c8fSApple OSS Distributions
1003e6231be0SApple OSS Distributionsinstall-posix_spawn_archpref_helper: posix_spawn_archpref_helper
1004bb611c8fSApple OSS Distributions	mkdir -p $(INSTALLDIR)
1005bb611c8fSApple OSS Distributions	cp $(SYMROOT)/posix_spawn_archpref_helper $(INSTALLDIR)/
1006cc9a6355SApple OSS Distributions
1007e6231be0SApple OSS DistributionsCUSTOM_TARGETS += posix_spawn_alt_rosetta_helper
1008e6231be0SApple OSS Distributions
1009e6231be0SApple OSS Distributionsposix_spawn_alt_rosetta_helper: posix_spawn_alt_rosetta_helper.c
1010e6231be0SApple OSS Distributions	$(CC) $(LDFLAGS) $(CFLAGS) posix_spawn_alt_rosetta_helper.c -o $(SYMROOT)/$@;
1011e6231be0SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
1012e6231be0SApple OSS Distributions
1013e6231be0SApple OSS Distributionsinstall-posix_spawn_alt_rosetta_helper: posix_spawn_alt_rosetta_helper
1014e6231be0SApple OSS Distributions	mkdir -p $(INSTALLDIR)
1015e6231be0SApple OSS Distributions	cp $(SYMROOT)/posix_spawn_alt_rosetta_helper $(INSTALLDIR)/
1016e6231be0SApple OSS Distributions
1017cc9a6355SApple OSS DistributionsMIG:=SDKROOT=$(SDKROOT) $(shell xcrun -sdk "$(TARGETSDK)" -find mig)
1018cc9a6355SApple OSS Distributions
1019cc9a6355SApple OSS DistributionsCUSTOM_TARGETS += excserver
1020cc9a6355SApple OSS Distributions
1021cc9a6355SApple OSS Distributionsexcserver:
1022cc9a6355SApple OSS Distributions	$(MIG) $(CFLAGS) \
1023cc9a6355SApple OSS Distributions		-sheader $(OBJROOT)/excserver.h \
1024cc9a6355SApple OSS Distributions		-server $(OBJROOT)/excserver.c \
1025cc9a6355SApple OSS Distributions		-header /dev/null -user /dev/null \
1026cc9a6355SApple OSS Distributions		excserver.defs
1027cc9a6355SApple OSS Distributionsinstall-excserver: ;
1028cc9a6355SApple OSS Distributions
1029e6231be0SApple OSS Distributionsexcserver_protect:
1030e6231be0SApple OSS Distributions	$(MIG) $(CFLAGS) \
1031e6231be0SApple OSS Distributions		-DMACH_EXC_SERVER_TASKIDTOKEN \
1032e6231be0SApple OSS Distributions		-sheader $(OBJROOT)/excserver_protect.h \
1033e6231be0SApple OSS Distributions		-server $(OBJROOT)/excserver_protect.c \
1034e6231be0SApple OSS Distributions		-header /dev/null -user /dev/null \
1035e6231be0SApple OSS Distributions		excserver_protect.defs
1036e6231be0SApple OSS Distributionsinstall-excserver_protect: ;
1037e6231be0SApple OSS Distributions
10388d741a5dSApple OSS Distributionsexcserver_protect_state:
10398d741a5dSApple OSS Distributions	$(MIG) $(CFLAGS) \
10408d741a5dSApple OSS Distributions		-DMACH_EXC_SERVER_TASKIDTOKEN_STATE \
10418d741a5dSApple OSS Distributions		-DMACH_EXC_SERVER_TASKIDTOKEN \
10428d741a5dSApple OSS Distributions		-sheader $(OBJROOT)/excserver_protect_state.h \
10438d741a5dSApple OSS Distributions		-server $(OBJROOT)/excserver_protect_state.c \
10448d741a5dSApple OSS Distributions		-header /dev/null -user /dev/null \
10458d741a5dSApple OSS Distributions		excserver_protect.defs
10468d741a5dSApple OSS Distributionsinstall-excserver_protect_state: ;
10478d741a5dSApple OSS Distributions
1048bb611c8fSApple OSS DistributionsEXCLUDED_SOURCES += exc_helpers.c
1049bb611c8fSApple OSS Distributions
1050e6231be0SApple OSS DistributionsCUSTOM_TARGETS += notifyserver
1051e6231be0SApple OSS Distributions
1052e6231be0SApple OSS Distributionsnotifyserver:
1053e6231be0SApple OSS Distributions	$(MIG) $(CFLAGS) \
1054e6231be0SApple OSS Distributions		-DMACH_NOTIFY_SERVICE_PORT_DESTROYED_EXPECTED \
1055e6231be0SApple OSS Distributions		-user /dev/null \
1056e6231be0SApple OSS Distributions		-header $(OBJROOT)/notify.h \
1057e6231be0SApple OSS Distributions		-sheader $(OBJROOT)/notifyServer.h \
1058e6231be0SApple OSS Distributions		-server $(OBJROOT)/notifyServer.c \
1059e6231be0SApple OSS Distributions		notifyserver.defs
1060e6231be0SApple OSS Distributionsinstall-notifyserver: ;
1061e6231be0SApple OSS Distributions
1062e6231be0SApple OSS DistributionsCUSTOM_TARGETS += rnserver
1063e6231be0SApple OSS Distributions
1064e6231be0SApple OSS Distributionsrnserver:
1065e6231be0SApple OSS Distributions	$(MIG) $(CFLAGS) \
1066e6231be0SApple OSS Distributions		-user /dev/null \
1067e6231be0SApple OSS Distributions		-header $(OBJROOT)/rn.h \
1068e6231be0SApple OSS Distributions		-sheader $(OBJROOT)/rnServer.h \
1069e6231be0SApple OSS Distributions		-server $(OBJROOT)/rnServer.c \
1070e6231be0SApple OSS Distributions		rnserver.defs
1071e6231be0SApple OSS Distributionsinstall-rnserver: ;
1072e6231be0SApple OSS Distributions
10738d741a5dSApple OSS DistributionsSKYWALK_COMMON_FILES := \
10748d741a5dSApple OSS Distributions	skywalk/skywalk_test_common.c \
10758d741a5dSApple OSS Distributions	skywalk/skywalk_test_utils.c
10768d741a5dSApple OSS DistributionsSKYWALK_TEST_FILES := \
10778d741a5dSApple OSS Distributions	skywalk/skywalk_test_driver.c \
10788d741a5dSApple OSS Distributions	skywalk/skt_simple.c \
10798d741a5dSApple OSS Distributions	skywalk/skt_features.c \
10808d741a5dSApple OSS Distributions	skywalk/skt_oneslot.c \
10818d741a5dSApple OSS Distributions	skywalk/skt_shutdown.c \
10828d741a5dSApple OSS Distributions	skywalk/skt_shutdown2.c \
10838d741a5dSApple OSS Distributions	skywalk/skt_nslots.c \
10848d741a5dSApple OSS Distributions	skywalk/skt_closecfd.c \
10858d741a5dSApple OSS Distributions	skywalk/skt_closenfd.c \
10868d741a5dSApple OSS Distributions	skywalk/skt_badring.c \
10878d741a5dSApple OSS Distributions	skywalk/skt_kqueue.c \
10888d741a5dSApple OSS Distributions	skywalk/skt_mangle.c \
10898d741a5dSApple OSS Distributions	skywalk/skt_features.c \
10908d741a5dSApple OSS Distributions	skywalk/skt_ringid.c \
10918d741a5dSApple OSS Distributions	skywalk/skt_closekq.c \
10928d741a5dSApple OSS Distributions	skywalk/skt_writemem.c \
10938d741a5dSApple OSS Distributions	skywalk/skt_debug_verify.c \
10948d741a5dSApple OSS Distributions	skywalk/skt_utun27302538.c \
10958d741a5dSApple OSS Distributions	skywalk/skt_utunleak.c \
10968d741a5dSApple OSS Distributions	skywalk/skt_utunloop.c \
10978d741a5dSApple OSS Distributions	skywalk/skt_flowswitch_ns_reserve.c \
10988d741a5dSApple OSS Distributions	skywalk/skt_netifcompat.c \
10998d741a5dSApple OSS Distributions	skywalk/skt_fswloop.c \
11008d741a5dSApple OSS Distributions	skywalk/skt_teardown.c \
11018d741a5dSApple OSS Distributions	skywalk/skt_bind.c \
11028d741a5dSApple OSS Distributions	skywalk/skt_fsw29301703.c \
11038d741a5dSApple OSS Distributions	skywalk/skt_fswbinds.c \
11048d741a5dSApple OSS Distributions	skywalk/skt_manyflows.c \
11058d741a5dSApple OSS Distributions	skywalk/skt_pllupipe.c \
11068d741a5dSApple OSS Distributions	skywalk/skt_fullupipe.c \
11078d741a5dSApple OSS Distributions	skywalk/skt_listener.c \
11088d741a5dSApple OSS Distributions	skywalk/skt_copy_cksum.c \
11098d741a5dSApple OSS Distributions	skywalk/skt_reass.c \
11108d741a5dSApple OSS Distributions	skywalk/skt_memory.c \
11118d741a5dSApple OSS Distributions	skywalk/skt_flow.c \
11128d741a5dSApple OSS Distributions	skywalk/skt_flowlookup.c \
11138d741a5dSApple OSS Distributions	skywalk/skt_libcuckoo.c \
11148d741a5dSApple OSS Distributions	skywalk/skt_restricted_port.c \
11158d741a5dSApple OSS Distributions	skywalk/skt_steering.c
11168d741a5dSApple OSS DistributionsSKYWALK_MPTEST_FILES := \
11178d741a5dSApple OSS Distributions	skywalk/skywalk_mptests.c \
11188d741a5dSApple OSS Distributions	skywalk/skywalk_mptest_driver.c \
11198d741a5dSApple OSS Distributions	skywalk/skt_mpsimple.c \
11208d741a5dSApple OSS Distributions	skywalk/skt_mpprotons.c \
11218d741a5dSApple OSS Distributions	skywalk/skt_xfer.c \
11228d741a5dSApple OSS Distributions	skywalk/skt_netifdirect.c \
11238d741a5dSApple OSS Distributions	skywalk/skt_filter.c
11248d741a5dSApple OSS DistributionsEXCLUDED_SOURCES += $(SKYWALK_COMMON_FILES) $(SKYWALK_TEST_FILES) $(SKYWALK_MPTEST_FILES)
11258d741a5dSApple OSS Distributions
11268d741a5dSApple OSS Distributionsskywalk_tests: excserver
11278d741a5dSApple OSS Distributionsskywalk_tests: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
11288d741a5dSApple OSS Distributionsskywalk_tests: CODE_SIGN_ENTITLEMENTS = skywalk_test.entitlements
11298d741a5dSApple OSS Distributionsskywalk_tests: $(SKYWALK_COMMON_FILES) $(SKYWALK_TEST_FILES) $(SKYWALK_MPTEST_FILES) $(SDKROOT)/usr/local/lib/libCrashReporterClient.a
11308d741a5dSApple OSS Distributions
11318d741a5dSApple OSS DistributionsEXCLUDED_SOURCES += arm_matrix_sme.c
11328d741a5dSApple OSS Distributions
11338d741a5dSApple OSS Distributionsarm_matrix: INVALID_ARCHS = $(filter-out arm64%,$(ARCH_CONFIGS))
11348d741a5dSApple OSS Distributionsarm_matrix: excserver exc_helpers.c arm_matrix_sme.c
11358d741a5dSApple OSS Distributionsarm_matrix: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT) -Wno-language-extension-token -Wno-c++98-compat -mcpu=firestorm+nofp+sme2
11368d741a5dSApple OSS Distributionsarm_matrix: CODE_SIGN_ENTITLEMENTS = arm_matrix.entitlements
11378d741a5dSApple OSS Distributions
1138bb611c8fSApple OSS Distributions
11395c2921b0SApple OSS Distributionsx18_entitled: OTHER_CFLAGS += -Wno-language-extension-token
11405c2921b0SApple OSS Distributionsx18_entitled: CODE_SIGN_ENTITLEMENTS = x18-entitlements.plist
11415c2921b0SApple OSS Distributionsx18_unentitled: OTHER_CFLAGS += -Wno-language-extension-token
11425c2921b0SApple OSS Distributionsifneq ($(PLATFORM),MacOSX)
11435c2921b0SApple OSS DistributionsEXCLUDED_SOURCES += x18_legacy.c
11445c2921b0SApple OSS Distributionselse
11455c2921b0SApple OSS Distributionsx18_legacy: OTHER_CFLAGS += -Wno-language-extension-token -Wl,-platform_version -Wl,macos -Wl,10.12 -Wl,10.12
11465c2921b0SApple OSS Distributionsendif
1147bb611c8fSApple OSS Distributions
1148*4f1223e8SApple OSS Distributionsifeq ($(findstring arm64,$(ARCH_CONFIGS)),)
1149*4f1223e8SApple OSS DistributionsEXCLUDED_SOURCES += apple_generic_timer.c apple_generic_timer_legacy.c
1150*4f1223e8SApple OSS Distributionselse
1151*4f1223e8SApple OSS Distributionsapple_generic_timer: INVALID_ARCHS = armv7k x86_64 x86_64h
1152*4f1223e8SApple OSS Distributions
1153*4f1223e8SApple OSS Distributionsapple_generic_timer_legacy: INVALID_ARCHS = armv7k x86_64 x86_64h
1154*4f1223e8SApple OSS Distributionsifeq ($(PLATFORM),MacOSX)
1155*4f1223e8SApple OSS Distributionsapple_generic_timer_legacy: OTHER_CFLAGS += -Wl,-platform_version,macos,14.6,14.6
1156*4f1223e8SApple OSS Distributionselse ifeq ($(PLATFORM),iPhoneOS)
1157*4f1223e8SApple OSS Distributionsapple_generic_timer_legacy: OTHER_CFLAGS += -Wl,-platform_version,ios,14.6,14.6
1158*4f1223e8SApple OSS Distributionselse ifeq ($(PLATFORM),tvOS)
1159*4f1223e8SApple OSS Distributionsapple_generic_timer_legacy: OTHER_CFLAGS += -Wl,-platform_version,tvos,14.6,14.6
1160*4f1223e8SApple OSS Distributionselse ifeq ($(PLATFORM),WatchOS)
1161*4f1223e8SApple OSS Distributionsapple_generic_timer_legacy: OTHER_CFLAGS += -Wl,-platform_version,watchos,10.6,10.6
1162*4f1223e8SApple OSS Distributionselse
1163*4f1223e8SApple OSS DistributionsEXCLUDED_SOURCES += apple_generic_timer_legacy.c
1164*4f1223e8SApple OSS Distributionsendif
1165*4f1223e8SApple OSS Distributions
1166*4f1223e8SApple OSS Distributionsifneq ($(PLATFORM),MacOSX)
1167*4f1223e8SApple OSS DistributionsEXCLUDED_SOURCES += apple_generic_timer_vmm.c
1168*4f1223e8SApple OSS Distributionselse
1169*4f1223e8SApple OSS Distributionsapple_generic_timer_vmm: INVALID_ARCHS = armv7k x86_64 x86_64h
1170*4f1223e8SApple OSS Distributionsapple_generic_timer_vmm: CODE_SIGN_ENTITLEMENTS = hv_private.entitlements
1171*4f1223e8SApple OSS Distributionsendif
1172*4f1223e8SApple OSS Distributions
1173*4f1223e8SApple OSS Distributionsendif
1174*4f1223e8SApple OSS Distributions
1175e6231be0SApple OSS Distributionspmap_bench: INVALID_ARCHS = $(filter-out arm%,$(ARCH_CONFIGS))
1176e6231be0SApple OSS Distributions
1177aca3beaaSApple OSS Distributionspmap_stress: INVALID_ARCHS = $(filter-out arm%,$(ARCH_CONFIGS))
1178aca3beaaSApple OSS Distributions
11791031c584SApple OSS Distributionshw_breakpoint_step_arm64: CODE_SIGN_ENTITLEMENTS = hw_breakpoint_step_arm64_entitlements.plist
1180e6231be0SApple OSS Distributionshw_breakpoint_step_arm64: INVALID_ARCHS = $(filter-out arm64%,$(ARCH_CONFIGS))
1181e6231be0SApple OSS Distributionshw_breakpoint_step_arm64: excserver
1182e6231be0SApple OSS Distributionshw_breakpoint_step_arm64: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
1183e6231be0SApple OSS Distributions
1184cc9a6355SApple OSS Distributionsexc_resource_threads: excserver
1185cc9a6355SApple OSS Distributionsexc_resource_threads: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
11868d741a5dSApple OSS Distributionsexc_resource_threads: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
1187cc9a6355SApple OSS Distributions
1188e6231be0SApple OSS Distributionsmach_service_port: notifyserver
1189e6231be0SApple OSS Distributionsmach_service_port: OTHER_CFLAGS += $(OBJROOT)/notifyServer.c -I $(OBJROOT)
1190e6231be0SApple OSS Distributions
1191bb611c8fSApple OSS Distributionsfp_exception: excserver exc_helpers.c
1192a5e72196SApple OSS Distributionsfp_exception: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
11938d741a5dSApple OSS Distributionsfp_exception: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
1194a5e72196SApple OSS Distributions
1195bb611c8fSApple OSS Distributionsptrauth_failure: excserver exc_helpers.c
1196bb611c8fSApple OSS Distributionsptrauth_failure: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT) -Wno-language-extension-token
1197bb611c8fSApple OSS Distributionsptrauth_failure: CODESIGN = $(CODESIGN_HARDENED_RUNTIME)
11988d741a5dSApple OSS Distributionsptrauth_failure: CODE_SIGN_ENTITLEMENTS = entitlements/set_state_and_exception_port.entitlement
1199bb611c8fSApple OSS Distributions
1200bb611c8fSApple OSS Distributionsdecompression_failure: excserver exc_helpers.c
1201bb611c8fSApple OSS Distributionsdecompression_failure: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
12028d741a5dSApple OSS Distributionsdecompression_failure: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
1203e6231be0SApple OSS Distributions
1204e7776783SApple OSS Distributionsipc/kernel_signed_pac_thread_state: excserver
1205e7776783SApple OSS Distributionsipc/kernel_signed_pac_thread_state: OTHER_CFLAGS += $(OBJROOT)/excserver.c -I $(OBJROOT)
12061031c584SApple OSS Distributionsipc/kernel_signed_pac_thread_state: CODE_SIGN_ENTITLEMENTS = pac_exception_entitlement.plist
12071031c584SApple OSS Distributions
12081031c584SApple OSS Distributionsifeq ($(findstring arm64e,$(ARCH_CONFIGS)),)
12091031c584SApple OSS DistributionsEXCLUDED_SOURCES += pac_exception_entitlement.c
12101031c584SApple OSS Distributionselse
12111031c584SApple OSS Distributionspac_exception_entitlement: excserver exc_helpers.c
12121031c584SApple OSS Distributionspac_exception_entitlement: OTHER_CFLAGS += $(OBJROOT)/excserver.c -Wno-language-extension-token
12131031c584SApple OSS Distributionspac_exception_entitlement: CODE_SIGN_ENTITLEMENTS = pac_exception_entitlement.plist
12141031c584SApple OSS Distributionsendif
1215e7776783SApple OSS Distributions
1216e6231be0SApple OSS Distributionsifeq ($(findstring arm64,$(ARCH_CONFIGS)),)
1217e6231be0SApple OSS DistributionsEXCLUDED_SOURCES += arm_cpu_capabilities.c
1218e6231be0SApple OSS Distributionselse
12191031c584SApple OSS Distributionsarm_cpu_capabilities: INVALID_ARCHS = armv7k x86_64 x86_64h
1220e6231be0SApple OSS Distributionsarm_cpu_capabilities: excserver exc_helpers.c
1221e6231be0SApple OSS Distributionsarm_cpu_capabilities: OTHER_CFLAGS += $(OBJROOT)/excserver.c -Wno-language-extension-token -mcpu=apple-a15
12228d741a5dSApple OSS Distributions#if HAS_ARM_FEAT_SME
12238d741a5dSApple OSS Distributionsarm_cpu_capabilities: OTHER_CFLAGS += -mcpu=apple-a15+sme2
12248d741a5dSApple OSS Distributions#endif
12258d741a5dSApple OSS Distributionsarm_cpu_capabilities: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
1226bb611c8fSApple OSS Distributionsendif
1227bb611c8fSApple OSS Distributions
12281031c584SApple OSS Distributions# Disabling building of ldt files as dt_extractmeta crashes
12291031c584SApple OSS Distributions# in build systems. Ref rdar://110251082
12301031c584SApple OSS Distributions# Leaving commented bits for future re-enablement
1231bb611c8fSApple OSS DistributionsEXCLUDED_SOURCES += ldt_code32.s ldt.c
1232a5e72196SApple OSS Distributions
123394d3b452SApple OSS Distributions#\ifeq ($(findstring x86_64,$(ARCH_CONFIGS)),)
12341031c584SApple OSS Distributions#EXCLUDED_SOURCES += ldt_code32.s ldt.c
123594d3b452SApple OSS Distributions#\else # target = osx
123694d3b452SApple OSS Distributions#$(OBJROOT)/ldt_mach_exc_server.c:
123794d3b452SApple OSS Distributions#	$(MIG) $(CFLAGS) \
123894d3b452SApple OSS Distributions#		-user /dev/null \
123994d3b452SApple OSS Distributions#		-server $(OBJROOT)/ldt_mach_exc_server.c \
124094d3b452SApple OSS Distributions#		-header $(OBJROOT)/ldt_mach_exc.h \
124194d3b452SApple OSS Distributions#		mach_exc.defs
124294d3b452SApple OSS Distributions#
124394d3b452SApple OSS Distributions#ldt: INVALID_ARCHS = $(ARCH_CONFIGS)
124494d3b452SApple OSS Distributions#ldt: $(OBJROOT)/ldt_mach_exc_server.c
124594d3b452SApple OSS Distributions#ldt: OTHER_CFLAGS += -arch x86_64 -I $(OBJROOT) $(SRCROOT)/ldt_code32.s -Wl,-pagezero_size,0x1000 -Wno-missing-variable-declarations
124694d3b452SApple OSS Distributions#ldt: CODE_SIGN_ENTITLEMENTS=ldt_entitlement.plist
124794d3b452SApple OSS Distributions#\endif
124894d3b452SApple OSS Distributions
124994d3b452SApple OSS Distributionsifneq ($(PLATFORM),BridgeOS)
125094d3b452SApple OSS DistributionsEXCLUDED_SOURCES += remote_time.c
125194d3b452SApple OSS Distributionselse
125294d3b452SApple OSS Distributionsremote_time: INVALID_ARCHS = armv7 armv7s arm64_32
125394d3b452SApple OSS Distributionsendif
125494d3b452SApple OSS Distributions
125594d3b452SApple OSS Distributionsvm_phys_footprint: OTHER_LDFLAGS += -framework CoreFoundation -framework IOSurface
125694d3b452SApple OSS Distributions
125794d3b452SApple OSS Distributionsvm_kern_count_wired_kernelcache: OTHER_CFLAGS += -I$(SDKROOT)/System/Library/Frameworks/Kernel.framework/PrivateHeaders/mach
125894d3b452SApple OSS Distributions
125994d3b452SApple OSS Distributionsdebug_control_port_for_pid: CODE_SIGN_ENTITLEMENTS = ./debug_control_port_for_pid_entitlement.plist
126094d3b452SApple OSS Distributions
126194d3b452SApple OSS Distributionsprng: OTHER_LDFLAGS += -ldarwintest_utils
126294d3b452SApple OSS Distributions
126394d3b452SApple OSS Distributionspreoslog: OTHER_LDFLAGS += -ldarwintest_utils
126494d3b452SApple OSS Distributionspreoslog: OTHER_CFLAGS += test_utils.c
126594d3b452SApple OSS Distributions
126694d3b452SApple OSS Distributionstask_policy: CODE_SIGN_ENTITLEMENTS = ./task_policy_entitlement.plist
126794d3b452SApple OSS Distributions
126894d3b452SApple OSS DistributionsOTHER_TEST_TARGETS += task_policy_unentitled
126994d3b452SApple OSS Distributionstask_policy_unentitled: CODE_SIGN_ENTITLEMENTS = task_for_pid_entitlement.plist
127094d3b452SApple OSS Distributionstask_policy_unentitled: OTHER_CFLAGS += -DUNENTITLED
127194d3b452SApple OSS Distributionstask_policy_unentitled: task_policy.c
127294d3b452SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
127394d3b452SApple OSS Distributions	$(CODESIGN) --force --sign - --timestamp=none --entitlements $(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@
127494d3b452SApple OSS Distributions
127594d3b452SApple OSS Distributions
127694d3b452SApple OSS DistributionsEXCLUDED_SOURCES += get_shared_cache_address.c
127794d3b452SApple OSS Distributions
127894d3b452SApple OSS Distributions
127994d3b452SApple OSS Distributionsifneq ($(filter iPhoneOS MacOSX, $(PLATFORM)),)
128094d3b452SApple OSS DistributionsCUSTOM_TARGETS += get_shared_cache_address
128194d3b452SApple OSS Distributions
128294d3b452SApple OSS Distributionsget_shared_cache_address: INVALID_ARCHS = arm64 i386 x86_64
128394d3b452SApple OSS Distributionsget_shared_cache_address: get_shared_cache_address.c
128494d3b452SApple OSS Distributions	$(CC) $(OTHER_CFLAGS) $(CFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/get_shared_cache_address
128594d3b452SApple OSS Distributions
128694d3b452SApple OSS Distributionsinstall-get_shared_cache_address: get_shared_cache_address
128794d3b452SApple OSS Distributions	$(CODESIGN) --force --sign - --timestamp=none --identifier=com.apple.get_shared_cache_address $(SYMROOT)/get_shared_cache_address
128894d3b452SApple OSS Distributions	mkdir -p $(INSTALLDIR)
128994d3b452SApple OSS Distributions	cp $(SYMROOT)/get_shared_cache_address $(INSTALLDIR)/
129094d3b452SApple OSS Distributionsendif
129194d3b452SApple OSS Distributions
129294d3b452SApple OSS Distributions
129394d3b452SApple OSS DistributionsOTHER_TEST_TARGETS += vm_memory_share_tests
129494d3b452SApple OSS Distributions
129594d3b452SApple OSS Distributionsvm_memory_share_tests: INVALID_ARCHS = i386
129694d3b452SApple OSS Distributionsvm_memory_share_tests: CODE_SIGN_ENTITLEMENTS = ./task_for_pid_entitlement.plist
129794d3b452SApple OSS Distributionsvm_memory_share_tests: vm_memory_tests_src/main.c vm_memory_tests_src/common.c vm_memory_tests_src/vm_tests.c
129894d3b452SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
129994d3b452SApple OSS Distributions	echo $(CODESIGN) --force --sign - --timestamp=none --entitlements $(SRCROOT)/$(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@;
130094d3b452SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements "$(SRCROOT)/$(CODE_SIGN_ENTITLEMENTS)" $(SYMROOT)/$@;
130194d3b452SApple OSS Distributions
130294d3b452SApple OSS Distributions# build the mach server as individual helper which does not use libdarwintest
130394d3b452SApple OSS DistributionsCUSTOM_TARGETS += vm_memory_share_tests_server
130494d3b452SApple OSS Distributionsvm_memory_share_tests_server: CODE_SIGN_ENTITLEMENTS = ./task_for_pid_entitlement.plist
130594d3b452SApple 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
130694d3b452SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/vm_memory_share_tests_server
130794d3b452SApple OSS Distributions	echo $(CODESIGN) --force --sign - --timestamp=none --entitlements $(SRCROOT)/$(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@;
130894d3b452SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements "$(SRCROOT)/$(CODE_SIGN_ENTITLEMENTS)" $(SYMROOT)/$@;
130994d3b452SApple OSS Distributions
131094d3b452SApple OSS Distributionsinstall-vm_memory_share_tests_server: vm_memory_share_tests_server
131194d3b452SApple OSS Distributions	mkdir -p $(INSTALLDIR)
131294d3b452SApple OSS Distributions	cp $(SYMROOT)/vm_memory_share_tests_server $(INSTALLDIR)/
131394d3b452SApple OSS Distributions
131494d3b452SApple OSS Distributionsifeq ($(PLATFORM),MacOSX)
131594d3b452SApple OSS DistributionsEXCLUDED_SOURCES += vm/kern_max_task_pmem.c
131694d3b452SApple OSS Distributionsendif
131794d3b452SApple OSS Distributions
131894d3b452SApple OSS DistributionsEXCLUDED_SOURCES += benchmark/helpers.c
131994d3b452SApple OSS Distributions
132094d3b452SApple OSS Distributionsperf_vmfault: OTHER_CFLAGS += benchmark/helpers.c
132194d3b452SApple OSS Distributions
132294d3b452SApple OSS Distributionsvm/fault_throughput: OTHER_CFLAGS += benchmark/helpers.c
132394d3b452SApple OSS Distributions
132494d3b452SApple OSS Distributions.PHONY: install-vm/fault_throughput
132594d3b452SApple OSS Distributionsinstall-vm/fault_throughput: vm/fault_throughput
132694d3b452SApple OSS Distributions	mkdir -p $(INSTALLDIR)/vm
132794d3b452SApple OSS Distributions	cp $(SYMROOT)/vm/fault_throughput $(INSTALLDIR)/vm/
132894d3b452SApple OSS Distributions
132994d3b452SApple OSS Distributions$(SYMROOT)/vm/fault_throughput.lua: $(SRCROOT)/vm/fault_throughput.lua
133094d3b452SApple OSS Distributions	mkdir -p $(SYMROOT)/vm
133194d3b452SApple OSS Distributions	cp $< $@
133294d3b452SApple OSS Distributions	chmod +x $@
133394d3b452SApple OSS Distributions
133494d3b452SApple OSS Distributions.PHONY: install-fault_throughput_benchrun
133594d3b452SApple OSS Distributionsinstall-$(SYMROOT)/vm/fault_throughput.lua: $(SYMROOT)/vm/fault_throughput.lua
133694d3b452SApple OSS Distributions	mkdir -p $(INSTALLDIR)/vm
133794d3b452SApple OSS Distributions	cp $(SYMROOT)/vm/fault_throughput.lua $(INSTALLDIR)/vm/
133894d3b452SApple OSS Distributions	chmod +x $(INSTALLDIR)/vm/fault_throughput.lua
133994d3b452SApple OSS Distributions
134094d3b452SApple OSS DistributionsEXCLUDED_SOURCES += vm/fault_throughput.plist
134194d3b452SApple OSS Distributions
134294d3b452SApple OSS DistributionsCUSTOM_TARGETS += $(SYMROOT)/vm/fault_throughput.lua vm/fault_throughput
134394d3b452SApple OSS Distributions
134494d3b452SApple OSS Distributionsifeq ($(PLATFORM),MacOSX)
134594d3b452SApple OSS Distributionsmixed_pagesize: vm/mixed_pagesize.c
134694d3b452SApple OSS Distributions	mkdir -p $(SYMROOT)/vm
134794d3b452SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/vm/$@
134894d3b452SApple OSS Distributions
134994d3b452SApple OSS Distributionsinstall-mixed_pagesize: mixed_pagesize
135094d3b452SApple OSS Distributions	mkdir -p $(INSTALLDIR)/vm
135194d3b452SApple OSS Distributions	cp $(SYMROOT)/vm/mixed_pagesize $(INSTALLDIR)/vm/
135294d3b452SApple OSS Distributions
135394d3b452SApple OSS DistributionsBATS_PLISTS += $(SRCROOT)/vm/mixed_pagesize.plist
135494d3b452SApple OSS Distributions
135594d3b452SApple OSS DistributionsEXCLUDED_SOURCES += vm/mixed_pagesize.c vm/mixed_pagesize.plist
135694d3b452SApple OSS DistributionsCUSTOM_TARGETS += mixed_pagesize
135794d3b452SApple OSS Distributionselse
135894d3b452SApple OSS DistributionsEXCLUDED_SOURCES += vm/mixed_pagesize.c vm/mixed_pagesize.plist
135994d3b452SApple OSS Distributionsendif
136094d3b452SApple OSS Distributions
136194d3b452SApple OSS Distributionsmanual_wq_cooperative: manual_wq_cooperative.c
136294d3b452SApple OSS Distributions	mkdir -p $(SYMROOT)
136394d3b452SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
136494d3b452SApple OSS Distributions
136594d3b452SApple OSS Distributionsinstall-manual_wq_cooperative: manual_wq_cooperative
136694d3b452SApple OSS Distributions	mkdir -p $(INSTALLDIR)
136794d3b452SApple OSS Distributions	cp $(SYMROOT)/manual_wq_cooperative $(INSTALLDIR)
136894d3b452SApple OSS Distributions
136994d3b452SApple OSS DistributionsBATS_PLISTS += $(SRCROOT)/workqueue.plist
137094d3b452SApple OSS DistributionsEXCLUDED_SOURCES += manual_wq_cooperative.c workqueue.plist
137194d3b452SApple OSS DistributionsCUSTOM_TARGETS += manual_wq_cooperative
137294d3b452SApple OSS Distributions
137394d3b452SApple OSS Distributions# VM madvise(2) benchmark
137494d3b452SApple OSS Distributions
137594d3b452SApple OSS DistributionsBATS_PLISTS += $(SRCROOT)/vm/perf_madvise.plist
137694d3b452SApple OSS Distributions
137794d3b452SApple OSS Distributionsvm/perf_madvise: OTHER_CFLAGS += benchmark/helpers.c
137894d3b452SApple OSS Distributions
137994d3b452SApple OSS Distributions.PHONY: install-vm/perf_madvise
138094d3b452SApple OSS Distributionsinstall-vm/perf_madvise: vm/perf_madvise
138194d3b452SApple OSS Distributions	mkdir -p $(INSTALLDIR)/vm
138294d3b452SApple OSS Distributions	cp $(SYMROOT)/vm/perf_madvise $(INSTALLDIR)/vm/
138394d3b452SApple OSS Distributions
138494d3b452SApple OSS Distributions$(SYMROOT)/vm/perf_madvise.lua: $(SRCROOT)/vm/perf_madvise.lua
138594d3b452SApple OSS Distributions	mkdir -p $(SYMROOT)/vm
138694d3b452SApple OSS Distributions	cp $< $@
138794d3b452SApple OSS Distributions	chmod +x $@
138894d3b452SApple OSS Distributions
138994d3b452SApple OSS Distributions.PHONY: install-perf_madvise_benchrun
139094d3b452SApple OSS Distributionsinstall-$(SYMROOT)/vm/perf_madvise.lua: $(SYMROOT)/vm/perf_madvise.lua
139194d3b452SApple OSS Distributions	mkdir -p $(INSTALLDIR)/vm
139294d3b452SApple OSS Distributions	cp $(SYMROOT)/vm/perf_madvise.lua $(INSTALLDIR)/vm
139394d3b452SApple OSS Distributions	chmod +x $(INSTALLDIR)/vm/perf_madvise.lua
139494d3b452SApple OSS Distributions
139594d3b452SApple OSS DistributionsCUSTOM_TARGETS += $(SYMROOT)/vm/perf_madvise.lua vm/perf_madvise
139694d3b452SApple OSS Distributions
139794d3b452SApple OSS DistributionsBATS_PLISTS += $(SRCROOT)/vm/perf_compressor.plist
139894d3b452SApple OSS DistributionsEXCLUDED_SOURCES += vm/perf_compressor.plist
139994d3b452SApple OSS Distributions
140094d3b452SApple OSS Distributionsvm/perf_compressor: OTHER_CFLAGS += benchmark/helpers.c
140194d3b452SApple OSS Distributions
140294d3b452SApple OSS Distributions.PHONY: install-vm/perf_compressor
140394d3b452SApple OSS Distributionsinstall-vm/perf_compressor: vm/perf_compressor
140494d3b452SApple OSS Distributions	mkdir -p $(INSTALLDIR)/vm
140594d3b452SApple OSS Distributions	cp $(SYMROOT)/vm/perf_compressor $(INSTALLDIR)/vm/
140694d3b452SApple OSS Distributions
140794d3b452SApple OSS Distributions$(SYMROOT)/vm/perf_compressor.lua: $(SRCROOT)/vm/perf_compressor.lua
140894d3b452SApple OSS Distributions	mkdir -p $(SYMROOT)/vm
140994d3b452SApple OSS Distributions	cp $< $@
141094d3b452SApple OSS Distributions	chmod +x $@
141194d3b452SApple OSS Distributions
141294d3b452SApple OSS Distributions.PHONY: install-$(SYMROOT)/vm/perf_compressor_benchrun
141394d3b452SApple OSS Distributionsinstall-$(SYMROOT)/vm/perf_compressor.lua: $(SYMROOT)/vm/perf_compressor.lua
141494d3b452SApple OSS Distributions	mkdir -p $(INSTALLDIR)/vm
141594d3b452SApple OSS Distributions	cp $(SYMROOT)/vm/perf_compressor.lua $(INSTALLDIR)/vm/
141694d3b452SApple OSS Distributions	chmod +x $(INSTALLDIR)/vm/perf_compressor.lua
141794d3b452SApple OSS Distributions
141894d3b452SApple OSS DistributionsCUSTOM_TARGETS += $(SYMROOT)/vm/perf_compressor.lua vm/perf_compressor
141994d3b452SApple OSS Distributions
142094d3b452SApple OSS Distributionsioconnectasyncmethod_57641955: OTHER_LDFLAGS += -framework IOKit
142194d3b452SApple OSS Distributions
142294d3b452SApple OSS Distributionsifeq ($(PLATFORM),BridgeOS)
142394d3b452SApple OSS DistributionsEXCLUDED_SOURCES += ipsec.m
142494d3b452SApple OSS Distributionselse
142594d3b452SApple OSS Distributionsipsec: OTHER_LDFLAGS += -framework Foundation -framework CoreFoundation -framework NetworkExtension
142694d3b452SApple OSS Distributionsipsec: CODE_SIGN_ENTITLEMENTS = ipsec.entitlements
142794d3b452SApple OSS Distributionsendif
142894d3b452SApple OSS Distributions
142994d3b452SApple OSS Distributionstest_sysctl_kern_procargs_25397314: OTHER_LDFLAGS += -framework Foundation -ldarwintest_utils
143094d3b452SApple OSS Distributions
143194d3b452SApple OSS DistributionsINCLUDED_TEST_SOURCE_DIRS += counter
143294d3b452SApple OSS Distributions
143394d3b452SApple OSS DistributionsEXCLUDED_SOURCES += counter/common.c
143494d3b452SApple OSS Distributionscounter/counter: OTHER_CFLAGS += counter/common.c test_utils.c
143594d3b452SApple OSS Distributionscounter/counter: OTHER_LDFLAGS += -ldarwintest_utils -ldarwintest
143694d3b452SApple OSS Distributions
143794d3b452SApple OSS Distributionscounter/benchmark: OTHER_CFLAGS += counter/common.c benchmark/helpers.c
143894d3b452SApple OSS Distributions
143994d3b452SApple OSS Distributions.PHONY: install-counter/benchmark
144094d3b452SApple OSS Distributionsinstall-counter/benchmark: counter/benchmark
144194d3b452SApple OSS Distributions	mkdir -p $(INSTALLDIR)/counter
144294d3b452SApple OSS Distributions	cp $(SYMROOT)/counter/benchmark $(INSTALLDIR)/counter/
144394d3b452SApple OSS Distributions
144494d3b452SApple OSS Distributions$(SYMROOT)/counter/benchmark.lua: $(SRCROOT)/counter/benchmark.lua
144594d3b452SApple OSS Distributions	mkdir -p $(SYMROOT)/counter
144694d3b452SApple OSS Distributions	cp $< $@
144794d3b452SApple OSS Distributions	chmod +x $@
144894d3b452SApple OSS Distributions
144994d3b452SApple OSS Distributions.PHONY: install-counter_benchrun
145094d3b452SApple OSS Distributionsinstall-$(SYMROOT)/counter/benchmark.lua: $(SYMROOT)/counter/benchmark.lua
145194d3b452SApple OSS Distributions	mkdir -p $(INSTALLDIR)/counter
145294d3b452SApple OSS Distributions	cp $(SYMROOT)/counter/benchmark.lua $(INSTALLDIR)/counter/
145394d3b452SApple OSS Distributions	chmod +x $(INSTALLDIR)/counter/benchmark.lua
145494d3b452SApple OSS Distributions
145594d3b452SApple OSS DistributionsCUSTOM_TARGETS += $(SYMROOT)/counter/benchmark.lua counter/benchmark
145694d3b452SApple OSS Distributions
145794d3b452SApple OSS Distributionsifneq ($(PLATFORM),MacOSX)
145894d3b452SApple OSS DistributionsEXCLUDED_SOURCES += vm/page_size_globals.c
145994d3b452SApple OSS Distributionselse
146094d3b452SApple OSS Distributionsvm/page_size_globals: INVALID_ARCHS = arm64 arm64e
146194d3b452SApple OSS Distributionsendif
146294d3b452SApple OSS Distributions
146394d3b452SApple OSS Distributions# Same helper used in execperf, different build system.
146494d3b452SApple OSS Distributionsstatic_binary: ../tools/tests/execperf/exit-asm.S
146594d3b452SApple 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
146694d3b452SApple OSS Distributions	CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/static_binary
146794d3b452SApple OSS Distributions
146894d3b452SApple OSS Distributionsinstall-static_binary: static_binary
146994d3b452SApple OSS Distributions	mkdir -p $(INSTALLDIR)
147094d3b452SApple OSS Distributions	cp $(SYMROOT)/static_binary $(INSTALLDIR)
147194d3b452SApple OSS Distributions
147294d3b452SApple OSS DistributionsCUSTOM_TARGETS += static_binary
147394d3b452SApple OSS DistributionsEXCLUDED_SOURCES += static_binary.c
147494d3b452SApple OSS Distributions
147594d3b452SApple OSS Distributionstest_static_binary_csflags: static_binary
147694d3b452SApple OSS Distributionstest_static_binary_csflags: OTHER_LDFLAGS += -ldarwintest_utils
147794d3b452SApple OSS Distributions
147894d3b452SApple OSS Distributions
147994d3b452SApple OSS Distributionslibmalloc_apple_array: CODE_SIGN_ENTITLEMENTS = entitlements/libmalloc_apple_array.entitlements
148094d3b452SApple OSS Distributionslibmalloc_apple_array: OTHER_CFLAGS += -DENTITLED=1 drop_priv.c test_utils.c
148194d3b452SApple OSS Distributionslibmalloc_apple_array: OTHER_LDFLAGS += -ldarwintest_utils
148294d3b452SApple OSS Distributionslibmalloc_apple_array: libmalloc_apple_array.c print_apple_array print_apple_array_HR1 print_apple_array_HR2
148394d3b452SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
148494d3b452SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements $(CODE_SIGN_ENTITLEMENTS) $(SYMROOT)/$@;
148594d3b452SApple OSS Distributions
148694d3b452SApple OSS Distributionslibmalloc_apple_array_unentitled: OTHER_CFLAGS += drop_priv.c test_utils.c
148794d3b452SApple OSS Distributionslibmalloc_apple_array_unentitled: OTHER_LDFLAGS += -ldarwintest_utils
148894d3b452SApple OSS Distributionslibmalloc_apple_array_unentitled: libmalloc_apple_array.c print_apple_array print_apple_array_HR1 print_apple_array_HR2
148994d3b452SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $(OTHER_CFLAGS) $< -o $(SYMROOT)/$@
149094d3b452SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
149194d3b452SApple OSS Distributions
149294d3b452SApple OSS DistributionsCUSTOM_TARGETS += print_apple_array
149394d3b452SApple OSS Distributionsprint_apple_array: print_apple_array.c
149494d3b452SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
149594d3b452SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
149694d3b452SApple OSS Distributions
149794d3b452SApple OSS DistributionsCUSTOM_TARGETS += print_apple_array_HR1
149894d3b452SApple OSS Distributionsprint_apple_array_HR1: CODE_SIGN_ENTITLEMENTS=entitlements/hardened-binary-entitlements-1.plist
149994d3b452SApple OSS Distributionsprint_apple_array_HR1: print_apple_array.c
150094d3b452SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
150194d3b452SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --entitlements $(SRCROOT)/$(CODE_SIGN_ENTITLEMENTS) --timestamp=none $(SYMROOT)/$@;
150294d3b452SApple OSS Distributions
150394d3b452SApple OSS DistributionsCUSTOM_TARGETS += print_apple_array_HR2
150494d3b452SApple OSS Distributionsprint_apple_array_HR2: CODE_SIGN_ENTITLEMENTS=entitlements/hardened-binary-entitlements-2.plist
150594d3b452SApple OSS Distributionsprint_apple_array_HR2: print_apple_array.c
150694d3b452SApple OSS Distributions	$(CC) $(DT_CFLAGS) -I $(OBJROOT) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
150794d3b452SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --entitlements $(SRCROOT)/$(CODE_SIGN_ENTITLEMENTS) --timestamp=none $(SYMROOT)/$@;
150894d3b452SApple OSS Distributions
150994d3b452SApple OSS Distributions
151094d3b452SApple OSS Distributionsinstall-print_apple_array: print_apple_array
151194d3b452SApple OSS Distributions	mkdir -p $(INSTALLDIR)/tools
151294d3b452SApple OSS Distributions	cp $(SYMROOT)/print_apple_array $(INSTALLDIR)/tools/
151394d3b452SApple OSS Distributions
151494d3b452SApple OSS Distributionsinstall-print_apple_array_HR1: print_apple_array_HR1
151594d3b452SApple OSS Distributions	mkdir -p $(INSTALLDIR)/tools
151694d3b452SApple OSS Distributions	cp $(SYMROOT)/print_apple_array_HR1 $(INSTALLDIR)/tools/
151794d3b452SApple OSS Distributions
151894d3b452SApple OSS Distributionsinstall-print_apple_array_HR2: print_apple_array_HR2
151994d3b452SApple OSS Distributions	mkdir -p $(INSTALLDIR)/tools
152094d3b452SApple OSS Distributions	cp $(SYMROOT)/print_apple_array_HR2 $(INSTALLDIR)/tools/
152194d3b452SApple OSS Distributions
152294d3b452SApple OSS Distributionspersona: CODE_SIGN_ENTITLEMENTS = persona.entitlements
152394d3b452SApple OSS Distributionspersona_adoption: CODE_SIGN_ENTITLEMENTS = persona_adoption.entitlements
152494d3b452SApple OSS Distributions
152594d3b452SApple OSS DistributionsOTHER_TEST_TARGETS += libmalloc_apple_array libmalloc_apple_array_unentitled
152694d3b452SApple OSS Distributions
152794d3b452SApple OSS Distributionsentropy: OTHER_CFLAGS += -framework perfdata
152894d3b452SApple OSS Distributions
152994d3b452SApple OSS Distributionsdebug_enable_syscall_rejection: OTHER_LDFLAGS += -ldarwintest_utils
153094d3b452SApple OSS Distributions
15318d741a5dSApple OSS DistributionsINCLUDED_TEST_SOURCE_DIRS += sched
15328d741a5dSApple OSS Distributionsinclude sched/Makefile
153394d3b452SApple OSS Distributions
15348d741a5dSApple OSS Distributionsthread_set_state_arm64_cpsr: CODE_SIGN_ENTITLEMENTS = entitlements/thread_set_state.entitlement
153594d3b452SApple OSS Distributions
153694d3b452SApple OSS Distributionsvm/app_swap: OTHER_LDFLAGS += -ldarwintest_utils
153794d3b452SApple OSS Distributions
153894d3b452SApple OSS DistributionsCUSTOM_TARGETS += debug_syscall_rejection_helper
153994d3b452SApple OSS Distributionsdebug_syscall_rejection_helper: debug_syscall_rejection_helper.c
154094d3b452SApple OSS Distributions	$(CC) $(OTHER_CFLAGS) $(CFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@; \
154194d3b452SApple OSS Distributions	echo $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@; \
154294d3b452SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/$@;
154394d3b452SApple OSS Distributions
154494d3b452SApple OSS Distributions
154594d3b452SApple OSS Distributionsinstall-debug_syscall_rejection_helper: debug_syscall_rejection_helper
154694d3b452SApple OSS Distributions	mkdir -p $(INSTALLDIR)
154794d3b452SApple OSS Distributions	cp $(SYMROOT)/debug_syscall_rejection_helper $(INSTALLDIR)/
154894d3b452SApple OSS Distributions
154994d3b452SApple OSS Distributionsfile_leases: OTHER_CFLAGS += test_utils.c
155094d3b452SApple OSS Distributionsfile_leases: OTHER_LDFLAGS += -ldarwintest_utils
155194d3b452SApple OSS Distributionsfile_leases: CODE_SIGN_ENTITLEMENTS = file_leases.entitlements
155294d3b452SApple OSS Distributions
1553*4f1223e8SApple OSS Distributionsiopolicy: OTHER_LDFLAGS += -ldarwintest_utils
1554*4f1223e8SApple OSS Distributionsiopolicy: CODE_SIGN_ENTITLEMENTS = iopolicy.entitlements
1555*4f1223e8SApple OSS Distributions
155694d3b452SApple OSS DistributionsINCLUDED_TEST_SOURCE_DIRS += vfs
155794d3b452SApple OSS Distributionsvfs/freeable_vnodes: OTHER_LDFLAGS += -ldarwintest_utils
155894d3b452SApple OSS Distributions
155994d3b452SApple OSS Distributionsvm/vm_reclaim: OTHER_CFLAGS += -Wno-language-extension-token -Wno-c++98-compat memorystatus_assertion_helpers.c
156094d3b452SApple OSS Distributionsvm/vm_reclaim: OTHER_LDFLAGS += -ldarwintest_utils
156194d3b452SApple OSS Distributions
156294d3b452SApple OSS Distributionsvm/vm_reclaim: INVALID_ARCHS = armv7k arm64_32
156394d3b452SApple OSS Distributions
156494d3b452SApple OSS DistributionsEXCLUDED_SOURCES += constrained_ctypes_tests.c
156594d3b452SApple OSS DistributionsCUSTOM_TARGETS += constrained_ctypes_tests_enabled constrained_ctypes_tests_enacted constrained_ctypes_tests_disabled
156694d3b452SApple OSS Distributionsconstrained_ctypes_tests_enabled: OTHER_CFLAGS += -D__CCT_TEST_ENABLED
156794d3b452SApple OSS Distributionsconstrained_ctypes_tests_enabled: OTHER_LDFLAGS += -ldarwintest_utils
156894d3b452SApple OSS Distributionsconstrained_ctypes_tests_enabled: constrained_ctypes_tests.c
156994d3b452SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) constrained_ctypes_tests.c -o $(SYMROOT)/constrained_ctypes_tests_enabled
157094d3b452SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/constrained_ctypes_tests_enabled;
157194d3b452SApple OSS Distributions
157294d3b452SApple OSS Distributionsinstall-constrained_ctypes_tests_enabled: constrained_ctypes_tests_enabled
157394d3b452SApple OSS Distributions	mkdir -p $(INSTALLDIR)
157494d3b452SApple OSS Distributions	cp $(SYMROOT)/constrained_ctypes_tests_enabled $(INSTALLDIR)/
157594d3b452SApple OSS Distributions
157694d3b452SApple OSS Distributionsconstrained_ctypes_tests_enacted: OTHER_CFLAGS += -D__CCT_TEST_ENABLED
157794d3b452SApple OSS Distributionsconstrained_ctypes_tests_enacted: OTHER_CFLAGS += -D__CCT_TEST_ENACTED
15788d741a5dSApple OSS Distributionsconstrained_ctypes_tests_enacted: OTHER_CFLAGS += -fbounds-safety
157994d3b452SApple OSS Distributionsconstrained_ctypes_tests_enacted: OTHER_LDFLAGS += -ldarwintest_utils
158094d3b452SApple OSS Distributionsconstrained_ctypes_tests_enacted: constrained_ctypes_tests.c
158194d3b452SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) constrained_ctypes_tests.c -o $(SYMROOT)/constrained_ctypes_tests_enacted
158294d3b452SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/constrained_ctypes_tests_enacted;
158394d3b452SApple OSS Distributions
158494d3b452SApple OSS Distributionsinstall-constrained_ctypes_tests_enacted: constrained_ctypes_tests_enacted
158594d3b452SApple OSS Distributions	mkdir -p $(INSTALLDIR)
158694d3b452SApple OSS Distributions	cp $(SYMROOT)/constrained_ctypes_tests_enacted $(INSTALLDIR)/
158794d3b452SApple OSS Distributions
158894d3b452SApple OSS Distributions
158994d3b452SApple OSS Distributionsconstrained_ctypes_tests_disabled: OTHER_LDFLAGS += -ldarwintest_utils
159094d3b452SApple OSS Distributionsconstrained_ctypes_tests_disabled: constrained_ctypes_tests.c
159194d3b452SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) constrained_ctypes_tests.c -o $(SYMROOT)/constrained_ctypes_tests_disabled
159294d3b452SApple OSS Distributions	env CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none $(SYMROOT)/constrained_ctypes_tests_disabled;
159394d3b452SApple OSS Distributions
159494d3b452SApple OSS Distributionsinstall-constrained_ctypes_tests_disabled: constrained_ctypes_tests_disabled
159594d3b452SApple OSS Distributions	mkdir -p $(INSTALLDIR)
159694d3b452SApple OSS Distributions	cp $(SYMROOT)/constrained_ctypes_tests_disabled $(INSTALLDIR)/
159794d3b452SApple OSS Distributions
159894d3b452SApple OSS Distributionstask_suspend_stats: OTHER_LDFLAGS += -ldarwintest_utils
159994d3b452SApple OSS Distributionstask_suspend_stats: CODE_SIGN_ENTITLEMENTS = task_for_pid_entitlement.plist
160094d3b452SApple OSS Distributions
160194d3b452SApple OSS Distributions# os_atomic use throws this warning
16028d741a5dSApple OSS Distributionssetitimer: OTHER_CFLAGS += -Wno-c++98-compat -framework perfdata
16038d741a5dSApple OSS Distributionssetitimer: OTHER_LDFLAGS += -framework perfdata
160494d3b452SApple OSS Distributions
160594d3b452SApple OSS Distributions
160694d3b452SApple OSS Distributionsinclude $(DEVELOPER_DIR)/AppleInternal/Makefiles/darwintest/Makefile.targets
160794d3b452SApple OSS Distributions
16088d741a5dSApple OSS Distributionsexception_ports_info: CODE_SIGN_ENTITLEMENTS = entitlements/set_exception_port.entitlement
1609*4f1223e8SApple OSS Distributions
1610*4f1223e8SApple OSS Distributionsmemorystatus_experiment_factors: CODESIGN_ENTITLEMENTS=./memorystatus/memorystatus_experiment_factors.entitlements
1611*4f1223e8SApple OSS Distributionsmemorystatus_experiment_factors: memorystatus/memorystatus_experiment_factors.c
1612*4f1223e8SApple OSS Distributions	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
1613*4f1223e8SApple OSS Distributions	$(ENV) CODESIGN_ALLOCATE=$(CODESIGN_ALLOCATE) $(CODESIGN) --force --sign - --timestamp=none --entitlements $(CODESIGN_ENTITLEMENTS) $(SYMROOT)/$@;
1614*4f1223e8SApple OSS Distributions
1615