xref: /illumos-gate/usr/src/uts/i86pc/Makefile.rules (revision db874c57ae335a07060499f1492b0d0e2593e26c)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26#pragma ident	"%Z%%M%	%I%	%E% SMI"
27#
28
29#	This Makefile defines the build rules for the directory uts/i86pc
30#	and its children. These are the source files which are i86pc
31#	"implementation architecture" dependent.
32#
33#	The following two-level ordering must be maintained in this file.
34#	  Lines are sorted first in order of decreasing specificity based on
35#	  the first directory component.  That is, sun4u rules come before
36#	  sparc rules come before common rules.
37#
38#	  Lines whose initial directory components are equal are sorted
39#	  alphabetically by the remaining components.
40
41#
42#	Section 1a: C object build rules
43#
44$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/conf/%.c
45	$(COMPILE.c) -o $@ $<
46	$(CTFCONVERT_O)
47
48$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/%.c
49	$(COMPILE.c) -o $@ $<
50	$(CTFCONVERT_O)
51
52$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/dktp/hba/chs/%.c
53	$(COMPILE.c) -o $@ $<
54	$(CTFCONVERT_O)
55
56$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/dktp/hba/ncrs/%.c
57	$(COMPILE.c) -o $@ $<
58	$(CTFCONVERT_O)
59
60$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/iprb/%.c
61	$(COMPILE.c) -o $@ $<
62	$(CTFCONVERT_O)
63
64$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/bmc/%.c
65	$(COMPILE.c) -o $@ $<
66	$(CTFCONVERT_O)
67
68$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/pci/%.c
69	$(COMPILE.c) -o $@ $<
70	$(CTFCONVERT_O)
71
72$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/pciex/%.c
73	$(COMPILE.c) -o $@ $<
74	$(CTFCONVERT_O)
75
76$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/pciex/hotplug/pciehpc/%.c
77	$(COMPILE.c) -o $@ $<
78	$(CTFCONVERT_O)
79
80$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/pcplusmp/%.c
81	$(COMPILE.c) -o $@ $<
82	$(CTFCONVERT_O)
83
84$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/pcplusmp/%.s
85	$(COMPILE.s) -o $@ $<
86
87$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/psm/%.c
88	$(COMPILE.c) -o $@ $<
89	$(CTFCONVERT_O)
90
91$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/psm/%.s
92	$(COMPILE.s) -o $@ $<
93
94$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/rtls/%.c
95	$(COMPILE.c) -o $@ $<
96	$(CTFCONVERT_O)
97
98$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/spwr/%.c
99	$(COMPILE.c) -o $@ $<
100	$(CTFCONVERT_O)
101
102$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/ml/%.s
103	$(COMPILE.s) -o $@ $<
104
105$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/os/%.c
106	$(COMPILE.c) -o $@ $<
107	$(CTFCONVERT_O)
108
109$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/vm/%.c
110	$(COMPILE.c) -o $@ $<
111	$(CTFCONVERT_O)
112
113$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/%.c
114	$(COMPILE.c) -o $@ $<
115	$(CTFCONVERT_O)
116
117$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/dktp/controller/ata/%.c
118	$(COMPILE.c) -o $@ $<
119	$(CTFCONVERT_O)
120
121$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/dktp/hba/ghd/%.c
122	$(COMPILE.c) -o $@ $<
123	$(CTFCONVERT_O)
124
125$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/elxl/%.c
126	$(COMPILE.c) -o $@ $<
127	$(CTFCONVERT_O)
128
129$(OBJS_DIR)/%.o:		$(UTSBASE)/common/os/%.c
130	$(COMPILE.c) -o $@ $<
131	$(CTFCONVERT_O)
132
133$(OBJS_DIR)/%.o:		$(SRC)/common/dis/i386/%.c
134	$(COMPILE.c) -o $@ $<
135	$(CTFCONVERT_O)
136
137$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/agpgart/%.c
138	$(COMPILE.c) -o $@ $<
139	$(CTFCONVERT_O)
140
141# ridiculous contortions ---
142ATOMIC_SUBDIR_32	= i386
143ATOMIC_SUBDIR_64	= amd64
144ATOMIC_SUBDIR		= $(ATOMIC_SUBDIR_$(CLASS))
145
146$(OBJS_DIR)/%.o:		$(SRC)/common/atomic/$(ATOMIC_SUBDIR)/%.s
147	$(COMPILE.s) -o $@ $<
148
149$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/power/%.c
150	$(COMPILE.c) -o $@ $<
151	$(CTFCONVERT_O)
152
153$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/acpica/%.c
154	$(COMPILE.c) -o $@ $<
155	$(CTFCONVERT_O)
156
157$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/acpica/%.s
158	$(COMPILE.s) -o $@ $<
159
160$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/acpica/debugger/%.c
161	$(COMPILE.c) -o $@ $<
162	$(CTFCONVERT_O)
163
164$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/acpica/events/%.c
165	$(COMPILE.c) -o $@ $<
166	$(CTFCONVERT_O)
167
168$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/acpica/hardware/%.c
169	$(COMPILE.c) -o $@ $<
170	$(CTFCONVERT_O)
171
172$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/acpica/interpreter/dispatcher/%.c
173	$(COMPILE.c) -o $@ $<
174	$(CTFCONVERT_O)
175
176$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/acpica/interpreter/executer/%.c
177	$(COMPILE.c) -o $@ $<
178	$(CTFCONVERT_O)
179
180$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/acpica/interpreter/parser/%.c
181	$(COMPILE.c) -o $@ $<
182	$(CTFCONVERT_O)
183
184$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/acpica/namespace/%.c
185	$(COMPILE.c) -o $@ $<
186	$(CTFCONVERT_O)
187
188$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/acpica/resources/%.c
189	$(COMPILE.c) -o $@ $<
190	$(CTFCONVERT_O)
191
192$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/acpica/tables/%.c
193	$(COMPILE.c) -o $@ $<
194	$(CTFCONVERT_O)
195
196$(OBJS_DIR)/%.o:		$(UTSBASE)/i86pc/io/acpica/utilities/%.c
197	$(COMPILE.c) -o $@ $<
198	$(CTFCONVERT_O)
199
200$(OBJS_DIR)/dtracestubs.s:	$(UNIX_O) $(LIBS)
201	nm -u $(UNIX_O) $(LIBS) | grep __dtrace_probe_ | sort | uniq | nawk '{ \
202	    printf("\t.globl %s\n\t.type %s,@function\n%s:\n", \
203	    $$1, $$1, $$1); }' > $(OBJS_DIR)/dtracestubs.s
204
205$(DTRACESTUBS):	$(DTRACESTUBS_O)
206	$(BUILD.SO) $(DTRACESTUBS_O)
207
208#
209#	Section 1b: Lint `object' build rules
210#
211$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/conf/%.c
212	@($(LHEAD) $(LINT.c) $< $(LTAIL))
213
214$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/%.c
215	@($(LHEAD) $(LINT.c) $< $(LTAIL))
216
217$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/dktp/hba/chs/%.c
218	@($(LHEAD) $(LINT.c) $< $(LTAIL))
219
220$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/dktp/hba/ncrs/%.c
221	@($(LHEAD) $(LINT.c) $< $(LTAIL))
222
223$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/iprb/%.c
224	@($(LHEAD) $(LINT.c) $< $(LTAIL))
225
226$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/bmc/%.c
227	@($(LHEAD) $(LINT.c) $< $(LTAIL))
228
229$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/pci/%.c
230	@($(LHEAD) $(LINT.c) $< $(LTAIL))
231
232$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/pciex/%.c
233	@($(LHEAD) $(LINT.c) $< $(LTAIL))
234
235$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/pciex/hotplug/pciehpc/%.c
236	@($(LHEAD) $(LINT.c) $< $(LTAIL))
237
238$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/pcplusmp/%.c
239	@($(LHEAD) $(LINT.c) $< $(LTAIL))
240
241$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/pcplusmp/%.s
242	@($(LHEAD) $(LINT.s) $< $(LTAIL))
243
244$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/psm/%.c
245	@($(LHEAD) $(LINT.c) $< $(LTAIL))
246
247$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/psm/%.s
248	@($(LHEAD) $(LINT.s) $< $(LTAIL))
249
250$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/rtls/%.c
251	@($(LHEAD) $(LINT.s) $< $(LTAIL))
252
253$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/spwr/%.c
254	@($(LHEAD) $(LINT.c) $< $(LTAIL))
255
256$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/ml/%.s
257	@($(LHEAD) $(LINT.s) $< $(LTAIL))
258
259$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/os/%.c
260	@($(LHEAD) $(LINT.c) $< $(LTAIL))
261
262$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/vm/%.c
263	@($(LHEAD) $(LINT.c) $< $(LTAIL))
264
265$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/%.c
266	@($(LHEAD) $(LINT.c) $< $(LTAIL))
267
268$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/dktp/controller/ata/%.c
269	@($(LHEAD) $(LINT.c) $< $(LTAIL))
270
271$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/dktp/hba/ghd/%.c
272	@($(LHEAD) $(LINT.c) $< $(LTAIL))
273
274$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/elxl/%.c
275	@($(LHEAD) $(LINT.c) $< $(LTAIL))
276
277$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/os/%.c
278	@($(LHEAD) $(LINT.c) $< $(LTAIL))
279
280$(LINTS_DIR)/%.ln:		$(SRC)/common/dis/i386/%.c
281	@($(LHEAD) $(LINT.c) $< $(LTAIL))
282
283$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/agpgart/%.c
284	@($(LHEAD) $(LINT.c) $< $(LTAIL))
285
286$(LINTS_DIR)/%.ln:		$(SRC)/common/atomic/%.c
287	@($(LHEAD) $(LINT.c) $< $(LTAIL))
288
289$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/acpica/%.s
290	@($(LHEAD) $(LINT.s) $< $(LTAIL))
291
292$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/acpica/%.c
293	@($(LHEAD) $(LINT.c) $< $(LTAIL))
294
295$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/acpica/debugger/%.c
296	@($(LHEAD) $(LINT.c) $< $(LTAIL))
297
298$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/acpica/events/%.c
299	@($(LHEAD) $(LINT.c) $< $(LTAIL))
300
301$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/acpica/hardware/%.c
302	@($(LHEAD) $(LINT.c) $< $(LTAIL))
303
304$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/acpica/interpreter/dispatcher/%.c
305	@($(LHEAD) $(LINT.c) $< $(LTAIL))
306
307$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/acpica/interpreter/executer/%.c
308	@($(LHEAD) $(LINT.c) $< $(LTAIL))
309
310$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/acpica/interpreter/parser/%.c
311	@($(LHEAD) $(LINT.c) $< $(LTAIL))
312
313$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/acpica/namespace/%.c
314	@($(LHEAD) $(LINT.c) $< $(LTAIL))
315
316$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/acpica/resources/%.c
317	@($(LHEAD) $(LINT.c) $< $(LTAIL))
318
319$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/acpica/tables/%.c
320	@($(LHEAD) $(LINT.c) $< $(LTAIL))
321
322$(LINTS_DIR)/%.ln:		$(UTSBASE)/i86pc/io/acpica/utilities/%.c
323	@($(LHEAD) $(LINT.c) $< $(LTAIL))
324
325