xref: /titanic_50/usr/src/uts/intel/Makefile.rules (revision ff3124eff995e6cd8ebd8c6543648e0670920034)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21#
22# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26#
27#	This Makefile defines all file modules and build rules for the
28# directory uts/intel and its children. These are the source files which
29# are specific to the intel processor.
30#
31#	The following two-level ordering must be maintained in this file.
32#	  Lines are sorted first in order of decreasing specificity based on
33#	  the first directory component.  That is, sun4u rules come before
34#	  sparc rules come before common rules.
35#
36#	  Lines whose initial directory components are equal are sorted
37#	  alphabetically by the remaining components.
38
39#
40# Need a way to distinguish between the ia32 and amd64 subdirs.
41#
42SUBARCH_DIR_32 = ia32
43SUBARCH_DIR_64 = amd64
44SUBARCH_DIR	= $(SUBARCH_DIR_$(CLASS))
45
46#
47#	Section 1a: C object build rules
48#
49$(OBJS_DIR)/%.o:		$(SRC)/common/fs/%.c
50	$(COMPILE.c) -o $@ $<
51	$(CTFCONVERT_O)
52
53$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/power/%.c
54	$(COMPILE.c) -o $@ $<
55	$(CTFCONVERT_O)
56
57$(OBJS_DIR)/%.o:		$(SRC)/common/util/i386/%.s
58	$(COMPILE.s) -o $@ $<
59
60$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/brand/sn1/%.s
61	$(COMPILE.s) -o $@ $<
62
63$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/dtrace/%.c
64	$(COMPILE.c) -o $@ $<
65	$(CTFCONVERT_O)
66
67$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/dtrace/%.s
68	$(COMPILE.s) -o $@ $<
69
70$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/fs/proc/%.c
71	$(COMPILE.c) -o $@ $<
72	$(CTFCONVERT_O)
73
74$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/ia32/ml/%.s
75	$(COMPILE.s) -o $@ $<
76
77$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/ia32/os/%.c
78	$(COMPILE.c) -o $@ $<
79	$(CTFCONVERT_O)
80
81$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/ia32/promif/%.c
82	$(COMPILE.c) -o $@ $<
83	$(CTFCONVERT_O)
84
85$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/ia32/syscall/%.c
86	$(COMPILE.c) -o $@ $<
87	$(CTFCONVERT_O)
88
89$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/%.c
90	$(COMPILE.c) -o $@ $<
91	$(CTFCONVERT_O)
92
93$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/acpica/%.c
94	$(COMPILE.c) -o $@ $<
95	$(CTFCONVERT_O)
96
97$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/acpica/%.s
98	$(COMPILE.s) -o $@ $<
99
100$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/acpica/debugger/%.c
101	$(COMPILE.c) -o $@ $<
102	$(CTFCONVERT_O)
103
104$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/acpica/events/%.c
105	$(COMPILE.c) -o $@ $<
106	$(CTFCONVERT_O)
107
108$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/acpica/hardware/%.c
109	$(COMPILE.c) -o $@ $<
110	$(CTFCONVERT_O)
111
112$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/acpica/interpreter/dispatcher/%.c
113	$(COMPILE.c) -o $@ $<
114	$(CTFCONVERT_O)
115
116$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/acpica/interpreter/executer/%.c
117	$(COMPILE.c) -o $@ $<
118	$(CTFCONVERT_O)
119
120$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/acpica/interpreter/parser/%.c
121	$(COMPILE.c) -o $@ $<
122	$(CTFCONVERT_O)
123
124$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/acpica/namespace/%.c
125	$(COMPILE.c) -o $@ $<
126	$(CTFCONVERT_O)
127
128$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/acpica/resources/%.c
129	$(COMPILE.c) -o $@ $<
130	$(CTFCONVERT_O)
131
132$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/acpica/tables/%.c
133	$(COMPILE.c) -o $@ $<
134	$(CTFCONVERT_O)
135
136$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/acpica/utilities/%.c
137	$(COMPILE.c) -o $@ $<
138	$(CTFCONVERT_O)
139
140$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/acpica/disassembler/%.c
141	$(COMPILE.c) -o $@ $<
142	$(CTFCONVERT_O)
143
144$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/agpgart/%.c
145	$(COMPILE.c) -o $@ $<
146	$(CTFCONVERT_O)
147
148$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/agpmaster/%.c
149	$(COMPILE.c) -o $@ $<
150	$(CTFCONVERT_O)
151
152$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/amd8111s/%.c
153	$(COMPILE.c) -o $@ $<
154	$(CTFCONVERT_O)
155
156$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/amr/%.c
157	$(COMPILE.c) -o $@ $<
158	$(CTFCONVERT_O)
159
160$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/drm/%.c
161	$(COMPILE.c) -o $@ $<
162	$(CTFCONVERT_O)
163
164$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/hotplug/pcicfg/%.c
165	$(COMPILE.c) -o $@ $<
166	$(CTFCONVERT_O)
167
168$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/hotplug/pciehpc/%.c
169	$(COMPILE.c) -o $@ $<
170	$(CTFCONVERT_O)
171
172$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/pci/%.c
173	$(COMPILE.c) -o $@ $<
174	$(CTFCONVERT_O)
175
176$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/pciex/%.c
177	$(COMPILE.c) -o $@ $<
178	$(CTFCONVERT_O)
179
180$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/dktp/controller/ata/%.c
181	$(COMPILE.c) -o $@ $<
182	$(CTFCONVERT_O)
183
184$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/dktp/dcdev/%.c
185	$(COMPILE.c) -o $@ $<
186	$(CTFCONVERT_O)
187
188$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/dktp/disk/%.c
189	$(COMPILE.c) -o $@ $<
190	$(CTFCONVERT_O)
191
192$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/dktp/drvobj/%.c
193	$(COMPILE.c) -o $@ $<
194	$(CTFCONVERT_O)
195
196$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/dktp/hba/ghd/%.c
197	$(COMPILE.c) -o $@ $<
198	$(CTFCONVERT_O)
199
200$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/scsi/targets/%.c
201	$(COMPILE.c) -o $@ $<
202	$(CTFCONVERT_O)
203
204$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/io/vgatext/%.c
205	$(COMPILE.c) -o $@ $<
206	$(CTFCONVERT_O)
207
208$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/os/%.c
209	$(COMPILE.c) -o $@ $<
210	$(CTFCONVERT_O)
211
212$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/pcbe/%.c
213	$(COMPILE.c) -o $@ $<
214	$(CTFCONVERT_O)
215
216$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/promif/%.c
217	$(COMPILE.c) -o $@ $<
218	$(CTFCONVERT_O)
219
220$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/syscall/%.c
221	$(COMPILE.c) -o $@ $<
222	$(CTFCONVERT_O)
223
224$(OBJS_DIR)/%.o:		$(UTSBASE)/common/os/%.c
225	$(COMPILE.c) -o $@ $<
226	$(CTFCONVERT_O)
227
228$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/kdi/%.c
229	$(COMPILE.c) -o $@ $<
230	$(CTFCONVERT_O)
231
232$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/kdi/%.s
233	$(COMPILE.s) -o $@ $<
234
235$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/kdi/$(SUBARCH_DIR)/%.s
236	$(COMPILE.s) -o $@ $<
237
238$(OBJS_DIR)/%.o:		$(UTSBASE)/intel/zfs/%.c
239	$(COMPILE.c) -o $@ $<
240	$(CTFCONVERT_O)
241
242#
243# krtld compiled into unix
244#
245
246KRTLD_INC_PATH	= -I$(UTSBASE)/common/krtld -I$(UTSBASE)/intel/sys
247KRTLD_INC_PATH	+= -I$(UTSBASE)/intel/$(SUBARCH_DIR)/krtld
248
249KRTLD_CPPFLAGS_32	= -DELF_TARGET_386
250KRTLD_CPPFLAGS_64	= -DELF_TARGET_AMD64 -DMODDIR_SUFFIX=\"amd64\"
251KRTLD_CPPFLAGS		= $(KRTLD_CPPFLAGS_$(CLASS)) -D_KRTLD
252
253$(OBJS_DIR)/%.o:	$(UTSBASE)/common/krtld/%.c
254	$(COMPILE.c) $(KRTLD_INC_PATH) $(KRTLD_CPPFLAGS) -o $@ $<
255	$(CTFCONVERT_O)
256
257$(OBJS_DIR)/%.o:	$(UTSBASE)/intel/$(SUBARCH_DIR)/krtld/%.c
258	$(COMPILE.c) $(KRTLD_INC_PATH) $(KRTLD_CPPFLAGS) -o $@ $<
259	$(CTFCONVERT_O)
260
261#
262# _DBOOT indicates that krtld is called from a dboot ELF section
263#
264$(OBJS_DIR)/kobj.o		:= CPPFLAGS += -D_DBOOT
265
266$(OBJS_DIR)/%.o:	$(UTSBASE)/intel/$(SUBARCH_DIR)/krtld/%.s
267	$(COMPILE.s) $(KRTLD_INC_PATH) $(KRTLD_CPPFLAGS) -o $@ $<
268	$(CTFCONVERT_O)
269
270$(OBJS_DIR)/%.o:	$(SRC)/common/util/$(SUBARCH_DIR)/%.c
271	$(COMPILE.c) $(KRTLD_INC_PATH) $(KRTLD_CPPFLAGS) -o $@ $<
272	$(CTFCONVERT_O)
273
274
275#
276#	Section 1b: Lint `object' build rules.
277#
278$(LINTS_DIR)/%.ln:		$(SRC)/common/fs/%.c
279	@($(LHEAD) $(LINT.c) $< $(LTAIL))
280
281$(LINTS_DIR)/%.ln:		$(SRC)/common/util/i386/%.s
282	@($(LHEAD) $(LINT.s) $< $(LTAIL))
283
284$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/brand/sn1/%.s
285	@($(LHEAD) $(LINT.s) $< $(LTAIL))
286
287$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/dtrace/%.c
288	@($(LHEAD) $(LINT.c) $< $(LTAIL))
289
290$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/dtrace/%.s
291	@($(LHEAD) $(LINT.s) $< $(LTAIL))
292
293$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/zfs/%.c
294	@($(LHEAD) $(LINT.c) $< $(LTAIL))
295
296$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/fs/proc/%.c
297	@($(LHEAD) $(LINT.c) $< $(LTAIL))
298
299$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/ia32/ml/%.s
300	@($(LHEAD) $(LINT.s) $< $(LTAIL))
301
302$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/ia32/os/%.c
303	@($(LHEAD) $(LINT.c) $< $(LTAIL))
304
305$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/ia32/promif/%.c
306	@($(LHEAD) $(LINT.c) $< $(LTAIL))
307
308$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/ia32/syscall/%.c
309	@($(LHEAD) $(LINT.c) $< $(LTAIL))
310
311$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/io/%.c
312	@($(LHEAD) $(LINT.c) $< $(LTAIL))
313
314$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/io/acpica/%.s
315	@($(LHEAD) $(LINT.s) $< $(LTAIL))
316
317$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/io/acpica/%.c
318	@($(LHEAD) $(LINT.c) $< $(LTAIL))
319
320$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/io/acpica/debugger/%.c
321	@($(LHEAD) $(LINT.c) $< $(LTAIL))
322
323$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/io/acpica/events/%.c
324	@($(LHEAD) $(LINT.c) $< $(LTAIL))
325
326$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/io/acpica/hardware/%.c
327	@($(LHEAD) $(LINT.c) $< $(LTAIL))
328
329$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/io/acpica/interpreter/dispatcher/%.c
330	@($(LHEAD) $(LINT.c) $< $(LTAIL))
331
332$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/io/acpica/interpreter/executer/%.c
333	@($(LHEAD) $(LINT.c) $< $(LTAIL))
334
335$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/io/acpica/interpreter/parser/%.c
336	@($(LHEAD) $(LINT.c) $< $(LTAIL))
337
338$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/io/acpica/namespace/%.c
339	@($(LHEAD) $(LINT.c) $< $(LTAIL))
340
341$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/io/acpica/resources/%.c
342	@($(LHEAD) $(LINT.c) $< $(LTAIL))
343
344$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/io/acpica/tables/%.c
345	@($(LHEAD) $(LINT.c) $< $(LTAIL))
346
347$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/io/acpica/utilities/%.c
348	@($(LHEAD) $(LINT.c) $< $(LTAIL))
349
350$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/io/acpica/disassembler/%.c
351	@($(LHEAD) $(LINT.c) $< $(LTAIL))
352
353$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/io/agpgart/%.c
354	@($(LHEAD) $(LINT.c) $< $(LTAIL))
355
356$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/io/agpmaster/%.c
357	@($(LHEAD) $(LINT.c) $< $(LTAIL))
358
359$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/io/amd8111s/%.c
360	@($(LHEAD) $(LINT.c) $< $(LTAIL))
361
362$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/io/amr/%.c
363	@($(LHEAD) $(LINT.c) $< $(LTAIL))
364
365$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/io/drm/%.c
366	@($(LHEAD) $(LINT.c) $< $(LTAIL))
367
368$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/io/hotplug/pcicfg/%.c
369	@($(LHEAD) $(LINT.c) $< $(LTAIL))
370
371$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/io/hotplug/pciehpc/%.c
372	@($(LHEAD) $(LINT.c) $< $(LTAIL))
373
374$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/io/pci/%.c
375	@($(LHEAD) $(LINT.c) $< $(LTAIL))
376
377$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/io/pciex/%.c
378	@($(LHEAD) $(LINT.c) $< $(LTAIL))
379
380$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/io/dktp/controller/ata/%.c
381	@($(LHEAD) $(LINT.c) $< $(LTAIL))
382
383$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/io/dktp/dcdev/%.c
384	@($(LHEAD) $(LINT.c) $< $(LTAIL))
385
386$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/io/dktp/disk/%.c
387	@($(LHEAD) $(LINT.c) $< $(LTAIL))
388
389$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/io/dktp/drvobj/%.c
390	@($(LHEAD) $(LINT.c) $< $(LTAIL))
391
392$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/io/dktp/hba/ghd/%.c
393	@($(LHEAD) $(LINT.c) $< $(LTAIL))
394
395$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/io/scsi/targets/%.c
396	@($(LHEAD) $(LINT.c) $< $(LTAIL))
397
398$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/io/vgatext/%.c
399	@($(LHEAD) $(LINT.c) $< $(LTAIL))
400
401$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/os/%.c
402	@($(LHEAD) $(LINT.c) $< $(LTAIL))
403
404$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/pcbe/%.c
405	@($(LHEAD) $(LINT.c) $< $(LTAIL))
406
407$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/promif/%.c
408	@($(LHEAD) $(LINT.c) $< $(LTAIL))
409
410$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/syscall/%.c
411	@($(LHEAD) $(LINT.c) $< $(LTAIL))
412
413$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/os/%.c
414	@($(LHEAD) $(LINT.c) $< $(LTAIL))
415
416$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/kdi/%.c
417	@($(LHEAD) $(LINT.c) $< $(LTAIL))
418
419$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/kdi/%.s
420	@($(LHEAD) $(LINT.s) $< $(LTAIL))
421
422$(LINTS_DIR)/%.ln:		$(UTSBASE)/intel/kdi/$(SUBARCH_DIR)/%.s
423	@($(LHEAD) $(LINT.s) $< $(LTAIL))
424
425#
426# krtld lints
427#
428$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/krtld/%.c
429	@($(LHEAD) $(LINT.c) $(KRTLD_INC_PATH) $(KRTLD_CPPFLAGS) $< $(LTAIL))
430
431$(LINTS_DIR)/%.ln:	$(UTSBASE)/intel/$(SUBARCH_DIR)/krtld/%.c
432	@($(LHEAD) $(LINT.c) $(KRTLD_INC_PATH) $(KRTLD_CPPFLAGS) $< $(LTAIL))
433
434$(LINTS_DIR)/%.ln:	$(UTSBASE)/intel/$(SUBARCH_DIR)/krtld/%.s
435	@($(LHEAD) $(LINT.s) $(KRTLD_INC_PATH) $(KRTLD_CPPFLAGS) $< $(LTAIL))
436
437$(LINTS_DIR)/%.ln:	$(SRC)/common/util/$(SUBARCH_DIR)/%.c
438	@($(LHEAD) $(LINT.c) $(KRTLD_INC_PATH) $(KRTLD_CPPFLAGS) $< $(LTAIL))
439
440$(OBJS_DIR)/kobj.ln		:= CPPFLAGS += -D_DBOOT
441