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