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)/common/%.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: $(LIBCBASE)/../port/inet/%.c
188 $(COMPILE.c) -DSYSV -o $@ $<
192 pics/%.o %.o: $(LIBCBASE)/../port/locale/%.c
193 $(COMPILE.c) -o $@ $<
197 pics/%.o: $(LIBCBASE)/../port/nsl/%.c $(LIBCBASE)/../port/nsl/nis_clnt.h
198 $(COMPILE.c) -o $@ $<
202 pics/%.o: $(LIBCBASE)/../port/print/%.c
203 $(COMPILE.c) -o $@ $<
207 pics/%.o: $(LIBCBASE)/../port/regex/%.c
208 $(COMPILE.c) -DM_I18N_MB -DI18N \
209 -I$(LIBCBASE)/../port/regex \
210 -I$(LIBCBASE)/../port/gen -o $@ $<
214 pics/%.o: $(LIBCBASE)/../port/socket/%.c
215 $(COMPILE.c) -o $@ $<
219 pics/%.o: $(LIBCBASE)/../port/stdio/%.c
220 $(COMPILE.c) -o $@ $<
223 # c89 print, stdio rules
224 pics/%_c89.o: $(LIBCBASE)/../port/print/%.c
225 $(COMPILE.c) -o $@ $<
228 pics/%_c89.o: $(LIBCBASE)/../port/stdio/%.c
229 $(COMPILE.c) -o $@ $<
233 pics/%.o: $(LIBCBASE)/../port/aio/%.c
234 $(COMPILE.c) -o $@ $<
238 pics/%.o: $(LIBCBASE)/../port/rt/%.c
239 $(COMPILE.c) -o $@ $<
243 pics/%.o: $(LIBCBASE)/../port/tpool/%.c
244 $(COMPILE.c) -o $@ $<
248 pics/%.o: $(LIBCBASE)/../port/threads/%.c
249 $(COMPILE.c) -o $@ $<
252 pics/%.o: $(LIBCBASE)/threads/%.c
253 $(COMPILE.c) -o $@ $<
256 pics/%.o: $(LIBCBASE)/threads/%.s
260 pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/threads/%.c
261 $(COMPILE.c) -o $@ $<
264 pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/threads/%.s
268 pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/unwind/%.c
269 $(COMPILE.c) -o $@ $<
272 pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/unwind/%.s
276 pics/%.o: $(LIBCBASE)/../port/unwind/%.c
277 $(COMPILE.c) -o $@ $<
280 pics/%.o: $(LIBCBASE)/../$(MACH)/unwind/%.s
284 pics/%.o: $(LIBCBASE)/../port/sys/%.c
285 $(COMPILE.c) -o $@ $<
288 pics/%.o: $(LIBCBASE)/../../crt/common/%.c
289 $(COMPILE.c) -o $@ $<
292 pics/%.o: $(LIBCBASE)/$(CRTSRCS)/%.s
296 # $(SRC)/common rules
297 pics/%.o: $(SRC)/common/atomic/$(TARGETMACH)/%.s
301 $(COMOBJS:%=pics/%): $(SRC)/common/util/$$(@F:.o=.c)
302 $(COMPILE.c) -o $@ $(SRC)/common/util/$(@F:.o=.c)
305 $(XATTROBJS:%=pics/%): $(SRC)/common/xattr/$$(@F:.o=.c)
306 $(COMPILE.c) -o $@ $(SRC)/common/xattr/$(@F:.o=.c)
309 $(DTRACEOBJS:%=pics/%): $(SRC)/common/dtrace/$$(@F:.o=.c)
310 $(COMPILE.c) -o $@ $(SRC)/common/dtrace/$(@F:.o=.c)
313 $(SECFLAGSOBJS:%=pics/%): $(SRC)/common/secflags/$$(@F:.o=.c)
314 $(COMPILE.c) -o $@ $(SRC)/common/secflags/$(@F:.o=.c)
317 $(UNICODEOBJS:%=pics/%): $(SRC)/common/unicode/$$(@F:.o=.c)
318 $(COMPILE.c) -o $@ $(SRC)/common/unicode/$(@F:.o=.c)
321 $(CHACHAOBJS:%=pics/%): $(SRC)/common/crypto/chacha/$$(@F:.o=.c)
322 $(COMPILE.c) -I$(SRC)/common/crypto/chacha -DKEYSTREAM_ONLY \
323 -o $@ $(SRC)/common/crypto/chacha/$(@F:.o=.c)
327 pics/%.o: $(LIBCBASE)/../port/threads/%.d $(THREADSOBJS:%=pics/%)
328 $(COMPILE.d) -C -xlazyload -s $< -o $@ $(THREADSOBJS:%=pics/%)
331 pics/attrat.o pics/mqueue.o := CPPFLAGS += -D__UNLEASHED_VISIBLE
333 include $(SRC)/lib/Makefile.targ
335 # rpcgen'd stuff originally from libnsl
337 RPCSVC_DIR= $(ROOTHDRDIR)/rpcsvc
338 RPCSVC_SRCDIR= $(SRCTOP)/include/rpcsvc
339 RPCSVC_UTS_SRCDIR= $(SRC)/uts/common/rpc
341 RPCSVC_FILES= daemon_utils.h nis.x nis.h nis_object.x
342 RPCSVC_FILES_UTS= key_prot.x
344 ROOTHDRS += $(RPCSVC_FILES:%=$(RPCSVC_DIR)/%)
349 $(RPCSVC_DIR)/%.h: $(RPCSVC_SRCDIR)/%.h
352 $(RPCSVC_DIR)/nis.h: $(RPCSVC_SRCDIR)/nis.x $(RPCSVC_SRCDIR)/nis_object.x
353 $(RPCGEN) -C -h $(RPCSVC_SRCDIR)/nis.x > nis-tmp.h
354 $(SED) -e '/EDIT_START/,$$ d' < nis-tmp.h > nis.h
355 $(INS) -m $(FILEMODE) nis.h $@
356 $(RM) nis.h nis-tmp.h
358 $(RPCSVC_DIR)/%.x: $(RPCSVC_SRCDIR)/%.x
361 $(RPCSVC_DIR)/%.x: $(RPCSVC_UTS_SRCDIR)/%.x
364 $(LIBCBASE)/../port/nsl/nis_clnt.h: $(RPCSVC_DIR)/nis.x $(RPCSVC_DIR)/nis_object.x
365 $(RPCGEN) -C -h $(RPCSVC_DIR)/nis.x > nis_clnt-gen.h
366 $(SED) -n -e '/EDIT_START/,$$ p' < nis_clnt-gen.h |\
367 $(SED) -e 's/_3_svc/_svc/' |\
368 $(SED) -e 's/_3/_clnt/' > $@
371 CLEANFILES += $(LIBCBASE)/../port/nsl/nis_clnt.h