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 pics/%_w.o: $(LIBCBASE)/../port/stdio/%.c
110 $(COMPILE.c) -o $@ $<
113 pics/%_w.o: $(LIBCBASE)/../port/print/%.c
114 $(COMPILE.c) -o $@ $<
117 pics/%_pos.o: $(LIBCBASE)/../port/i18n/%.c
118 $(COMPILE.c) -o $@ $<
121 pics/%_sbyte.o: $(LIBCBASE)/../port/i18n/%.c
122 $(COMPILE.c) -o $@ $<
125 pics/%_possbyte.o: $(LIBCBASE)/../port/i18n/%.c
126 $(COMPILE.c) -o $@ $<
129 pics/%_longlong.o: $(LIBCBASE)/../port/i18n/%.c
130 $(COMPILE.c) -o $@ $<
133 # libc build rules for objects built from "portable" source in ../port
135 pics/%.o: $(LIBCBASE)/../port/fp/%.c
137 -I$(LIBCBASE)/../port/fp -o $@ $<
140 pics/%.o: $(LIBCBASE)/../port/i18n/%.c
142 -I$(LIBCBASE)/../port/i18n -o $@ $<
146 pics/%.o %.o: $(LIBCBASE)/../port/gen/%.c
147 $(COMPILE.c) -o $@ $<
151 pics/%.o: $(LIBCBASE)/../port/inet/%.c
152 $(COMPILE.c) -o $@ $<
156 pics/%.o %.o: $(LIBCBASE)/../port/locale/%.c
157 $(COMPILE.c) -o $@ $<
161 pics/%.o: $(LIBCBASE)/../port/nsl/%.c $(LIBCBASE)/../port/nsl/nis_clnt.h
162 $(COMPILE.c) -o $@ $<
166 pics/%.o: $(LIBCBASE)/../port/print/%.c
167 $(COMPILE.c) -o $@ $<
171 pics/%.o: $(LIBCBASE)/../port/regex/%.c
172 $(COMPILE.c) -DM_I18N_MB -DI18N \
173 -I$(LIBCBASE)/../port/regex \
174 -I$(LIBCBASE)/../port/gen -o $@ $<
178 pics/%.o: $(LIBCBASE)/../port/socket/%.c
179 $(COMPILE.c) -o $@ $<
183 pics/%.o: $(LIBCBASE)/../port/stdio/%.c
184 $(COMPILE.c) -o $@ $<
188 pics/%.o: $(LIBCBASE)/../port/aio/%.c
189 $(COMPILE.c) -o $@ $<
193 pics/%.o: $(LIBCBASE)/../port/rt/%.c
194 $(COMPILE.c) -o $@ $<
198 pics/%.o: $(LIBCBASE)/../port/tpool/%.c
199 $(COMPILE.c) -o $@ $<
203 pics/%.o: $(LIBCBASE)/../port/threads/%.c
204 $(COMPILE.c) -o $@ $<
207 pics/%.o: $(LIBCBASE)/threads/%.c
208 $(COMPILE.c) -o $@ $<
211 pics/%.o: $(LIBCBASE)/threads/%.s
215 pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/threads/%.c
216 $(COMPILE.c) -o $@ $<
219 pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/threads/%.s
223 pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/unwind/%.c
224 $(COMPILE.c) -o $@ $<
227 pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/unwind/%.s
231 pics/%.o: $(LIBCBASE)/../port/unwind/%.c
232 $(COMPILE.c) -o $@ $<
235 pics/%.o: $(LIBCBASE)/../$(MACH)/unwind/%.s
239 pics/%.o: $(LIBCBASE)/../port/sys/%.c
240 $(COMPILE.c) -o $@ $<
243 pics/%.o: $(LIBCBASE)/../../crt/common/%.c
244 $(COMPILE.c) -o $@ $<
247 pics/%.o: $(LIBCBASE)/$(CRTSRCS)/%.s
251 # $(SRC)/common rules
252 pics/%.o: $(SRC)/common/atomic/$(TARGETMACH)/%.s
256 $(COMOBJS:%=pics/%): $(SRC)/common/util/$$(@F:.o=.c)
257 $(COMPILE.c) -o $@ $(SRC)/common/util/$(@F:.o=.c)
260 $(XATTROBJS:%=pics/%): $(SRC)/common/xattr/$$(@F:.o=.c)
261 $(COMPILE.c) -o $@ $(SRC)/common/xattr/$(@F:.o=.c)
264 $(DTRACEOBJS:%=pics/%): $(SRC)/common/dtrace/$$(@F:.o=.c)
265 $(COMPILE.c) -o $@ $(SRC)/common/dtrace/$(@F:.o=.c)
268 $(SECFLAGSOBJS:%=pics/%): $(SRC)/common/secflags/$$(@F:.o=.c)
269 $(COMPILE.c) -o $@ $(SRC)/common/secflags/$(@F:.o=.c)
272 $(UNICODEOBJS:%=pics/%): $(SRC)/common/unicode/$$(@F:.o=.c)
273 $(COMPILE.c) -o $@ $(SRC)/common/unicode/$(@F:.o=.c)
276 $(CHACHAOBJS:%=pics/%): $(SRC)/common/crypto/chacha/$$(@F:.o=.c)
277 $(COMPILE.c) -I$(SRC)/common/crypto/chacha -DKEYSTREAM_ONLY \
278 -o $@ $(SRC)/common/crypto/chacha/$(@F:.o=.c)
282 pics/%.o: $(LIBCBASE)/../port/threads/%.d $(THREADSOBJS:%=pics/%)
283 $(COMPILE.d) -C -xlazyload -s $< -o $@ $(THREADSOBJS:%=pics/%)
286 include $(SRC)/lib/Makefile.targ
288 # rpcgen'd stuff originally from libnsl
290 RPCSVC_DIR= $(ROOTHDRDIR)/rpcsvc
291 RPCSVC_SRCDIR= $(SRCTOP)/include/rpcsvc
292 RPCSVC_UTS_SRCDIR= $(SRC)/uts/common/rpc
294 RPCSVC_FILES= daemon_utils.h nis.x nis.h nis_object.x
295 RPCSVC_FILES_UTS= key_prot.x
297 ROOTHDRS += $(RPCSVC_FILES:%=$(RPCSVC_DIR)/%)
302 $(RPCSVC_DIR)/%.h: $(RPCSVC_SRCDIR)/%.h
305 $(RPCSVC_DIR)/nis.h: $(RPCSVC_SRCDIR)/nis.x $(RPCSVC_SRCDIR)/nis_object.x
306 $(RPCGEN) -C -h $(RPCSVC_SRCDIR)/nis.x > nis-tmp.h
307 $(SED) -e '/EDIT_START/,$$ d' < nis-tmp.h > nis.h
308 $(INS) -m $(FILEMODE) nis.h $@
309 $(RM) nis.h nis-tmp.h
311 $(RPCSVC_DIR)/%.x: $(RPCSVC_SRCDIR)/%.x
314 $(RPCSVC_DIR)/%.x: $(RPCSVC_UTS_SRCDIR)/%.x
317 $(LIBCBASE)/../port/nsl/nis_clnt.h: $(RPCSVC_DIR)/nis.x $(RPCSVC_DIR)/nis_object.x
318 $(RPCGEN) -C -h $(RPCSVC_DIR)/nis.x > nis_clnt-gen.h
319 $(SED) -n -e '/EDIT_START/,$$ p' < nis_clnt-gen.h |\
320 $(SED) -e 's/_3_svc/_svc/' |\
321 $(SED) -e 's/_3/_clnt/' > $@
324 CLEANFILES += $(LIBCBASE)/../port/nsl/nis_clnt.h