xref: /illumos-gate/usr/src/lib/libc/Makefile.targ (revision 7c478bd9)
1*7c478bd9Sstevel@tonic-gate#
2*7c478bd9Sstevel@tonic-gate# CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate#
4*7c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate# Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate# (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate# with the License.
8*7c478bd9Sstevel@tonic-gate#
9*7c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate# and limitations under the License.
13*7c478bd9Sstevel@tonic-gate#
14*7c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate#
20*7c478bd9Sstevel@tonic-gate# CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate#
22*7c478bd9Sstevel@tonic-gate#
23*7c478bd9Sstevel@tonic-gate# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24*7c478bd9Sstevel@tonic-gate# Use is subject to license terms.
25*7c478bd9Sstevel@tonic-gate#
26*7c478bd9Sstevel@tonic-gate# ident	"%Z%%M%	%I%	%E% SMI"
27*7c478bd9Sstevel@tonic-gate#
28*7c478bd9Sstevel@tonic-gate
29*7c478bd9Sstevel@tonic-gate# libc build rules
30*7c478bd9Sstevel@tonic-gate
31*7c478bd9Sstevel@tonic-gate#
32*7c478bd9Sstevel@tonic-gate# This first rule picks up optimized sources for libc variants.
33*7c478bd9Sstevel@tonic-gate#
34*7c478bd9Sstevel@tonic-gatepics/%.o: $(OPTIMIZED_LIBCBASE)/gen/%.s
35*7c478bd9Sstevel@tonic-gate	$(BUILD.s)
36*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
37*7c478bd9Sstevel@tonic-gate
38*7c478bd9Sstevel@tonic-gatepics/%.o: $(LIBCBASE)/crt/%.c
39*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
40*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
41*7c478bd9Sstevel@tonic-gate
42*7c478bd9Sstevel@tonic-gatepics/%.o: $(LIBCBASE)/crt/%.s
43*7c478bd9Sstevel@tonic-gate	$(BUILD.s)
44*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
45*7c478bd9Sstevel@tonic-gate
46*7c478bd9Sstevel@tonic-gatepics/%.o: $(LIBCBASE)/gen/%.c
47*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
48*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
49*7c478bd9Sstevel@tonic-gate
50*7c478bd9Sstevel@tonic-gatepics/%.o: $(LIBCBASE)/gen/%.s
51*7c478bd9Sstevel@tonic-gate	$(BUILD.s)
52*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
53*7c478bd9Sstevel@tonic-gate
54*7c478bd9Sstevel@tonic-gatepics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/gen/%.s
55*7c478bd9Sstevel@tonic-gate	$(BUILD.s)
56*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
57*7c478bd9Sstevel@tonic-gate
58*7c478bd9Sstevel@tonic-gatepics/_stack_grow.o: $(LIBCBASE)/../$(TARGET_ARCH)/gen/_stack_grow.s
59*7c478bd9Sstevel@tonic-gate	$(BUILD.s) $(LIBCBASE)/../$(TARGET_ARCH)/gen/_stack_grow.s
60*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
61*7c478bd9Sstevel@tonic-gate
62*7c478bd9Sstevel@tonic-gatepics/%.o: $(LIBCBASE)/fp/%.c
63*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
64*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
65*7c478bd9Sstevel@tonic-gate
66*7c478bd9Sstevel@tonic-gatepics/%.o: $(LIBCBASE)/../$(MACH)/fp/%.c
67*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
68*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
69*7c478bd9Sstevel@tonic-gate
70*7c478bd9Sstevel@tonic-gatepics/%.o: $(LIBCBASE)/fp/%.s
71*7c478bd9Sstevel@tonic-gate	$(BUILD.s)
72*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
73*7c478bd9Sstevel@tonic-gate
74*7c478bd9Sstevel@tonic-gatepics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/fp/%.c
75*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
76*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
77*7c478bd9Sstevel@tonic-gate
78*7c478bd9Sstevel@tonic-gatepics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/fp/%.s
79*7c478bd9Sstevel@tonic-gate	$(BUILD.s)
80*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
81*7c478bd9Sstevel@tonic-gate
82*7c478bd9Sstevel@tonic-gatepics/%.o: $(LIBCBASE)/sys/%.c
83*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
84*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
85*7c478bd9Sstevel@tonic-gate
86*7c478bd9Sstevel@tonic-gatepics/%.o: $(LIBCBASE)/../common/sys/%.s
87*7c478bd9Sstevel@tonic-gate	$(BUILD.s)
88*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
89*7c478bd9Sstevel@tonic-gate
90*7c478bd9Sstevel@tonic-gatepics/%.o: $(LIBCBASE)/sys/%.s
91*7c478bd9Sstevel@tonic-gate	$(BUILD.s)
92*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
93*7c478bd9Sstevel@tonic-gate
94*7c478bd9Sstevel@tonic-gatepics/%.o: $(LIBCBASE)/../$(MACH)/sys/%.s
95*7c478bd9Sstevel@tonic-gate	$(BUILD.s)
96*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
97*7c478bd9Sstevel@tonic-gate
98*7c478bd9Sstevel@tonic-gatepics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/sys/%.c
99*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
100*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
101*7c478bd9Sstevel@tonic-gate
102*7c478bd9Sstevel@tonic-gatepics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/sys/%.s
103*7c478bd9Sstevel@tonic-gate	$(BUILD.s)
104*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
105*7c478bd9Sstevel@tonic-gate
106*7c478bd9Sstevel@tonic-gate# rules to build large file aware objects (xxx64.o from xxx.s or xxx.c)
107*7c478bd9Sstevel@tonic-gate
108*7c478bd9Sstevel@tonic-gatepics/%64.o: $(LIBCBASE)/../common/sys/%.s
109*7c478bd9Sstevel@tonic-gate	$(BUILD.s)
110*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
111*7c478bd9Sstevel@tonic-gate
112*7c478bd9Sstevel@tonic-gatepics/%64.o: $(LIBCBASE)/sys/%.s
113*7c478bd9Sstevel@tonic-gate	$(BUILD.s)
114*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
115*7c478bd9Sstevel@tonic-gate
116*7c478bd9Sstevel@tonic-gatepics/%64.o: $(LIBCBASE)/gen/%.c
117*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
118*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
119*7c478bd9Sstevel@tonic-gate
120*7c478bd9Sstevel@tonic-gatepics/%64.o: $(LIBCBASE)/../port/gen/%.c
121*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
122*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
123*7c478bd9Sstevel@tonic-gate
124*7c478bd9Sstevel@tonic-gatepics/%64.o: $(LIBCBASE)/../port/sys/%.c
125*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
126*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
127*7c478bd9Sstevel@tonic-gate
128*7c478bd9Sstevel@tonic-gatepics/%64.o: $(LIBCBASE)/../port/print/%.c
129*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
130*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
131*7c478bd9Sstevel@tonic-gate
132*7c478bd9Sstevel@tonic-gatepics/%64.o: $(LIBCBASE)/../port/stdio/%.c
133*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
134*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
135*7c478bd9Sstevel@tonic-gate
136*7c478bd9Sstevel@tonic-gatepics/%_w.o: $(LIBCBASE)/../port/stdio/%.c
137*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
138*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
139*7c478bd9Sstevel@tonic-gate
140*7c478bd9Sstevel@tonic-gatepics/%_w.o: $(LIBCBASE)/../port/print/%.c
141*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
142*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
143*7c478bd9Sstevel@tonic-gate
144*7c478bd9Sstevel@tonic-gatepics/%_pos.o: $(LIBCBASE)/../port/i18n/%.c
145*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
146*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
147*7c478bd9Sstevel@tonic-gate
148*7c478bd9Sstevel@tonic-gatepics/%_sbyte.o: $(LIBCBASE)/../port/i18n/%.c
149*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
150*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
151*7c478bd9Sstevel@tonic-gate
152*7c478bd9Sstevel@tonic-gatepics/%_possbyte.o: $(LIBCBASE)/../port/i18n/%.c
153*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
154*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
155*7c478bd9Sstevel@tonic-gate
156*7c478bd9Sstevel@tonic-gatepics/%_longlong.o: $(LIBCBASE)/../port/i18n/%.c
157*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
158*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
159*7c478bd9Sstevel@tonic-gate
160*7c478bd9Sstevel@tonic-gate# libc build rules for objects built from "portable" source in ../port
161*7c478bd9Sstevel@tonic-gate
162*7c478bd9Sstevel@tonic-gatepics/%.o: $(LIBCBASE)/../port/fp/%.c
163*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) \
164*7c478bd9Sstevel@tonic-gate	-I$(LIBCBASE)/../port/fp -o $@ $<
165*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
166*7c478bd9Sstevel@tonic-gate
167*7c478bd9Sstevel@tonic-gatepics/%.o: $(LIBCBASE)/../port/i18n/%.c
168*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) \
169*7c478bd9Sstevel@tonic-gate	-I$(LIBCBASE)/../port/i18n -o $@ $<
170*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
171*7c478bd9Sstevel@tonic-gate
172*7c478bd9Sstevel@tonic-gate# gen rules
173*7c478bd9Sstevel@tonic-gatepics/%.o %.o: $(LIBCBASE)/../port/gen/%.c
174*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
175*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
176*7c478bd9Sstevel@tonic-gate
177*7c478bd9Sstevel@tonic-gate# print rules
178*7c478bd9Sstevel@tonic-gatepics/%.o: $(LIBCBASE)/../port/print/%.c
179*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
180*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
181*7c478bd9Sstevel@tonic-gate
182*7c478bd9Sstevel@tonic-gate# regex rules
183*7c478bd9Sstevel@tonic-gatepics/%.o: $(LIBCBASE)/../port/regex/%.c
184*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -DM_I18N_MB -DI18N \
185*7c478bd9Sstevel@tonic-gate	-I$(LIBCBASE)/../port/regex \
186*7c478bd9Sstevel@tonic-gate	-I$(LIBCBASE)/../port/gen -o $@ $<
187*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
188*7c478bd9Sstevel@tonic-gate
189*7c478bd9Sstevel@tonic-gate# stdio rules
190*7c478bd9Sstevel@tonic-gatepics/%.o: $(LIBCBASE)/../port/stdio/%.c
191*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
192*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
193*7c478bd9Sstevel@tonic-gate
194*7c478bd9Sstevel@tonic-gate# c89 print, stdio rules
195*7c478bd9Sstevel@tonic-gatepics/%_c89.o: $(LIBCBASE)/../port/print/%.c
196*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
197*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
198*7c478bd9Sstevel@tonic-gate
199*7c478bd9Sstevel@tonic-gatepics/%_c89.o: $(LIBCBASE)/../port/stdio/%.c
200*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
201*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
202*7c478bd9Sstevel@tonic-gate
203*7c478bd9Sstevel@tonic-gate# threads rules
204*7c478bd9Sstevel@tonic-gatepics/%.o: $(LIBCBASE)/../port/threads/%.c
205*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
206*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
207*7c478bd9Sstevel@tonic-gate
208*7c478bd9Sstevel@tonic-gatepics/%.o: $(LIBCBASE)/threads/%.c
209*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
210*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
211*7c478bd9Sstevel@tonic-gate
212*7c478bd9Sstevel@tonic-gatepics/%.o: $(LIBCBASE)/threads/%.s
213*7c478bd9Sstevel@tonic-gate	$(BUILD.s)
214*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
215*7c478bd9Sstevel@tonic-gate
216*7c478bd9Sstevel@tonic-gatepics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/threads/%.c
217*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
218*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
219*7c478bd9Sstevel@tonic-gate
220*7c478bd9Sstevel@tonic-gatepics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/threads/%.s
221*7c478bd9Sstevel@tonic-gate	$(BUILD.s)
222*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
223*7c478bd9Sstevel@tonic-gate
224*7c478bd9Sstevel@tonic-gatepics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/unwind/%.c
225*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
226*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
227*7c478bd9Sstevel@tonic-gate
228*7c478bd9Sstevel@tonic-gatepics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/unwind/%.s
229*7c478bd9Sstevel@tonic-gate	$(BUILD.s)
230*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
231*7c478bd9Sstevel@tonic-gate
232*7c478bd9Sstevel@tonic-gatepics/%.o: $(LIBCBASE)/../port/unwind/%.c
233*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
234*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
235*7c478bd9Sstevel@tonic-gate
236*7c478bd9Sstevel@tonic-gatepics/%.o: $(LIBCBASE)/../$(MACH)/unwind/%.s
237*7c478bd9Sstevel@tonic-gate	$(BUILD.s)
238*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
239*7c478bd9Sstevel@tonic-gate
240*7c478bd9Sstevel@tonic-gatepics/%.o: $(LIBCBASE)/../port/sys/%.c
241*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
242*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
243*7c478bd9Sstevel@tonic-gate
244*7c478bd9Sstevel@tonic-gatepics/%.o: $(LIBCBASE)/../../common/common/%.c
245*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
246*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
247*7c478bd9Sstevel@tonic-gate
248*7c478bd9Sstevel@tonic-gatepics/%.o: $(LIBCBASE)/$(CRTSRCS)/%.s
249*7c478bd9Sstevel@tonic-gate	$(BUILD.s)
250*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
251*7c478bd9Sstevel@tonic-gate
252*7c478bd9Sstevel@tonic-gate# $(SRC)/common rules
253*7c478bd9Sstevel@tonic-gatepics/%.o: $(SRC)/common/atomic/$(TRANSMACH)/%.s
254*7c478bd9Sstevel@tonic-gate	$(BUILD.s)
255*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
256*7c478bd9Sstevel@tonic-gate
257*7c478bd9Sstevel@tonic-gate$(COMOBJS:%=pics/%): $(SRC)/common/util/$$(@F:.o=.c)
258*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $(SRC)/common/util/$(@F:.o=.c)
259*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
260*7c478bd9Sstevel@tonic-gate
261*7c478bd9Sstevel@tonic-gate# dtrace rules
262*7c478bd9Sstevel@tonic-gatepics/%.o: ../port/threads/%.d $(THREADSOBJS:%=pics/%)
263*7c478bd9Sstevel@tonic-gate	$(COMPILE.d) -C -xlazyload -s $< -o $@ $(THREADSOBJS:%=pics/%)
264*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
265*7c478bd9Sstevel@tonic-gate
266*7c478bd9Sstevel@tonic-gateinclude $(SRC)/lib/Makefile.targ
267