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