]> git.saurik.com Git - apple/xnu.git/blame - bsd/sys/Makefile
xnu-6153.41.3.tar.gz
[apple/xnu.git] / bsd / sys / Makefile
CommitLineData
1c79356b
A
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
1c79356b
A
6include $(MakeInc_cmd)
7include $(MakeInc_def)
8
39236c6e
A
9INSTINC_SUBDIRS = \
10 _types
593a1d5f 11
39236c6e
A
12EXPINC_SUBDIRS = \
13 _types
1c79356b 14
39037602 15# Installs header file for user level -
2d21ac55
A
16# $(DSTROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
17# $(DSTROOT)/usr/include/
1c79356b 18DATAFILES = \
39037602
A
19 appleapiopts.h acct.h aio.h attr.h \
20 buf.h cdefs.h clonefile.h conf.h \
2d21ac55 21 dir.h dirent.h disk.h dkstat.h dtrace.h dtrace_glue.h dtrace_impl.h \
5ba3f43e 22 errno.h ev.h event.h fasttrap.h fasttrap_isa.h fcntl.h file.h filedesc.h filio.h fsgetpath.h gmon.h \
91447636 23 ioccom.h ioctl.h \
3e170ce0 24 ioctl_compat.h ipc.h kernel.h kernel_types.h kern_event.h lctx.h loadable_fs.h lock.h lockf.h \
39037602 25 kauth.h kdebug.h kdebug_signpost.h kern_control.h lockstat.h malloc.h \
b0d623f7 26 mbuf.h mman.h mount.h msg.h msgbuf.h netport.h param.h paths.h pipe.h poll.h \
39037602
A
27 proc.h proc_info.h ptrace.h queue.h quota.h reboot.h resource.h resourcevar.h \
28 sbuf.h posix_sem.h posix_shm.h random.h sdt.h\
5ba3f43e 29 select.h sem.h semaphore.h shm.h signal.h signalvar.h snapshot.h socket.h socketvar.h sockio.h stat.h stdio.h \
b0d623f7 30 sysctl.h syslimits.h syslog.h sys_domain.h termios.h time.h \
1c79356b 31 timeb.h times.h tprintf.h trace.h tty.h ttychars.h ttycom.h \
9bccf70c 32 ttydefaults.h ttydev.h types.h ubc.h ucontext.h ucred.h uio.h un.h unistd.h unpcb.h \
2d21ac55 33 user.h utfconv.h utsname.h vadvise.h vcmd.h \
91447636 34 vm.h vmmeter.h vmparam.h vnioctl.h vnode.h vnode_if.h vstat.h wait.h xattr.h \
2d21ac55 35 _select.h _structs.h _types.h _endian.h domain.h protosw.h \
cb323159
A
36 spawn.h timex.h commpage.h log_data.h
37
38# Installs header file for DriverKit drivers -
39# $(DSTROOT)/System/DriverKit/System/usr/include/
40DRIVERKIT_DATAFILES = \
41 cdefs.h _types.h
91447636 42
39037602 43# Installs header file for Apple internal use in user level -
2d21ac55 44# $(DSTROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
91447636 45PRIVATE_DATAFILES = \
3e170ce0
A
46 attr.h \
47 cdefs.h \
39037602 48 clonefile.h \
fe8ab488 49 coalition.h \
2d21ac55 50 codesign.h \
6d2010ae 51 content_protection.h \
fe8ab488 52 csr.h \
316670eb 53 decmpfs.h \
3e170ce0 54 disk.h \
91447636 55 disklabel.h \
3e170ce0
A
56 domain.h \
57 event.h \
58 fcntl.h \
6d2010ae 59 fileport.h \
b0d623f7 60 fsctl.h \
3e170ce0 61 fsevents.h \
b0d623f7 62 fsgetpath.h \
2d21ac55 63 fslog.h \
39236c6e 64 guarded.h \
6d2010ae 65 imgsrc.h \
91447636 66 ipcs.h \
316670eb 67 kas_info.h \
3e170ce0
A
68 kdebug.h \
69 kern_control.h \
70 kern_event.h \
fe8ab488 71 kern_memorystatus.h \
cb323159
A
72 kern_memorystatus_freeze.h \
73 kern_memorystatus_notify.h \
39236c6e 74 kern_overrides.h \
cb323159 75 kern_sysctl.h \
3e170ce0
A
76 mbuf.h \
77 mman.h \
5ba3f43e 78 monotonic.h \
490019cf 79 persona.h \
3e170ce0
A
80 priv.h \
81 proc.h \
82 proc_info.h \
83 proc_uuid_policy.h \
84 process_policy.h \
39037602 85 reason.h \
3e170ce0 86 resource.h \
fe8ab488 87 sfi.h \
91447636 88 shm_internal.h \
39037602 89 snapshot.h \
3e170ce0
A
90 socket.h \
91 socketvar.h \
92 sockio.h \
93 spawn.h \
2d21ac55 94 spawn_internal.h \
3e170ce0
A
95 stackshot.h \
96 sys_domain.h \
b0d623f7 97 tree.h \
39037602 98 ulock.h \
3e170ce0 99 unpcb.h \
91447636 100 ux_exception.h \
3e170ce0 101 work_interval.h \
6d2010ae 102 process_policy.h \
39236c6e 103 proc_uuid_policy.h \
3e170ce0
A
104 priv.h \
105 pgo.h \
5ba3f43e
A
106 memory_maintenance.h \
107 commpage.h
91447636 108
cb323159
A
109# Installs header file for Apple internal use by DriverKit drivers -
110# $(DSTROOT)/System/DriverKit/System/usr/local/include/
111DRIVERKIT_PRIVATE_DATAFILES = \
112 appleapiopts.h kdebug.h
113
39037602 114# Installs header file for kernel extensions -
2d21ac55
A
115# $(DSTROOT)/System/Library/Frameworks/Kernel.framework/Headers
116# $(DSTROOT)/System/Library/Frameworks/Kernel.framework/PrivateHeaders
91447636 117KERNELFILES = \
39037602 118 appleapiopts.h attr.h \
91447636 119 buf.h cdefs.h conf.h \
2d21ac55 120 dir.h dirent.h disk.h disklabel.h dkstat.h \
b0d623f7 121 errno.h ev.h event.h fcntl.h file.h filio.h \
2d21ac55 122 ioccom.h ioctl.h ipc.h \
3e170ce0 123 ioctl_compat.h kernel.h kernel_types.h kern_event.h lock.h lockf.h \
cb323159
A
124 kauth.h kdebug.h kdebug_kernel.h md5.h kern_control.h imgact.h malloc.h \
125 namei.h mman.h mbuf.h mount.h netport.h param.h paths.h \
b0d623f7 126 proc.h queue.h random.h resource.h \
2d21ac55 127 sbuf.h posix_sem.h posix_shm.h sem.h shm.h \
fe8ab488 128 select.h signal.h socket.h socketvar.h sockio.h stat.h stdio.h \
91447636
A
129 sysctl.h syslimits.h syslog.h systm.h sys_domain.h time.h \
130 types.h ubc.h ucontext.h ucred.h uio.h un.h unistd.h unpcb.h \
2d21ac55
A
131 utfconv.h vm.h vmparam.h vnode.h vnode_if.h xattr.h \
132 _select.h _structs.h _types.h _endian.h protosw.h domain.h \
91447636 133 kpi_mbuf.h kpi_socket.h kpi_socketfilter.h \
2d21ac55 134 ttycom.h termios.h msg.h \
b0d623f7 135 wait.h \
5ba3f43e 136 spawn.h timex.h commpage.h
2d21ac55
A
137# The last line was added to export needed headers for the MAC calls
138# whose source is outside of the xnu/bsd tree.
91447636 139
39037602 140# Installs header file for Apple internal use for kernel extensions -
2d21ac55 141# $(DSTROOT)/System/Library/Frameworks/Kernel.framework/PrivateHeaders
91447636 142PRIVATE_KERNELFILES = \
6d2010ae 143 codesign.h \
d1ecb069 144 cprotect.h \
6d2010ae 145 content_protection.h \
fe8ab488 146 csr.h \
b0d623f7 147 decmpfs.h \
91447636 148 disktab.h \
5ba3f43e 149 eventhandler.h \
2d21ac55 150 fbt.h \
6d2010ae 151 fileport.h \
b0d623f7 152 fsctl.h \
2d21ac55 153 fslog.h \
fe8ab488
A
154 kasl.h \
155 kern_memorystatus.h \
cb323159
A
156 kern_memorystatus_freeze.h \
157 kern_memorystatus_notify.h \
3e170ce0 158 kpi_private.h \
39037602 159 ktrace.h \
91447636 160 mach_swapon.h \
5ba3f43e 161 monotonic.h \
91447636
A
162 msgbuf.h \
163 eventvar.h \
490019cf 164 persona.h \
fe8ab488 165 proc_info.h \
39236c6e 166 pthread_shims.h \
b0d623f7 167 quota.h \
5ba3f43e 168 reboot.h \
2d21ac55
A
169 sem_internal.h \
170 shm_internal.h \
91447636 171 signalvar.h \
3e170ce0 172 stackshot.h \
91447636
A
173 tty.h ttychars.h \
174 ttydefaults.h ttydev.h \
175 user.h \
2d21ac55
A
176 vfs_context.h \
177 vmmeter.h \
39037602 178 reason.h \
6d2010ae 179 spawn_internal.h \
3e170ce0
A
180 priv.h \
181 pgo.h \
39037602
A
182 memory_maintenance.h \
183 doc_tombstone.h \
5ba3f43e
A
184 fsevents.h \
185 work_interval.h \
cb323159 186 kern_sysctl.h \
1c79356b 187
d9a64523
A
188XNU_ONLY_EXPORTS = \
189 bsdtask_info.h \
190 file_internal.h \
191 filedesc.h \
192 guarded.h \
193 linker_set.h \
194 mount_internal.h \
195 munge.h \
196 pipe.h \
197 proc_internal.h \
198 pthread_internal.h \
199 resourcevar.h \
200 semaphore.h \
201 tree.h \
202 uio_internal.h \
203 ulock.h \
204 ux_exception.h \
205 vnode_internal.h
206
3e170ce0 207# /usr/include
1c79356b
A
208INSTALL_MI_LIST = ${DATAFILES}
209
cb323159
A
210INSTALL_DRIVERKIT_MI_LIST = ${DRIVERKIT_DATAFILES}
211
6d2010ae 212INSTALL_MI_GEN_LIST = syscall.h _posix_availability.h _symbol_aliasing.h
b0d623f7 213
cb323159
A
214INSTALL_DRIVERKIT_MI_GEN_LIST = _posix_availability.h _symbol_aliasing.h
215
1c79356b
A
216INSTALL_MI_DIR = sys
217
d9a64523 218EXPORT_MI_LIST = ${KERNELFILES} ${PRIVATE_KERNELFILES} ${XNU_ONLY_EXPORTS}
b0d623f7 219
04b8595b 220EXPORT_MI_GEN_LIST = syscall.h sysproto.h kdebugevents.h
1c79356b
A
221
222EXPORT_MI_DIR = sys
223
91447636 224# /System/Library/Frameworks/System.framework/PrivateHeaders
3e170ce0 225INSTALL_MI_LCL_LIST = ${PRIVATE_DATAFILES}
91447636 226
cb323159
A
227INSTALL_DRIVERKIT_MI_LCL_LIST = ${DRIVERKIT_PRIVATE_DATAFILES}
228
91447636 229# /System/Library/Frameworks/Kernel.framework/PrivateHeaders
91447636
A
230INSTALL_KF_MI_LCL_LIST = ${KERNELFILES} ${PRIVATE_KERNELFILES}
231
b0d623f7
A
232INSTALL_KF_MI_LCL_GEN_LIST = sysproto.h
233
91447636 234# /System/Library/Frameworks/Kernel.framework/Headers
91447636 235INSTALL_KF_MI_LIST = ${KERNELFILES}
1c79356b 236
04b8595b 237INSTALL_KF_MI_GEN_LIST =
b0d623f7
A
238
239MAKESYSCALLS = $(SRCROOT)/bsd/kern/makesyscalls.sh
04b8595b 240MAKEKDEBUGEVENTS = $(SRCROOT)/bsd/kern/makekdebugevents.py
b0d623f7 241
fe8ab488
A
242$(OBJROOT)/cscope.genhdrs:
243 $(_v)mkdir -p $(OBJROOT)/cscope.genhdrs
244
39037602 245$(OBJROOT)/syscall.codes: $(SRCROOT)/bsd/kern/syscalls.master $(MAKESYSCALLS)
cb323159 246 $(call makelog,[$(CMD_MC)] $(ColorH)GENERATING$(Color0) $(ColorLF)$@$(Color0) from $(ColorF)$<$(Color0))
39037602
A
247 $(_v)$(MAKESYSCALLS) $< trace > $@
248
249$(OBJROOT)/trace.codes: $(SRCROOT)/bsd/kern/trace_codes $(OBJROOT)/syscall.codes
250 $(_v)sort -g $(SRCROOT)/bsd/kern/trace_codes $(OBJROOT)/syscall.codes >$@
251
fe8ab488 252syscall.h: $(SRCROOT)/bsd/kern/syscalls.master $(MAKESYSCALLS) $(OBJROOT)/cscope.genhdrs
cb323159 253 $(call makelog,[$(CMD_MC)] $(ColorH)GENERATING$(Color0) $(ColorLF)bsd/sys/$@$(Color0) from $(ColorF)$<$(Color0))
fe8ab488 254 @echo "$(OBJPATH)/bsd/sys/$@" > $(OBJROOT)/cscope.genhdrs/$@.path
b0d623f7
A
255 $(_v)$(MAKESYSCALLS) $< header > /dev/null
256
fe8ab488 257sysproto.h: $(SRCROOT)/bsd/kern/syscalls.master $(MAKESYSCALLS) $(OBJROOT)/cscope.genhdrs
cb323159 258 $(call makelog,[$(CMD_MC)] $(ColorH)GENERATING$(Color0) $(ColorLF)bsd/sys/$@$(Color0) from $(ColorF)$<$(Color0))
fe8ab488 259 @echo "$(OBJPATH)/bsd/sys/$@" > $(OBJROOT)/cscope.genhdrs/$@.path
b0d623f7
A
260 $(_v)$(MAKESYSCALLS) $< proto > /dev/null
261
39037602 262kdebugevents.h: $(OBJROOT)/trace.codes $(MAKEKDEBUGEVENTS) $(OBJROOT)/cscope.genhdrs
cb323159 263 $(call makelog,[$(CMD_MC)] $(ColorH)GENERATING$(Color0) $(ColorLF)bsd/sys/$@$(Color0) from $(ColorF)$<$(Color0))
3e170ce0 264 @echo "$(OBJPATH)/bsd/sys/$@" > $(OBJROOT)/cscope.genhdrs/$@.path
04b8595b
A
265 $(_v)$(MAKEKDEBUGEVENTS) $< > "$(OBJPATH)/bsd/sys/$@"
266
6d2010ae
A
267MAKE_POSIX_AVAILABILITY = $(SRCROOT)/bsd/sys/make_posix_availability.sh
268_posix_availability.h: $(MAKE_POSIX_AVAILABILITY)
cb323159 269 $(call makelog,[$(CMD_MC)] $(ColorH)GENERATING$(Color0) $(ColorLF)bsd/sys/$@$(Color0))
316670eb 270 $(_v)$(MAKE_POSIX_AVAILABILITY) "$@"
6d2010ae
A
271
272MAKE_SYMBOL_ALIASING = $(SRCROOT)/bsd/sys/make_symbol_aliasing.sh
273_symbol_aliasing.h: $(MAKE_SYMBOL_ALIASING)
cb323159 274 $(call makelog,[$(CMD_MC)] $(ColorH)GENERATING$(Color0) $(ColorLF)bsd/sys/$@$(Color0))
316670eb 275 $(_v)$(MAKE_SYMBOL_ALIASING) "$(SDKROOT)" "$@"
6d2010ae 276
cb323159
A
277# generated headers needed early (used by iig during installhdrs of iokit/DriverKit)
278SETUP_GEN_LIST = _posix_availability.h _symbol_aliasing.h
279
280do_build_setup:: $(SETUP_GEN_LIST)
281
39037602
A
282TRACE_CODES_DEST = \
283 $(DSTROOT)/$(INSTALL_SHARE_MISC_DIR)/trace.codes
1c79356b 284
39037602
A
285$(TRACE_CODES_DEST): $(OBJROOT)/trace.codes
286 $(_v)$(MKDIR) $(DSTROOT)/$(INSTALL_SHARE_MISC_DIR)
cb323159 287 $(call makelog,INSTALL $(@F))
39037602 288 $(_v)$(INSTALL) $(INSTALL_FLAGS) $(OBJROOT)/trace.codes $@
1c79356b 289
39037602
A
290do_textfiles_install:: $(TRACE_CODES_DEST)
291
292include $(MakeInc_rule)
293include $(MakeInc_dir)