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.
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.
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]
22 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
24 # Copyright 2016 Joyent, Inc.
31 # This first rule picks up optimized sources for libc variants.
33 pics/%.o: $(OPTIMIZED_LIBCBASE)/gen/%.s
37 pics/%.o: $(LIBCBASE)/crt/%.c
41 pics/%.o: $(LIBCBASE)/crt/%.s
45 pics/%.o: $(LIBCBASE)/gen/%.c
49 pics/%.o: $(LIBCBASE)/gen/%.s
53 pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/gen/%.s
57 pics/_stack_grow.o: $(LIBCBASE)/../$(TARGET_ARCH)/gen/_stack_grow.s
58 $(BUILD.s) $(LIBCBASE)/../$(TARGET_ARCH)/gen/_stack_grow.s
61 pics/%.o: $(LIBCBASE)/fp/%.c
65 pics/%.o: $(LIBCBASE)/../$(MACH)/fp/%.c
69 pics/%.o: $(LIBCBASE)/fp/%.s
73 pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/fp/%.c
77 pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/fp/%.s
81 pics/%.o: $(LIBCBASE)/sys/%.c
85 pics/%.o: $(LIBCBASE)/../common/sys/%.s
89 pics/%.o: $(LIBCBASE)/sys/%.s
93 pics/%.o: $(LIBCBASE)/../$(MACH)/sys/%.s
97 pics/%.o: $(LIBCBASE)/../$(MACH)/sys/%.c
101 pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/sys/%.c
102 $(COMPILE.c) -o $@ $<
105 pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/sys/%.s
109 # rules to build large file aware objects (xxx64.o from xxx.s or xxx.c)
111 pics/%64.o: $(LIBCBASE)/../common/sys/%.s
115 pics/%64.o: $(LIBCBASE)/sys/%.s
119 pics/%64.o: $(LIBCBASE)/gen/%.c
120 $(COMPILE.c) -o $@ $<
123 pics/%64.o: $(LIBCBASE)/../port/gen/%.c
124 $(COMPILE.c) -o $@ $<
127 pics/%64.o: $(LIBCBASE)/../port/sys/%.c
128 $(COMPILE.c) -o $@ $<
131 pics/%64.o: $(LIBCBASE)/../port/print/%.c
132 $(COMPILE.c) -o $@ $<
135 pics/%64.o: $(LIBCBASE)/../port/regex/%.c
136 $(COMPILE.c) -DM_I18N_MB -DI18N \
137 -I$(LIBCBASE)/../port/regex \
138 -I$(LIBCBASE)/../port/gen -o $@ $<
141 pics/%64.o: $(LIBCBASE)/../port/stdio/%.c
142 $(COMPILE.c) -o $@ $<
145 pics/%_w.o: $(LIBCBASE)/../port/stdio/%.c
146 $(COMPILE.c) -o $@ $<
149 pics/%_w.o: $(LIBCBASE)/../port/print/%.c
150 $(COMPILE.c) -o $@ $<
153 pics/%_pos.o: $(LIBCBASE)/../port/i18n/%.c
154 $(COMPILE.c) -o $@ $<
157 pics/%_sbyte.o: $(LIBCBASE)/../port/i18n/%.c
158 $(COMPILE.c) -o $@ $<
161 pics/%_possbyte.o: $(LIBCBASE)/../port/i18n/%.c
162 $(COMPILE.c) -o $@ $<
165 pics/%_longlong.o: $(LIBCBASE)/../port/i18n/%.c
166 $(COMPILE.c) -o $@ $<
169 # libc build rules for objects built from "portable" source in ../port
171 pics/%.o: $(LIBCBASE)/../port/fp/%.c
173 -I$(LIBCBASE)/../port/fp -o $@ $<
176 pics/%.o: $(LIBCBASE)/../port/i18n/%.c
178 -I$(LIBCBASE)/../port/i18n -o $@ $<
182 pics/%.o %.o: $(LIBCBASE)/../port/gen/%.c
183 $(COMPILE.c) -o $@ $<
187 pics/%.o %.o: $(LIBCBASE)/../port/locale/%.c
188 $(COMPILE.c) -o $@ $<
192 pics/%.o: $(LIBCBASE)/../port/print/%.c
193 $(COMPILE.c) -o $@ $<
197 pics/%.o: $(LIBCBASE)/../port/regex/%.c
198 $(COMPILE.c) -DM_I18N_MB -DI18N \
199 -I$(LIBCBASE)/../port/regex \
200 -I$(LIBCBASE)/../port/gen -o $@ $<
204 pics/%.o: $(LIBCBASE)/../port/stdio/%.c
205 $(COMPILE.c) -o $@ $<
208 # c89 print, stdio rules
209 pics/%_c89.o: $(LIBCBASE)/../port/print/%.c
210 $(COMPILE.c) -o $@ $<
213 pics/%_c89.o: $(LIBCBASE)/../port/stdio/%.c
214 $(COMPILE.c) -o $@ $<
218 pics/%.o: $(LIBCBASE)/../port/aio/%.c
219 $(COMPILE.c) -o $@ $<
223 pics/%.o: $(LIBCBASE)/../port/rt/%.c
224 $(COMPILE.c) -o $@ $<
228 pics/%.o: $(LIBCBASE)/../port/tpool/%.c
229 $(COMPILE.c) -o $@ $<
233 pics/%.o: $(LIBCBASE)/../port/threads/%.c
234 $(COMPILE.c) -o $@ $<
237 pics/%.o: $(LIBCBASE)/threads/%.c
238 $(COMPILE.c) -o $@ $<
241 pics/%.o: $(LIBCBASE)/threads/%.s
245 pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/threads/%.c
246 $(COMPILE.c) -o $@ $<
249 pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/threads/%.s
253 pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/unwind/%.c
254 $(COMPILE.c) -o $@ $<
257 pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/unwind/%.s
261 pics/%.o: $(LIBCBASE)/../port/unwind/%.c
262 $(COMPILE.c) -o $@ $<
265 pics/%.o: $(LIBCBASE)/../$(MACH)/unwind/%.s
269 pics/%.o: $(LIBCBASE)/../port/sys/%.c
270 $(COMPILE.c) -o $@ $<
273 pics/%.o: $(LIBCBASE)/../../common/common/%.c
274 $(COMPILE.c) -o $@ $<
277 pics/%.o: $(LIBCBASE)/$(CRTSRCS)/%.s
281 # $(SRC)/common rules
282 pics/%.o: $(SRC)/common/atomic/$(TARGETMACH)/%.s
286 $(COMOBJS:%=pics/%): $(SRC)/common/util/$$(@F:.o=.c)
287 $(COMPILE.c) -o $@ $(SRC)/common/util/$(@F:.o=.c)
290 $(XATTROBJS:%=pics/%): $(SRC)/common/xattr/$$(@F:.o=.c)
291 $(COMPILE.c) -o $@ $(SRC)/common/xattr/$(@F:.o=.c)
294 $(DTRACEOBJS:%=pics/%): $(SRC)/common/dtrace/$$(@F:.o=.c)
295 $(COMPILE.c) -o $@ $(SRC)/common/dtrace/$(@F:.o=.c)
298 $(SECFLAGSOBJS:%=pics/%): $(SRC)/common/secflags/$$(@F:.o=.c)
299 $(COMPILE.c) -o $@ $(SRC)/common/secflags/$(@F:.o=.c)
302 $(UNICODEOBJS:%=pics/%): $(SRC)/common/unicode/$$(@F:.o=.c)
303 $(COMPILE.c) -o $@ $(SRC)/common/unicode/$(@F:.o=.c)
306 $(CHACHAOBJS:%=pics/%): $(SRC)/common/crypto/chacha/$$(@F:.o=.c)
307 $(COMPILE.c) -I$(SRC)/common/crypto/chacha -DKEYSTREAM_ONLY \
308 -o $@ $(SRC)/common/crypto/chacha/$(@F:.o=.c)
312 pics/%.o: $(LIBCBASE)/../port/threads/%.d $(THREADSOBJS:%=pics/%)
313 $(COMPILE.d) -C -xlazyload -s $< -o $@ $(THREADSOBJS:%=pics/%)
316 include $(SRC)/lib/Makefile.targ