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