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