xref: /illumos-gate/usr/src/lib/libc/Makefile.targ (revision c3862f21bea547737e494d7e7ff98c21a3490e6f)
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/regex/%.c
131	$(COMPILE.c) -DM_I18N_MB -DI18N \
132	-I$(LIBCBASE)/../port/regex \
133	-I$(LIBCBASE)/../port/gen -o $@ $<
134	$(POST_PROCESS_O)
135
136pics/%64.o: $(LIBCBASE)/../port/stdio/%.c
137	$(COMPILE.c) -o $@ $<
138	$(POST_PROCESS_O)
139
140pics/%_w.o: $(LIBCBASE)/../port/stdio/%.c
141	$(COMPILE.c) -o $@ $<
142	$(POST_PROCESS_O)
143
144pics/%_w.o: $(LIBCBASE)/../port/print/%.c
145	$(COMPILE.c) -o $@ $<
146	$(POST_PROCESS_O)
147
148pics/%_pos.o: $(LIBCBASE)/../port/i18n/%.c
149	$(COMPILE.c) -o $@ $<
150	$(POST_PROCESS_O)
151
152pics/%_sbyte.o: $(LIBCBASE)/../port/i18n/%.c
153	$(COMPILE.c) -o $@ $<
154	$(POST_PROCESS_O)
155
156pics/%_possbyte.o: $(LIBCBASE)/../port/i18n/%.c
157	$(COMPILE.c) -o $@ $<
158	$(POST_PROCESS_O)
159
160pics/%_longlong.o: $(LIBCBASE)/../port/i18n/%.c
161	$(COMPILE.c) -o $@ $<
162	$(POST_PROCESS_O)
163
164# libc build rules for objects built from "portable" source in ../port
165
166pics/%.o: $(LIBCBASE)/../port/fp/%.c
167	$(COMPILE.c) \
168	-I$(LIBCBASE)/../port/fp -o $@ $<
169	$(POST_PROCESS_O)
170
171pics/%.o: $(LIBCBASE)/../port/i18n/%.c
172	$(COMPILE.c) \
173	-I$(LIBCBASE)/../port/i18n -o $@ $<
174	$(POST_PROCESS_O)
175
176# gen rules
177pics/%.o %.o: $(LIBCBASE)/../port/gen/%.c
178	$(COMPILE.c) -o $@ $<
179	$(POST_PROCESS_O)
180
181# locale rules
182pics/%.o %.o: $(LIBCBASE)/../port/locale/%.c
183	$(COMPILE.c) -o $@ $<
184	$(POST_PROCESS_O)
185
186# print rules
187pics/%.o: $(LIBCBASE)/../port/print/%.c
188	$(COMPILE.c) -o $@ $<
189	$(POST_PROCESS_O)
190
191# regex rules
192pics/%.o: $(LIBCBASE)/../port/regex/%.c
193	$(COMPILE.c) -DM_I18N_MB -DI18N \
194	-I$(LIBCBASE)/../port/regex \
195	-I$(LIBCBASE)/../port/gen -o $@ $<
196	$(POST_PROCESS_O)
197
198# stdio rules
199pics/%.o: $(LIBCBASE)/../port/stdio/%.c
200	$(COMPILE.c) -o $@ $<
201	$(POST_PROCESS_O)
202
203# c89 print, stdio rules
204pics/%_c89.o: $(LIBCBASE)/../port/print/%.c
205	$(COMPILE.c) -o $@ $<
206	$(POST_PROCESS_O)
207
208pics/%_c89.o: $(LIBCBASE)/../port/stdio/%.c
209	$(COMPILE.c) -o $@ $<
210	$(POST_PROCESS_O)
211
212# aio rules
213pics/%.o: $(LIBCBASE)/../port/aio/%.c
214	$(COMPILE.c) -o $@ $<
215	$(POST_PROCESS_O)
216
217# rt rules
218pics/%.o: $(LIBCBASE)/../port/rt/%.c
219	$(COMPILE.c) -o $@ $<
220	$(POST_PROCESS_O)
221
222# tpool rules
223pics/%.o: $(LIBCBASE)/../port/tpool/%.c
224	$(COMPILE.c) -o $@ $<
225	$(POST_PROCESS_O)
226
227# threads rules
228pics/%.o: $(LIBCBASE)/../port/threads/%.c
229	$(COMPILE.c) -o $@ $<
230	$(POST_PROCESS_O)
231
232pics/%.o: $(LIBCBASE)/threads/%.c
233	$(COMPILE.c) -o $@ $<
234	$(POST_PROCESS_O)
235
236pics/%.o: $(LIBCBASE)/threads/%.s
237	$(BUILD.s)
238	$(POST_PROCESS_O)
239
240pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/threads/%.c
241	$(COMPILE.c) -o $@ $<
242	$(POST_PROCESS_O)
243
244pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/threads/%.s
245	$(BUILD.s)
246	$(POST_PROCESS_O)
247
248pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/unwind/%.c
249	$(COMPILE.c) -o $@ $<
250	$(POST_PROCESS_O)
251
252pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/unwind/%.s
253	$(BUILD.s)
254	$(POST_PROCESS_O)
255
256pics/%.o: $(LIBCBASE)/../port/unwind/%.c
257	$(COMPILE.c) -o $@ $<
258	$(POST_PROCESS_O)
259
260pics/%.o: $(LIBCBASE)/../$(MACH)/unwind/%.s
261	$(BUILD.s)
262	$(POST_PROCESS_O)
263
264pics/%.o: $(LIBCBASE)/../port/sys/%.c
265	$(COMPILE.c) -o $@ $<
266	$(POST_PROCESS_O)
267
268pics/%.o: $(LIBCBASE)/../../common/common/%.c
269	$(COMPILE.c) -o $@ $<
270	$(POST_PROCESS_O)
271
272pics/%.o: $(LIBCBASE)/$(CRTSRCS)/%.s
273	$(BUILD.s)
274	$(POST_PROCESS_O)
275
276# $(SRC)/common rules
277pics/%.o: $(SRC)/common/atomic/$(TARGETMACH)/%.s
278	$(BUILD.s)
279	$(POST_PROCESS_O)
280
281$(COMOBJS:%=pics/%): $(SRC)/common/util/$$(@F:.o=.c)
282	$(COMPILE.c) -o $@ $(SRC)/common/util/$(@F:.o=.c)
283	$(POST_PROCESS_O)
284
285$(XATTROBJS:%=pics/%): $(SRC)/common/xattr/$$(@F:.o=.c)
286	$(COMPILE.c) -o $@ $(SRC)/common/xattr/$(@F:.o=.c)
287	$(POST_PROCESS_O)
288
289$(DTRACEOBJS:%=pics/%): $(SRC)/common/dtrace/$$(@F:.o=.c)
290	$(COMPILE.c) -o $@ $(SRC)/common/dtrace/$(@F:.o=.c)
291	$(POST_PROCESS_O)
292
293$(UNICODEOBJS:%=pics/%): $(SRC)/common/unicode/$$(@F:.o=.c)
294	$(COMPILE.c) -o $@ $(SRC)/common/unicode/$(@F:.o=.c)
295	$(POST_PROCESS_O)
296
297$(CHACHAOBJS:%=pics/%): $(SRC)/common/crypto/chacha/$$(@F:.o=.c)
298	$(COMPILE.c) -I$(SRC)/common/crypto/chacha -DKEYSTREAM_ONLY \
299	    -o $@ $(SRC)/common/crypto/chacha/$(@F:.o=.c)
300	$(POST_PROCESS_O)
301
302# DTrace rules
303pics/%.o: $(LIBCBASE)/../port/threads/%.d $(THREADSOBJS:%=pics/%)
304	$(COMPILE.d) -C -xlazyload -s $< -o $@ $(THREADSOBJS:%=pics/%)
305	$(POST_PROCESS_O)
306
307include $(SRC)/lib/Makefile.targ
308