xref: /titanic_50/usr/src/lib/libc/Makefile.targ (revision bbe876c07ed632b8f85e195d41e7948382064a95)
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 2009 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25#
26
27# libc build rules
28
29#
30# This first rule picks up optimized sources for libc variants.
31#
32pics/%.o: $(OPTIMIZED_LIBCBASE)/gen/%.s
33	$(BUILD.s)
34	$(POST_PROCESS_O)
35
36pics/%.o: $(LIBCBASE)/crt/%.c
37	$(COMPILE.c) -o $@ $<
38	$(POST_PROCESS_O)
39
40pics/%.o: $(LIBCBASE)/crt/%.s
41	$(BUILD.s)
42	$(POST_PROCESS_O)
43
44pics/%.o: $(LIBCBASE)/gen/%.c
45	$(COMPILE.c) -o $@ $<
46	$(POST_PROCESS_O)
47
48pics/%.o: $(LIBCBASE)/gen/%.s
49	$(BUILD.s)
50	$(POST_PROCESS_O)
51
52pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/gen/%.s
53	$(BUILD.s)
54	$(POST_PROCESS_O)
55
56pics/_stack_grow.o: $(LIBCBASE)/../$(TARGET_ARCH)/gen/_stack_grow.s
57	$(BUILD.s) $(LIBCBASE)/../$(TARGET_ARCH)/gen/_stack_grow.s
58	$(POST_PROCESS_O)
59
60pics/%.o: $(LIBCBASE)/fp/%.c
61	$(COMPILE.c) -o $@ $<
62	$(POST_PROCESS_O)
63
64pics/%.o: $(LIBCBASE)/../$(MACH)/fp/%.c
65	$(COMPILE.c) -o $@ $<
66	$(POST_PROCESS_O)
67
68pics/%.o: $(LIBCBASE)/fp/%.s
69	$(BUILD.s)
70	$(POST_PROCESS_O)
71
72pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/fp/%.c
73	$(COMPILE.c) -o $@ $<
74	$(POST_PROCESS_O)
75
76pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/fp/%.s
77	$(BUILD.s)
78	$(POST_PROCESS_O)
79
80pics/%.o: $(LIBCBASE)/sys/%.c
81	$(COMPILE.c) -o $@ $<
82	$(POST_PROCESS_O)
83
84pics/%.o: $(LIBCBASE)/../common/sys/%.s
85	$(BUILD.s)
86	$(POST_PROCESS_O)
87
88pics/%.o: $(LIBCBASE)/sys/%.s
89	$(BUILD.s)
90	$(POST_PROCESS_O)
91
92pics/%.o: $(LIBCBASE)/../$(MACH)/sys/%.s
93	$(BUILD.s)
94	$(POST_PROCESS_O)
95
96pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/sys/%.c
97	$(COMPILE.c) -o $@ $<
98	$(POST_PROCESS_O)
99
100pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/sys/%.s
101	$(BUILD.s)
102	$(POST_PROCESS_O)
103
104# rules to build large file aware objects (xxx64.o from xxx.s or xxx.c)
105
106pics/%64.o: $(LIBCBASE)/../common/sys/%.s
107	$(BUILD.s)
108	$(POST_PROCESS_O)
109
110pics/%64.o: $(LIBCBASE)/sys/%.s
111	$(BUILD.s)
112	$(POST_PROCESS_O)
113
114pics/%64.o: $(LIBCBASE)/gen/%.c
115	$(COMPILE.c) -o $@ $<
116	$(POST_PROCESS_O)
117
118pics/%64.o: $(LIBCBASE)/../port/gen/%.c
119	$(COMPILE.c) -o $@ $<
120	$(POST_PROCESS_O)
121
122pics/%64.o: $(LIBCBASE)/../port/sys/%.c
123	$(COMPILE.c) -o $@ $<
124	$(POST_PROCESS_O)
125
126pics/%64.o: $(LIBCBASE)/../port/print/%.c
127	$(COMPILE.c) -o $@ $<
128	$(POST_PROCESS_O)
129
130pics/%64.o: $(LIBCBASE)/../port/stdio/%.c
131	$(COMPILE.c) -o $@ $<
132	$(POST_PROCESS_O)
133
134pics/%_w.o: $(LIBCBASE)/../port/stdio/%.c
135	$(COMPILE.c) -o $@ $<
136	$(POST_PROCESS_O)
137
138pics/%_w.o: $(LIBCBASE)/../port/print/%.c
139	$(COMPILE.c) -o $@ $<
140	$(POST_PROCESS_O)
141
142pics/%_pos.o: $(LIBCBASE)/../port/i18n/%.c
143	$(COMPILE.c) -o $@ $<
144	$(POST_PROCESS_O)
145
146pics/%_sbyte.o: $(LIBCBASE)/../port/i18n/%.c
147	$(COMPILE.c) -o $@ $<
148	$(POST_PROCESS_O)
149
150pics/%_possbyte.o: $(LIBCBASE)/../port/i18n/%.c
151	$(COMPILE.c) -o $@ $<
152	$(POST_PROCESS_O)
153
154pics/%_longlong.o: $(LIBCBASE)/../port/i18n/%.c
155	$(COMPILE.c) -o $@ $<
156	$(POST_PROCESS_O)
157
158# libc build rules for objects built from "portable" source in ../port
159
160pics/%.o: $(LIBCBASE)/../port/fp/%.c
161	$(COMPILE.c) \
162	-I$(LIBCBASE)/../port/fp -o $@ $<
163	$(POST_PROCESS_O)
164
165pics/%.o: $(LIBCBASE)/../port/i18n/%.c
166	$(COMPILE.c) \
167	-I$(LIBCBASE)/../port/i18n -o $@ $<
168	$(POST_PROCESS_O)
169
170# gen rules
171pics/%.o %.o: $(LIBCBASE)/../port/gen/%.c
172	$(COMPILE.c) -o $@ $<
173	$(POST_PROCESS_O)
174
175# locale rules
176pics/%.o %.o: $(LIBCBASE)/../port/locale/%.c
177	$(COMPILE.c) -o $@ $<
178	$(POST_PROCESS_O)
179
180# print rules
181pics/%.o: $(LIBCBASE)/../port/print/%.c
182	$(COMPILE.c) -o $@ $<
183	$(POST_PROCESS_O)
184
185# regex rules
186pics/%.o: $(LIBCBASE)/../port/regex/%.c
187	$(COMPILE.c) -DM_I18N_MB -DI18N \
188	-I$(LIBCBASE)/../port/regex \
189	-I$(LIBCBASE)/../port/gen -o $@ $<
190	$(POST_PROCESS_O)
191
192# stdio rules
193pics/%.o: $(LIBCBASE)/../port/stdio/%.c
194	$(COMPILE.c) -o $@ $<
195	$(POST_PROCESS_O)
196
197# c89 print, stdio rules
198pics/%_c89.o: $(LIBCBASE)/../port/print/%.c
199	$(COMPILE.c) -o $@ $<
200	$(POST_PROCESS_O)
201
202pics/%_c89.o: $(LIBCBASE)/../port/stdio/%.c
203	$(COMPILE.c) -o $@ $<
204	$(POST_PROCESS_O)
205
206# aio rules
207pics/%.o: $(LIBCBASE)/../port/aio/%.c
208	$(COMPILE.c) -o $@ $<
209	$(POST_PROCESS_O)
210
211# rt rules
212pics/%.o: $(LIBCBASE)/../port/rt/%.c
213	$(COMPILE.c) -o $@ $<
214	$(POST_PROCESS_O)
215
216# tpool rules
217pics/%.o: $(LIBCBASE)/../port/tpool/%.c
218	$(COMPILE.c) -o $@ $<
219	$(POST_PROCESS_O)
220
221# threads rules
222pics/%.o: $(LIBCBASE)/../port/threads/%.c
223	$(COMPILE.c) -o $@ $<
224	$(POST_PROCESS_O)
225
226pics/%.o: $(LIBCBASE)/threads/%.c
227	$(COMPILE.c) -o $@ $<
228	$(POST_PROCESS_O)
229
230pics/%.o: $(LIBCBASE)/threads/%.s
231	$(BUILD.s)
232	$(POST_PROCESS_O)
233
234pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/threads/%.c
235	$(COMPILE.c) -o $@ $<
236	$(POST_PROCESS_O)
237
238pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/threads/%.s
239	$(BUILD.s)
240	$(POST_PROCESS_O)
241
242pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/unwind/%.c
243	$(COMPILE.c) -o $@ $<
244	$(POST_PROCESS_O)
245
246pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/unwind/%.s
247	$(BUILD.s)
248	$(POST_PROCESS_O)
249
250pics/%.o: $(LIBCBASE)/../port/unwind/%.c
251	$(COMPILE.c) -o $@ $<
252	$(POST_PROCESS_O)
253
254pics/%.o: $(LIBCBASE)/../$(MACH)/unwind/%.s
255	$(BUILD.s)
256	$(POST_PROCESS_O)
257
258pics/%.o: $(LIBCBASE)/../port/sys/%.c
259	$(COMPILE.c) -o $@ $<
260	$(POST_PROCESS_O)
261
262pics/%.o: $(LIBCBASE)/../../common/common/%.c
263	$(COMPILE.c) -o $@ $<
264	$(POST_PROCESS_O)
265
266pics/%.o: $(LIBCBASE)/$(CRTSRCS)/%.s
267	$(BUILD.s)
268	$(POST_PROCESS_O)
269
270# $(SRC)/common rules
271pics/%.o: $(SRC)/common/atomic/$(TARGETMACH)/%.s
272	$(BUILD.s)
273	$(POST_PROCESS_O)
274
275$(COMOBJS:%=pics/%): $(SRC)/common/util/$$(@F:.o=.c)
276	$(COMPILE.c) -o $@ $(SRC)/common/util/$(@F:.o=.c)
277	$(POST_PROCESS_O)
278
279$(XATTROBJS:%=pics/%): $(SRC)/common/xattr/$$(@F:.o=.c)
280	$(COMPILE.c) -o $@ $(SRC)/common/xattr/$(@F:.o=.c)
281	$(POST_PROCESS_O)
282
283$(DTRACEOBJS:%=pics/%): $(SRC)/common/dtrace/$$(@F:.o=.c)
284	$(COMPILE.c) -o $@ $(SRC)/common/dtrace/$(@F:.o=.c)
285	$(POST_PROCESS_O)
286
287$(UNICODEOBJS:%=pics/%): $(SRC)/common/unicode/$$(@F:.o=.c)
288	$(COMPILE.c) -o $@ $(SRC)/common/unicode/$(@F:.o=.c)
289	$(POST_PROCESS_O)
290
291$(CHACHAOBJS:%=pics/%): $(SRC)/common/crypto/chacha/$$(@F:.o=.c)
292	$(COMPILE.c) -I$(SRC)/common/crypto/chacha -DKEYSTREAM_ONLY \
293	    -o $@ $(SRC)/common/crypto/chacha/$(@F:.o=.c)
294	$(POST_PROCESS_O)
295
296# DTrace rules
297pics/%.o: $(LIBCBASE)/../port/threads/%.d $(THREADSOBJS:%=pics/%)
298	$(COMPILE.d) -C -xlazyload -s $< -o $@ $(THREADSOBJS:%=pics/%)
299	$(POST_PROCESS_O)
300
301include $(SRC)/lib/Makefile.targ
302