xref: /titanic_50/usr/src/uts/sun4u/Makefile.rules (revision 7b07063d906859b2be1e88791f801b3c96e432f6)
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#
23# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25# Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
26#
27#	This Makefile defines the build rules for the directory uts/sun4u
28#	and its children. These are the source files which sun4u
29#	"implementation architecture" dependent.
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#	Section 1a: C object build rules
41#
42$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/cpu/%.c
43	$(COMPILE.c) -o $@ $<
44	$(CTFCONVERT_O)
45
46$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/cpu/%.s
47	$(COMPILE.s) -o $@ $<
48
49#
50# This rule for io/ppm/%.c needs to come before the io/%.c rule so that
51# the sun4u/ppm driver pulls in io/ppm/ppm.c instead of io/ppm.c.
52# Making an explicit rule to build ppm.o doesn't work because it breaks
53# the build of excalibur/xcalppm
54#
55$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/io/ppm/%.c
56	$(COMPILE.c) -o $@ $<
57	$(CTFCONVERT_O)
58
59$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/ppm/%.c
60	$(COMPILE.c) -o $@ $<
61	$(CTFCONVERT_O)
62
63$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/io/%.s
64	$(COMPILE.s) -o $@ $<
65
66$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/io/%.c
67	$(COMPILE.c) -o $@ $<
68	$(CTFCONVERT_O)
69
70$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/io/i2c/clients/%.c
71	$(COMPILE.c) -o $@ $<
72	$(CTFCONVERT_O)
73
74$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/io/i2c/misc/%.c
75	$(COMPILE.c) -o $@ $<
76	$(CTFCONVERT_O)
77
78$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/io/i2c/nexus/%.c
79	$(COMPILE.c) -o $@ $<
80	$(CTFCONVERT_O)
81
82$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/io/pci/%.c
83	$(COMPILE.c) -o $@ $<
84	$(CTFCONVERT_O)
85
86$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/io/pci/%.s
87	$(COMPILE.s) -o $@ $<
88
89$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/io/px/%.c
90	$(COMPILE.c) -o $@ $<
91	$(CTFCONVERT_O)
92
93$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/io/px/%.s
94	$(COMPILE.s) -o $@ $<
95
96$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/io/pciex/%.c
97	$(COMPILE.c) -o $@ $<
98	$(CTFCONVERT_O)
99
100$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/io/pciex/%.s
101	$(COMPILE.s) -o $@ $<
102
103$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/ml/%.s
104	$(COMPILE.s) -o $@ $<
105
106$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/os/%.c
107	$(COMPILE.c) -o $@ $<
108	$(CTFCONVERT_O)
109
110$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/pcbe/%.c
111	$(COMPILE.c) -o $@ $<
112	$(CTFCONVERT_O)
113
114$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4/brand/sn1/%.s
115	$(COMPILE.s) -o $@ $<
116
117$(OBJS_DIR)/%.o:                $(UTSBASE)/sun4/brand/solaris10/%.s
118	$(COMPILE.s) -o $@ $<
119
120$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/vm/%.c
121	$(COMPILE.c) -o $@ $<
122	$(CTFCONVERT_O)
123
124$(OBJS_DIR)/%.o:		$(UTSBASE)/sun4u/vm/%.s
125	$(COMPILE.s) -o $@ $<
126
127$(OBJS_DIR)/%.o:		$(UTSBASE)/sfmmu/ml/%.s
128	$(COMPILE.s) -o $@ $<
129
130$(OBJS_DIR)/%.o:		$(UTSBASE)/sfmmu/vm/%.c
131	$(COMPILE.c) -o $@ $<
132	$(CTFCONVERT_O)
133
134$(OBJS_DIR)/%.o:		$(UTSBASE)/sparc/os/%.c
135	$(COMPILE.c) -o $@ $<
136	$(CTFCONVERT_O)
137
138$(OBJS_DIR)/%.o:		$(UTSBASE)/common/os/%.c
139	$(COMPILE.c) -o $@ $<
140	$(CTFCONVERT_O)
141
142$(OBJS_DIR)/%.o:		$(SRC)/common/bignum/sun4u/%.s
143	$(COMPILE.s) -o $@ $<
144
145$(OBJS_DIR)/%.o:		$(SRC)/common/crypto/aes/%.c
146	$(COMPILE.c) -o $@ $<
147	$(CTFCONVERT_O)
148
149$(OBJS_DIR)/%.o:		$(SRC)/common/crypto/arcfour/%.c
150	$(COMPILE.c) -o $@ $<
151	$(CTFCONVERT_O)
152
153$(OBJS_DIR)/%.o:		$(SRC)/common/crypto/des/%.c
154	$(COMPILE.c) -o $@ $<
155	$(CTFCONVERT_O)
156
157$(OBJS_DIR)/%.o:		$(SRC)/common/crypto/aes/sun4u/%.s
158	$(COMPILE.s) -o $@ $<
159
160$(OBJS_DIR)/%.o:		$(SRC)/common/crypto/arcfour/sun4u/%.s
161	$(COMPILE.s) -o $@ $<
162
163$(OBJS_DIR)/%.o:		$(SRC)/common/crypto/des/sun4u/%.s
164	$(COMPILE.s) -o $@ $<
165
166$(OBJS_DIR)/%.o:		$(SRC)/common/crypto/sha1/sparc/sun4u/%.s
167	$(COMPILE.s) -o $@ $<
168
169$(OBJS_DIR)/%.o:		$(SRC)/common/atomic/sparcv9/%.s
170	$(COMPILE.s) -o $@ $<
171
172$(OBJS_DIR)/dtracestubs.s:	$(UNIX_O) $(LIBS)
173	$(NM) -u $(UNIX_O) $(LIBS) | $(GREP) __dtrace_probe_ | $(SORT) | \
174	    $(UNIQ) | $(AWK) '{ \
175	    printf("\t.global %s\n\t.type %s, #function\n%s:\n", \
176	    $$1, $$1, $$1); }' > $(OBJS_DIR)/dtracestubs.s
177
178$(DTRACESTUBS):	$(DTRACESTUBS_O)
179	$(BUILD.SO) $(DTRACESTUBS_O)
180
181#
182#	Section 1b: Lint `object' build rules
183#
184$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/cpu/%.c
185	@($(LHEAD) $(LINT.c) $< $(LTAIL))
186
187$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/cpu/%.s
188	@($(LHEAD) $(LINT.s) $< $(LTAIL))
189
190$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/io/ppm/%.c
191	@($(LHEAD) $(LINT.c) $< $(LTAIL))
192
193$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/ppm/%.c
194	@($(LHEAD) $(LINT.c) $< $(LTAIL))
195
196$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/io/%.c
197	@($(LHEAD) $(LINT.c) $< $(LTAIL))
198
199$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/io/%.s
200	@($(LHEAD) $(LINT.s) $< $(LTAIL))
201
202$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/io/i2c/clients/%.c
203	@($(LHEAD) $(LINT.c) $< $(LTAIL))
204
205$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/io/i2c/misc/%.c
206	@($(LHEAD) $(LINT.c) $< $(LTAIL))
207
208$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/io/i2c/nexus/%.c
209	@($(LHEAD) $(LINT.c) $< $(LTAIL))
210
211$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/io/pci/%.c
212	@($(LHEAD) $(LINT.c) $< $(LTAIL))
213
214$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/io/pci/%.s
215	@($(LHEAD) $(LINT.s) $< $(LTAIL))
216
217$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/io/px/%.c
218	@($(LHEAD) $(LINT.c) $< $(LTAIL))
219
220$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/io/px/%.s
221	@($(LHEAD) $(LINT.s) $< $(LTAIL))
222
223$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/io/pciex/%.c
224	@($(LHEAD) $(LINT.c) $< $(LTAIL))
225
226$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/io/pciex/%.s
227	@($(LHEAD) $(LINT.s) $< $(LTAIL))
228
229$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/ml/%.s
230	@($(LHEAD) $(LINT.s) $< $(LTAIL))
231
232$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/os/%.c
233	@($(LHEAD) $(LINT.c) $< $(LTAIL))
234
235$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/pcbe/%.c
236	@($(LHEAD) $(LINT.c) $< $(LTAIL))
237
238$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4/brand/sn1/%.s
239	@($(LHEAD) $(LINT.s) $< $(LTAIL))
240
241$(LINTS_DIR)/%.ln:              $(UTSBASE)/sun4/brand/solaris10/%.s
242	@($(LHEAD) $(LINT.s) $< $(LTAIL))
243
244$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/vm/%.c
245	@($(LHEAD) $(LINT.c) $< $(LTAIL))
246
247$(LINTS_DIR)/%.ln:		$(UTSBASE)/sun4u/vm/%.s
248	@($(LHEAD) $(LINT.s) $< $(LTAIL))
249
250$(LINTS_DIR)/%.ln:		$(UTSBASE)/sfmmu/ml/%.s
251	@($(LHEAD) $(LINT.s) $< $(LTAIL))
252
253$(LINTS_DIR)/%.ln:		$(UTSBASE)/sfmmu/vm/%.c
254	@($(LHEAD) $(LINT.c) $< $(LTAIL))
255
256$(LINTS_DIR)/%.ln:		$(UTSBASE)/sparc/os/%.c
257	@($(LHEAD) $(LINT.c) $< $(LTAIL))
258
259$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/os/%.c
260	@($(LHEAD) $(LINT.c) $< $(LTAIL))
261
262$(LINTS_DIR)/%.ln:		$(SRC)/common/bignum/sun4u/%.s
263	@($(LHEAD) $(LINT.s) $< $(LTAIL))
264
265$(LINTS_DIR)/%.ln:		$(SRC)/common/crypto/aes/%.c
266	@($(LHEAD) $(LINT.c) $< $(LTAIL))
267
268$(LINTS_DIR)/%.ln:		$(SRC)/common/crypto/arcfour/%.c
269	@($(LHEAD) $(LINT.c) $< $(LTAIL))
270
271$(LINTS_DIR)/%.ln:		$(SRC)/common/crypto/des/%.c
272	@($(LHEAD) $(LINT.c) $< $(LTAIL))
273
274$(LINTS_DIR)/%.ln:		$(SRC)/common/crypto/aes/sun4u/%.s
275	@($(LHEAD) $(LINT.s) $< $(LTAIL))
276
277$(LINTS_DIR)/%.ln:		$(SRC)/common/crypto/arcfour/sun4u/%.s
278	@($(LHEAD) $(LINT.s) $< $(LTAIL))
279
280$(LINTS_DIR)/%.ln:		$(SRC)/common/crypto/des/sun4u/%.s
281	@($(LHEAD) $(LINT.s) $< $(LTAIL))
282
283$(LINTS_DIR)/%.ln:		$(SRC)/common/crypto/sha1/sparc/sun4u/%.s
284	@($(LHEAD) $(LINT.s) $< $(LTAIL))
285
286$(LINTS_DIR)/%.ln:		$(SRC)/common/atomic/%.c
287	@($(LHEAD) $(LINT.c) $< $(LTAIL))
288