1export MakeInc_cmd=${SRCROOT}/makedefs/MakeInc.cmd 2export MakeInc_def=${SRCROOT}/makedefs/MakeInc.def 3export MakeInc_rule=${SRCROOT}/makedefs/MakeInc.rule 4export MakeInc_dir=${SRCROOT}/makedefs/MakeInc.dir 5 6include $(MakeInc_cmd) 7include $(MakeInc_def) 8 9INSTINC_SUBDIRS = \ 10 _types 11 12EXPINC_SUBDIRS = \ 13 _types 14 15# Files that are public on macOS, but private on embedded 16EMBEDDED_PRIVATE_DATAFILES = \ 17 disk.h ioctl_compat.h kdebug.h kern_control.h kernel_types.h proc_info.h reboot.h ttychars.h ttydev.h vnode.h 18 19ifeq ($(filter $(SUPPORTED_EMBEDDED_PLATFORMS) $(SUPPORTED_SIMULATOR_PLATFORMS),$(PLATFORM)),) 20EXTRA_DATAFILES = $(EMBEDDED_PRIVATE_DATAFILES) 21else 22EXTRA_PRIVATE_DATAFILES = $(EMBEDDED_PRIVATE_DATAFILES) 23endif 24 25# Installs header file for user level - 26# $(DSTROOT)/System/Library/Frameworks/System.framework/PrivateHeaders 27# $(DSTROOT)/usr/include/ 28# Most of these are covered by CoreOSModuleMaps because some of them are mixed 29# in with related headers in other directories from other projects, or mixed 30# in with headers from other projects in sys/. 31DATAFILES = $(sort \ 32 appleapiopts.h acct.h aio.h attr.h \ 33 buf.h cdefs.h clonefile.h conf.h constrained_ctypes.h \ 34 dir.h dirent.h dkstat.h dtrace.h dtrace_glue.h dtrace_impl.h \ 35 errno.h ev.h event.h fasttrap.h fasttrap_isa.h fcntl.h file.h filedesc.h filio.h fsgetpath.h gmon.h \ 36 ioccom.h ioctl.h \ 37 ipc.h kernel.h kern_event.h lctx.h loadable_fs.h lock.h lockf.h \ 38 kauth.h kdebug_signpost.h lockstat.h malloc.h \ 39 mbuf.h mman.h mount.h msg.h msgbuf.h netport.h param.h paths.h pipe.h poll.h \ 40 proc.h ptrace.h queue.h quota.h resource.h resourcevar.h \ 41 sbuf.h posix_sem.h posix_shm.h random.h sdt.h\ 42 select.h sem.h semaphore.h shm.h signal.h signalvar.h snapshot.h socket.h socketvar.h sockio.h stat.h stdio.h \ 43 sysctl.h syslimits.h syslog.h sys_domain.h termios.h time.h \ 44 timeb.h times.h trace.h tty.h ttycom.h \ 45 ttydefaults.h types.h ubc.h ucontext.h ucred.h uio.h un.h unistd.h unpcb.h \ 46 user.h utfconv.h utsname.h vadvise.h vcmd.h \ 47 vm.h vmmeter.h vmparam.h vnode_if.h vsock.h vstat.h wait.h xattr.h \ 48 _select.h _structs.h _types.h _endian.h __endian.h domain.h protosw.h \ 49 spawn.h timex.h commpage.h log_data.h \ 50 $(EXTRA_DATAFILES)) 51 52# Installs header file for DriverKit drivers - 53# $(DSTROOT)/System/DriverKit/System/usr/include/ 54DRIVERKIT_DATAFILES = \ 55 cdefs.h _types.h _endian.h __endian.h time.h 56 57# Installs header file for Apple internal use in user level - 58# $(DSTROOT)/System/Library/Frameworks/System.framework/PrivateHeaders 59# These are covered by CoreOSModuleMaps because they're mixed in with headers 60# from other projects in sys/. 61PRIVATE_DATAFILES = $(sort \ 62 attr.h \ 63 attr_private.h \ 64 cdefs.h \ 65 clonefile.h \ 66 coalition.h \ 67 coalition_private.h \ 68 codesign.h \ 69 constrained_ctypes.h \ 70 content_protection.h \ 71 crossarch.h \ 72 csr.h \ 73 decmpfs.h \ 74 dirent_private.h \ 75 disk.h \ 76 disklabel.h \ 77 domain.h \ 78 event.h \ 79 event_log.h \ 80 event_private.h \ 81 fcntl.h \ 82 fileport.h \ 83 fsctl.h \ 84 fsevents.h \ 85 fsgetpath.h \ 86 fsgetpath_private.h \ 87 fslog.h \ 88 guarded.h \ 89 imgsrc.h \ 90 ipcs.h \ 91 kas_info.h \ 92 kdebug.h \ 93 kdebug_private.h \ 94 kdebug_triage.h \ 95 kern_debug.h \ 96 kern_event.h \ 97 kern_memorystatus.h \ 98 kern_memorystatus_freeze.h \ 99 kern_overrides.h \ 100 kern_sysctl.h \ 101 mbuf.h \ 102 mman.h \ 103 monotonic.h \ 104 persona.h \ 105 preoslog.h \ 106 priv.h \ 107 proc.h \ 108 proc_info_private.h \ 109 proc_uuid_policy.h \ 110 process_policy.h \ 111 reason.h \ 112 resource.h \ 113 resource_private.h \ 114 sfi.h \ 115 shm_internal.h \ 116 snapshot.h \ 117 socket.h \ 118 socket_private.h \ 119 socketvar.h \ 120 sockio.h \ 121 sockio_private.h \ 122 spawn.h \ 123 spawn_internal.h \ 124 stackshot.h \ 125 sys_domain.h \ 126 tree.h \ 127 ulock.h \ 128 unpcb.h \ 129 ux_exception.h \ 130 variant_internal.h \ 131 vsock.h \ 132 work_interval.h \ 133 process_policy.h \ 134 proc_uuid_policy.h \ 135 priv.h \ 136 pgo.h \ 137 memory_maintenance.h \ 138 commpage.h \ 139 $(EXTRA_PRIVATE_DATAFILES)) 140 141# Installs header file for Apple internal use by DriverKit drivers - 142# $(DSTROOT)/System/DriverKit/System/usr/local/include/ 143DRIVERKIT_PRIVATE_DATAFILES = \ 144 appleapiopts.h kdebug.h kdebug_private.h queue.h 145 146# Installs header file for kernel extensions - 147# $(DSTROOT)/System/Library/Frameworks/Kernel.framework/Headers 148# $(DSTROOT)/System/Library/Frameworks/Kernel.framework/PrivateHeaders 149KERNELFILES = \ 150 appleapiopts.h attr.h \ 151 buf.h cdefs.h conf.h constrained_ctypes.h \ 152 dir.h dirent.h disk.h disklabel.h dkstat.h \ 153 errno.h ev.h event.h fcntl.h file.h filio.h \ 154 ioccom.h ioctl.h ipc.h \ 155 ioctl_compat.h kernel.h kernel_types.h kern_event.h lock.h lockf.h \ 156 kauth.h kdebug.h kdebug_private.h kdebug_kernel.h md5.h kern_control.h \ 157 imgact.h malloc.h namei.h mman.h mbuf.h mount.h netport.h param.h paths.h \ 158 proc.h queue.h random.h resource.h \ 159 sbuf.h posix_sem.h posix_shm.h resource_private.h sem.h shm.h \ 160 select.h signal.h socket.h socketvar.h sockio.h stat.h stdio.h \ 161 sysctl.h syslimits.h syslog.h systm.h sys_domain.h time.h \ 162 types.h ubc.h ucontext.h ucred.h uio.h un.h unistd.h unpcb.h \ 163 utfconv.h unicode.h vm.h vmparam.h vnode.h vnode_if.h vsock.h xattr.h \ 164 _select.h _structs.h _types.h _endian.h __endian.h protosw.h domain.h \ 165 kpi_mbuf.h kpi_socket.h kpi_socketfilter.h \ 166 ttycom.h termios.h msg.h \ 167 wait.h \ 168 spawn.h timex.h commpage.h 169# The last line was added to export needed headers for the MAC calls 170# whose source is outside of the xnu/bsd tree. 171 172# Installs header file for Apple internal use for kernel extensions - 173# $(DSTROOT)/System/Library/Frameworks/Kernel.framework/PrivateHeaders 174PRIVATE_KERNELFILES = \ 175 acct.h \ 176 attr_private.h \ 177 codesign.h \ 178 cprotect.h \ 179 content_protection.h \ 180 csr.h \ 181 decmpfs.h \ 182 dirent_private.h \ 183 disktab.h \ 184 eventhandler.h \ 185 event_log.h \ 186 event_private.h \ 187 fbt.h \ 188 fileport.h \ 189 fsctl.h \ 190 fslog.h \ 191 kern_memorystatus.h \ 192 kern_memorystatus_freeze.h \ 193 kpi_private.h \ 194 ktrace.h \ 195 kdebug_triage.h \ 196 linker_set.h \ 197 mach_swapon.h \ 198 monotonic.h \ 199 msgbuf.h \ 200 eventvar.h \ 201 persona.h \ 202 preoslog.h \ 203 proc_info.h \ 204 proc_info_private.h \ 205 pthread_shims.h \ 206 quota.h \ 207 reboot.h \ 208 resourcevar.h \ 209 sem_internal.h \ 210 shm_internal.h \ 211 signalvar.h \ 212 socket_private.h \ 213 sockio_private.h \ 214 stackshot.h \ 215 timeb.h times.h \ 216 tprintf.h \ 217 tty.h ttychars.h \ 218 ttydefaults.h ttydev.h \ 219 user.h \ 220 variant_internal.h \ 221 vfs_context.h \ 222 vmmeter.h \ 223 reason.h \ 224 spawn_internal.h \ 225 priv.h \ 226 pgo.h \ 227 memory_maintenance.h \ 228 doc_tombstone.h \ 229 fsevents.h \ 230 work_interval.h \ 231 kern_sysctl.h \ 232 vsock_transport.h \ 233 trust_caches.h \ 234 code_signing.h \ 235 lockdown_mode.h \ 236 237XNU_ONLY_EXPORTS = \ 238 bsdtask_info.h \ 239 file_internal.h \ 240 filedesc.h \ 241 guarded.h \ 242 mount_internal.h \ 243 munge.h \ 244 pipe.h \ 245 proc_internal.h \ 246 proc_require.h \ 247 proc_ro.h \ 248 pthread_internal.h \ 249 resourcevar.h \ 250 semaphore.h \ 251 tree.h \ 252 uio_internal.h \ 253 ulock.h \ 254 ux_exception.h \ 255 vnode_internal.h \ 256 vsock_domain.h \ 257 code_signing_internal.h \ 258 trusted_execution_monitor.h \ 259 coalition.h 260 261# /usr/include 262INSTALL_MI_LIST = ${DATAFILES} 263 264INSTALL_DRIVERKIT_MI_LIST = ${DRIVERKIT_DATAFILES} 265 266INSTALL_MI_GEN_LIST = syscall.h _posix_availability.h _symbol_aliasing.h 267 268INSTALL_DRIVERKIT_MI_GEN_LIST = _posix_availability.h _symbol_aliasing.h 269 270INSTALL_MI_DIR = sys 271 272EXPORT_MI_LIST = $(sort ${KERNELFILES} ${PRIVATE_KERNELFILES} ${XNU_ONLY_EXPORTS}) 273 274EXPORT_MI_GEN_LIST = syscall.h sysproto.h 275 276EXPORT_MI_DIR = sys 277 278# /usr/local/include 279INSTALL_MI_LCL_LIST = $(sort \ 280 attr_private.h coalition_private.h code_signing.h codesign.h content_protection.h csr.h decmpfs.h dirent_private.h \ 281 event_log.h event_private.h fsevents.h fsgetpath_private.h guarded.h kdebug_private.h \ 282 kern_memorystatus.h preoslog.h proc_info_private.h reason.h resource_private.h \ 283 socket_private.h sockio_private.h stackshot.h work_interval.h ${EXTRA_PRIVATE_DATAFILES}) 284 285# /System/Library/Frameworks/System.framework/PrivateHeaders 286INSTALL_SF_MI_LCL_LIST = ${DATAFILES} ${PRIVATE_DATAFILES} 287 288INSTALL_SF_MI_LCL_GEN_LIST = ${INSTALL_MI_GEN_LIST} 289 290INSTALL_DRIVERKIT_MI_LCL_LIST = ${DRIVERKIT_PRIVATE_DATAFILES} 291 292# /System/Library/Frameworks/Kernel.framework/PrivateHeaders 293INSTALL_KF_MI_LCL_LIST = ${KERNELFILES} ${PRIVATE_KERNELFILES} 294 295INSTALL_KF_MI_LCL_GEN_LIST = sysproto.h 296 297# /System/Library/Frameworks/Kernel.framework/Headers 298INSTALL_KF_MI_LIST = ${KERNELFILES} 299 300INSTALL_KF_MI_GEN_LIST = 301 302MAKESYSCALLS = $(SRCROOT)/bsd/kern/makesyscalls.sh 303 304$(OBJROOT)/cscope.genhdrs: 305 $(_v)mkdir -p $(OBJROOT)/cscope.genhdrs 306 307$(OBJROOT)/syscall.codes: $(TARGET)/bsd.syscalls.master 308 @$(LOG_GENERATE) "$(ColorLF)$@$(Color0) from $(ColorF)$(<F)$(Color0)" 309 $(_v)$(MAKESYSCALLS) $< trace > $@ 310 311 312$(OBJROOT)/trace.codes: $(SRCROOT)/bsd/kern/trace_codes $(OBJROOT)/syscall.codes 313 $(_v)sort -g $(SRCROOT)/bsd/kern/trace_codes $(OBJROOT)/syscall.codes >$@ 314 315syscall.h: $(TARGET)/bsd.syscalls.master $(OBJROOT)/cscope.genhdrs 316 @$(LOG_GENERATE) "$(ColorLF)bsd/sys/$@$(Color0) from $(ColorF)$(<F)$(Color0)" 317 @echo "$(OBJPATH)/bsd/sys/$@" > $(OBJROOT)/cscope.genhdrs/$@.path 318 $(_v)$(MAKESYSCALLS) $< header > /dev/null 319 320sysproto.h: $(TARGET)/bsd.syscalls.master $(OBJROOT)/cscope.genhdrs 321 @$(LOG_GENERATE) "bsd/sys/$@$(Color0) from $(ColorF)$(<F)$(Color0)" 322 @echo "$(OBJPATH)/bsd/sys/$@" > $(OBJROOT)/cscope.genhdrs/$@.path 323 $(_v)$(MAKESYSCALLS) $< proto > /dev/null 324 325MAKE_POSIX_AVAILABILITY = $(SRCROOT)/bsd/sys/make_posix_availability.sh 326_posix_availability.h: $(MAKE_POSIX_AVAILABILITY) 327 @$(LOG_GENERATE) "bsd/sys/$@$(Color0)" 328 $(_v)$(MAKE_POSIX_AVAILABILITY) "$@" 329 330MAKE_SYMBOL_ALIASING = $(SRCROOT)/bsd/sys/make_symbol_aliasing.sh 331_symbol_aliasing.h: $(MAKE_SYMBOL_ALIASING) 332 @$(LOG_GENERATE) "bsd/sys/$@$(Color0)" 333 $(_v)$(MAKE_SYMBOL_ALIASING) "$(SDKROOT)" "$@" 334 335# generated headers needed early (used by iig during installhdrs of iokit/DriverKit) 336SETUP_GEN_LIST = _posix_availability.h _symbol_aliasing.h 337ifneq ($(filter 1,$(EXCLAVEKIT) $(EXCLAVECORE)),) 338SETUP_GEN_LIST = 339endif 340 341do_build_setup:: $(SETUP_GEN_LIST) 342 343TRACE_CODES_DEST = \ 344 $(DSTROOT)/$(INSTALL_SHARE_MISC_DIR)/trace.codes 345 346$(TRACE_CODES_DEST): $(OBJROOT)/trace.codes 347 $(_v)$(MKDIR) $(DSTROOT)/$(INSTALL_SHARE_MISC_DIR) 348 @$(LOG_INSTALL) "$(@F)" 349 $(_v)$(INSTALL) $(INSTALL_FLAGS) $(OBJROOT)/trace.codes $@ 350 351do_textfiles_install_mi:: $(TRACE_CODES_DEST) 352 353ARIADNE_PLISTS = \ 354 xnu_exclaves.plist \ 355 xnu_epoch_sync.plist \ 356 xnu_suspension.plist 357 358ARIADNE_PLISTS_SRC = $(patsubst %,$(SRCROOT)/bsd/kern/ariadne_plists/%,$(ARIADNE_PLISTS)) 359ARIADNE_PLISTS_DEST = $(patsubst %,$(DSTROOT)/$(INSTALL_ARIADNE_PLISTS_DIR)/%,$(ARIADNE_PLISTS)) 360 361$(ARIADNE_PLISTS_DEST): $(ARIADNE_PLISTS_SRC) 362 $(_v)$(MKDIR) $(DSTROOT)/$(INSTALL_ARIADNE_PLISTS_DIR) 363 @$(LOG_INSTALL) "$(@F)" 364 $(_v)$(INSTALL) $(INSTALL_FLAGS) $< $@ 365 366do_textfiles_install_mi:: $(ARIADNE_PLISTS_DEST) 367 368include $(MakeInc_rule) 369include $(MakeInc_dir) 370