]> git.saurik.com Git - apple/xnu.git/blob - osfmk/mach/Makefile
xnu-6153.121.1.tar.gz
[apple/xnu.git] / osfmk / mach / Makefile
1 export MakeInc_cmd=${SRCROOT}/makedefs/MakeInc.cmd
2 export MakeInc_def=${SRCROOT}/makedefs/MakeInc.def
3 export MakeInc_rule=${SRCROOT}/makedefs/MakeInc.rule
4 export MakeInc_dir=${SRCROOT}/makedefs/MakeInc.dir
5
6 include $(MakeInc_cmd)
7 include $(MakeInc_def)
8
9 INSTINC_SUBDIRS = machine
10 INSTINC_SUBDIRS_X86_64 = i386
11 INSTINC_SUBDIRS_X86_64H = i386
12 INSTINC_SUBDIRS_ARM = arm arm64
13 INSTINC_SUBDIRS_ARM64 = arm arm64
14
15 EXPINC_SUBDIRS = machine
16 EXPINC_SUBDIRS_X86_64 = i386
17 EXPINC_SUBDIRS_X86_64H = i386
18 EXPINC_SUBDIRS_ARM = arm arm64
19 EXPINC_SUBDIRS_ARM64 = arm arm64
20
21 MIG_TYPES = \
22 clock_types.defs \
23 mach_types.defs \
24 std_types.defs
25
26 MIG_DEFS = \
27 audit_triggers.defs \
28 clock.defs \
29 clock_priv.defs \
30 clock_reply.defs \
31 exc.defs \
32 host_notify_reply.defs \
33 host_priv.defs \
34 host_security.defs \
35 lock_set.defs \
36 mach_exc.defs \
37 mach_host.defs \
38 mach_port.defs \
39 mach_vm.defs \
40 mach_voucher.defs \
41 mach_voucher_attr_control.defs \
42 memory_entry.defs \
43 notify.defs \
44 processor.defs \
45 processor_set.defs \
46 task.defs \
47 task_access.defs \
48 telemetry_notification.defs \
49 thread_act.defs \
50 vm_map.defs
51
52 MIG_PRIVATE_DEFS = \
53 restartable.defs
54
55 MACH_PRIVATE_DEFS = \
56 coalition_notification.defs \
57 fairplayd_notification.defs \
58 arcade_upcall.defs \
59 ktrace_background.defs \
60 mach_notify.defs \
61 memory_object_control.defs \
62 memory_object_default.defs \
63 sysdiagnose_notification.defs \
64 upl.defs \
65 vfs_nspace.defs \
66 vm32_map.defs
67
68 #
69 # MIG-generated headers that are traditionally used by user
70 # level code.
71 #
72 MIG_USHDRS = \
73 audit_triggers_server.h \
74 clock_reply_server.h \
75 coalition_notification_server.h \
76 exc_server.h \
77 fairplayd_notification_server.h \
78 arcade_upcall_server.h \
79 mach_exc_server.h \
80 memory_object_default_server.h \
81 notify_server.h \
82 task_access_server.h \
83 telemetry_notification_server.h \
84 sysdiagnose_notification_server.h \
85 vfs_nspace_server.h
86
87 MIG_UUHDRS = \
88 clock.h \
89 clock_priv.h \
90 host_priv.h \
91 host_security.h \
92 ktrace_background.h \
93 lock_set.h \
94 mach_host.h \
95 mach_port.h \
96 mach_vm.h \
97 mach_voucher.h \
98 mach_voucher_attr_control.h \
99 memory_entry.h \
100 memory_object_control.h \
101 processor.h \
102 processor_set.h \
103 task.h \
104 task_access.h \
105 thread_act.h \
106 upl.h \
107 vm_map.h \
108 vfs_nspace.h
109
110 MIGINCLUDES = ${MIG_UUHDRS} ${MIG_USHDRS}
111
112 DATAFILES = \
113 boolean.h \
114 clock_types.h \
115 dyld_kernel.h \
116 error.h \
117 exception.h \
118 exception_types.h \
119 host_notify.h \
120 host_info.h \
121 host_reboot.h \
122 host_special_ports.h \
123 kern_return.h \
124 kmod.h \
125 mach_param.h \
126 mach_time.h \
127 mach_traps.h \
128 mach_types.h \
129 mach_voucher_types.h \
130 machine.h \
131 mach_syscalls.h \
132 memory_object_types.h \
133 message.h \
134 mig.h \
135 mig_errors.h \
136 mig_voucher_support.h \
137 mig_strncpy_zerofill_support.h \
138 ndr.h \
139 notify.h \
140 policy.h \
141 port.h \
142 processor_info.h \
143 rpc.h \
144 sdt.h \
145 semaphore.h \
146 shared_memory_server.h \
147 shared_region.h \
148 std_types.h \
149 sync_policy.h \
150 syscall_sw.h \
151 task_info.h \
152 task_inspect.h \
153 task_policy.h \
154 task_special_ports.h \
155 thread_info.h \
156 thread_policy.h \
157 thread_special_ports.h \
158 thread_status.h \
159 thread_switch.h \
160 time_value.h \
161 vm_attributes.h \
162 vm_behavior.h \
163 vm_inherit.h \
164 vm_param.h \
165 vm_prot.h \
166 vm_purgable.h \
167 vm_region.h \
168 vm_statistics.h \
169 vm_sync.h \
170 vm_types.h \
171 ${MIG_TYPES} \
172 ${MIG_DEFS}
173
174 INSTALL_MI_LIST = \
175 bootstrap.h \
176 ${DATAFILES}
177
178 # installed into System.framework's PrivateHeaders/mach subdirectory
179 PRIVATE_DATAFILES = \
180 bootstrap.h \
181 coalition.h \
182 coalition_notification.defs \
183 fairplayd_notification.defs \
184 arcade_upcall.defs \
185 host_info.h \
186 ktrace_background.defs \
187 mach_host.defs \
188 mach_traps.h \
189 memory_object_types.h \
190 mig.h \
191 mk_timer.h \
192 processor_info.h \
193 resource_notify.defs \
194 resource_monitors.h \
195 semaphore.h \
196 sfi_class.h \
197 syscall_sw.h \
198 sysdiagnose_notification.defs \
199 task_info.h \
200 task_inspect.h \
201 task_policy.h \
202 thread_policy.h \
203 thread_switch.h \
204 vfs_nspace.defs \
205 vm_prot.h \
206 ${MIG_PRIVATE_DEFS}
207
208 INSTALL_MI_LCL_LIST = ${PRIVATE_DATAFILES}
209
210 INSTALL_KF_MI_LIST = \
211 mach_interface.h \
212 $(filter-out mach_traps.h mach_syscalls.h thread_switch.h, ${DATAFILES})
213
214 INSTALL_KF_MI_LCL_LIST = \
215 coalition.h \
216 mach_interface.h \
217 $(filter-out mach_traps.h mach_syscalls.h thread_switch.h, ${DATAFILES})
218
219 INSTALL_MI_GEN_LIST =
220
221 INSTALL_MI_DIR = mach
222
223 EXPORT_MI_LIST = \
224 coalition.h \
225 mach_interface.h \
226 resource_monitors.h \
227 sfi_class.h \
228 ${DATAFILES}
229
230 EXPORT_MI_GEN_LIST = \
231 ${MIGINCLUDES}
232
233 EXPORT_MI_DIR = mach
234
235 ${MIGINCLUDES} : ${MIG_TYPES}
236
237 ${MIG_UUHDRS} : \
238 %.h : %.defs
239 $(call makelog,$(ColorM)MIG$(Color0) $(ColorF)$@$(Color0))
240 $(_v)$(MIG) $(MIGFLAGS) \
241 -server /dev/null \
242 -user /dev/null \
243 -header $@ \
244 $<
245
246 ${MIG_USHDRS} : \
247 %_server.h : %.defs
248 $(call makelog,$(ColorM)MIG$(Color0) $(ColorF)$@$(Color0))
249 $(_v)$(MIG) $(MIGFLAGS) \
250 -server /dev/null \
251 -user /dev/null \
252 -header /dev/null \
253 -sheader $@ \
254 $<
255
256 #
257 # Build path
258 #
259
260 INCFLAGS_MAKEFILE= -I..
261
262 MIGKSFLAGS = -DMACH_KERNEL_PRIVATE -DKERNEL_SERVER=1
263 MIGKUFLAGS = -DMACH_KERNEL_PRIVATE -DKERNEL_USER=1 -maxonstack 1024
264 #
265 # MIG-generated headers that are traditionally used by kernel
266 # level code.
267 #
268
269 # sender-side ("user") headers generated by MIG from corresponding .defs
270 MIG_KUHDRS = \
271 audit_triggers.h \
272 clock_reply.h \
273 exc.h \
274 host_notify_reply.h \
275 ktrace_background.h \
276 mach_exc.h \
277 mach_notify.h \
278 memory_object.h \
279 memory_object_control.h \
280 memory_object_default.h \
281 resource_notify.h \
282 task_access.h \
283 upl.h \
284 vm_map.h
285
286 # sender-side ("user") source files generated by MIG from corresponding .defs
287 MIG_KUSRC = \
288 audit_triggers_user.c \
289 clock_reply_user.c \
290 coalition_notification_user.c \
291 exc_user.c \
292 fairplayd_notification_user.c \
293 arcade_upcall_user.c \
294 host_notify_reply_user.c \
295 ktrace_background_user.c \
296 mach_exc_user.c \
297 mach_notify_user.c \
298 memory_object_user.c \
299 memory_object_control_user.c \
300 memory_object_default_user.c \
301 resource_notify_user.c \
302 task_access_user.c \
303 telemetry_notification_user.c \
304 upl_user.c \
305 vfs_nspace_user.c \
306 vm_map_user.c \
307 sysdiagnose_notification_user.c
308
309 MIG_KSHDRS = \
310 arcade_register_server.h \
311 clock_server.h \
312 clock_priv_server.h \
313 exc_server.h \
314 host_priv_server.h \
315 host_security_server.h \
316 lock_set_server.h \
317 mach_exc_server.h \
318 mach_host_server.h \
319 mach_notify_server.h \
320 mach_port_server.h \
321 mach_vm_server.h \
322 mach_voucher_server.h \
323 mach_voucher_attr_control_server.h \
324 memory_entry_server.h \
325 memory_object_control_server.h \
326 memory_object_default_server.h \
327 processor_server.h \
328 processor_set_server.h \
329 restartable_server.h \
330 task_server.h \
331 thread_act_server.h \
332 upl_server.h \
333 vm_map_server.h \
334 vm32_map_server.h
335
336 MIG_KSSRC = \
337 arcade_register_server.c \
338 clock_server.c \
339 clock_priv_server.c \
340 exc_server.c \
341 host_priv_server.c \
342 host_security_server.c \
343 lock_set_server.c \
344 mach_exc_server.c \
345 mach_host_server.c \
346 mach_notify_server.c \
347 mach_port_server.c \
348 mach_vm_server.c \
349 mach_voucher_server.c \
350 mach_voucher_attr_control_server.c \
351 memory_entry_server.c \
352 memory_object_control_server.c \
353 memory_object_default_server.c \
354 processor_server.c \
355 processor_set_server.c \
356 restartable_server.c \
357 task_server.c \
358 thread_act_server.c \
359 upl_server.c \
360 vm_map_server.c \
361 vm32_map_server.c
362
363 #
364 # JMM -
365 # Since there are two generated header files with the same name, one for
366 # install and export, the other for internal use (and they are different)
367 # we can't explicitly list two rules for the same target. So rules for
368 # generating internal headers will be handled implicitly by creating rules
369 # to generate the internal C sources, and the headers get created as a
370 # side-effect.
371 #
372 #
373 # This is all temporary scaffolding, as we are moving to a model where
374 # the MIG-generated code is identical in all environments. At first, it
375 # will contain some environment-specific ifdefs, but over time should not
376 # even require that as we move towards making all the environments look
377 # the same.
378 #
379 COMP_FILES = ${MIG_KUSRC} ${MIG_KSSRC}
380
381 do_build_all:: $(COMP_FILES)
382
383 ${COMP_FILES} : ${MIG_TYPES}
384
385 ${MIG_KUSRC} : \
386 %_user.c : %.defs
387 $(call makelog,$(ColorM)MIG$(Color0) $(ColorF)$@$(Color0))
388 $(_v)${MIG} ${MIGFLAGS} ${MIGKUFLAGS} \
389 -user $*_user.c \
390 -header $*.h \
391 -server /dev/null \
392 -sheader /dev/null \
393 $<
394
395 ${MIG_KSSRC}: \
396 %_server.c : %.defs
397 $(call makelog,$(ColorM)MIG$(Color0) $(ColorF)$@$(Color0))
398 $(_v)${MIG} ${MIGFLAGS} ${MIGKSFLAGS} \
399 -user /dev/null \
400 -header /dev/null \
401 -server $*_server.c \
402 -sheader $*_server.h \
403 $<
404
405 include $(MakeInc_rule)
406 include $(MakeInc_dir)