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