xref: /freebsd/share/mk/bsd.lib.mk (revision 31d62a73c2e6ac0ff413a7a17700ffc7dce254ef)
1#	from: @(#)bsd.lib.mk	5.26 (Berkeley) 5/2/91
2# $FreeBSD$
3#
4
5.include <bsd.init.mk>
6
7.if defined(LIB_CXX) || defined(SHLIB_CXX)
8_LD=	${CXX}
9.else
10_LD=	${CC}
11.endif
12.if defined(LIB_CXX)
13LIB=	${LIB_CXX}
14.endif
15.if defined(SHLIB_CXX)
16SHLIB=	${SHLIB_CXX}
17.endif
18
19LIB_PRIVATE=	${PRIVATELIB:Dprivate}
20# Set up the variables controlling shared libraries.  After this section,
21# SHLIB_NAME will be defined only if we are to create a shared library.
22# SHLIB_LINK will be defined only if we are to create a link to it.
23# INSTALL_PIC_ARCHIVE will be defined only if we are to create a PIC archive.
24# BUILD_NOSSP_PIC_ARCHIVE will be defined only if we are to create a PIC archive.
25.if defined(NO_PIC)
26.undef SHLIB_NAME
27.undef INSTALL_PIC_ARCHIVE
28.undef BUILD_NOSSP_PIC_ARCHIVE
29.else
30.if !defined(SHLIB) && defined(LIB)
31SHLIB=		${LIB}
32.endif
33.if !defined(SHLIB_NAME) && defined(SHLIB) && defined(SHLIB_MAJOR)
34SHLIB_NAME=	lib${LIB_PRIVATE}${SHLIB}.so.${SHLIB_MAJOR}
35.endif
36.if defined(SHLIB_NAME) && !empty(SHLIB_NAME:M*.so.*)
37SHLIB_LINK?=	${SHLIB_NAME:R}
38.endif
39SONAME?=	${SHLIB_NAME}
40.endif
41
42.if defined(CRUNCH_CFLAGS)
43CFLAGS+=	${CRUNCH_CFLAGS}
44.endif
45
46.if ${MK_ASSERT_DEBUG} == "no"
47CFLAGS+= -DNDEBUG
48NO_WERROR=
49.endif
50
51.if defined(DEBUG_FLAGS)
52CFLAGS+= ${DEBUG_FLAGS}
53
54.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != ""
55CTFFLAGS+= -g
56.endif
57.else
58STRIP?=	-s
59.endif
60
61.if ${SHLIBDIR:M*lib32*}
62TAGS+=	lib32
63.endif
64
65.if defined(NO_ROOT)
66.if !defined(TAGS) || ! ${TAGS:Mpackage=*}
67TAGS+=		package=${PACKAGE:Uruntime}
68.endif
69TAG_ARGS=	-T ${TAGS:[*]:S/ /,/g}
70.endif
71
72.if ${MK_RETPOLINE} != "no"
73CFLAGS+= -mretpoline
74CXXFLAGS+= -mretpoline
75LDFLAGS+= -Wl,-zretpolineplt
76.endif
77
78.if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \
79    empty(DEBUG_FLAGS:M-gdwarf*)
80CFLAGS+= ${DEBUG_FILES_CFLAGS}
81CXXFLAGS+= ${DEBUG_FILES_CFLAGS}
82CTFFLAGS+= -g
83.endif
84
85.include <bsd.libnames.mk>
86
87# prefer .s to a .c, add .po, remove stuff not used in the BSD libraries
88# .pico used for PIC object files
89# .nossppico used for NOSSP PIC object files
90.SUFFIXES: .out .o .bc .ll .po .pico .nossppico .S .asm .s .c .cc .cpp .cxx .C .f .y .l .ln
91
92.if !defined(PICFLAG)
93.if ${MACHINE_CPUARCH} == "sparc64"
94PICFLAG=-fPIC
95.else
96PICFLAG=-fpic
97.endif
98.endif
99
100PO_FLAG=-pg
101
102.c.po:
103	${CC} ${PO_FLAG} ${STATIC_CFLAGS} ${PO_CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
104	${CTFCONVERT_CMD}
105
106.c.pico:
107	${CC} ${PICFLAG} -DPIC ${SHARED_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
108	${CTFCONVERT_CMD}
109
110.c.nossppico:
111	${CC} ${PICFLAG} -DPIC ${SHARED_CFLAGS:C/^-fstack-protector.*$//} ${CFLAGS:C/^-fstack-protector.*$//} -c ${.IMPSRC} -o ${.TARGET}
112	${CTFCONVERT_CMD}
113
114.cc.po .C.po .cpp.po .cxx.po:
115	${CXX} ${PO_FLAG} ${STATIC_CXXFLAGS} ${PO_CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
116
117.cc.pico .C.pico .cpp.pico .cxx.pico:
118	${CXX} ${PICFLAG} -DPIC ${SHARED_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
119
120.cc.nossppico .C.nossppico .cpp.nossppico .cxx.nossppico:
121	${CXX} ${PICFLAG} -DPIC ${SHARED_CXXFLAGS:C/^-fstack-protector.*$//} ${CXXFLAGS:C/^-fstack-protector.*$//} -c ${.IMPSRC} -o ${.TARGET}
122
123.f.po:
124	${FC} -pg ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC}
125	${CTFCONVERT_CMD}
126
127.f.pico:
128	${FC} ${PICFLAG} -DPIC ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC}
129	${CTFCONVERT_CMD}
130
131.f.nossppico:
132	${FC} ${PICFLAG} -DPIC ${FFLAGS:C/^-fstack-protector.*$//} -o ${.TARGET} -c ${.IMPSRC}
133	${CTFCONVERT_CMD}
134
135.s.po .s.pico .s.nossppico:
136	${AS} ${AFLAGS} -o ${.TARGET} ${.IMPSRC}
137	${CTFCONVERT_CMD}
138
139.asm.po:
140	${CC:N${CCACHE_BIN}} -x assembler-with-cpp -DPROF ${PO_CFLAGS} \
141	    ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET}
142	${CTFCONVERT_CMD}
143
144.asm.pico:
145	${CC:N${CCACHE_BIN}} -x assembler-with-cpp ${PICFLAG} -DPIC \
146	    ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET}
147	${CTFCONVERT_CMD}
148
149.asm.nossppico:
150	${CC:N${CCACHE_BIN}} -x assembler-with-cpp ${PICFLAG} -DPIC \
151	    ${CFLAGS:C/^-fstack-protector.*$//} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET}
152	${CTFCONVERT_CMD}
153
154.S.po:
155	${CC:N${CCACHE_BIN}} -DPROF ${PO_CFLAGS} ${ACFLAGS} -c ${.IMPSRC} \
156	    -o ${.TARGET}
157	${CTFCONVERT_CMD}
158
159.S.pico:
160	${CC:N${CCACHE_BIN}} ${PICFLAG} -DPIC ${CFLAGS} ${ACFLAGS} \
161	    -c ${.IMPSRC} -o ${.TARGET}
162	${CTFCONVERT_CMD}
163
164.S.nossppico:
165	${CC:N${CCACHE_BIN}} ${PICFLAG} -DPIC ${CFLAGS:C/^-fstack-protector.*$//} ${ACFLAGS} \
166	    -c ${.IMPSRC} -o ${.TARGET}
167	${CTFCONVERT_CMD}
168
169_LIBDIR:=${LIBDIR}
170_SHLIBDIR:=${SHLIBDIR}
171
172.if defined(SHLIB_NAME)
173.if ${MK_DEBUG_FILES} != "no"
174SHLIB_NAME_FULL=${SHLIB_NAME}.full
175# Use ${DEBUGDIR} for base system debug files, else .debug subdirectory
176.if ${_SHLIBDIR} == "/boot" ||\
177    ${SHLIBDIR:C%/lib(/.*)?$%/lib%} == "/lib" ||\
178    ${SHLIBDIR:C%/usr/(tests/)?lib(32|exec)?(/.*)?%/usr/lib%} == "/usr/lib"
179DEBUGFILEDIR=${DEBUGDIR}${_SHLIBDIR}
180.else
181DEBUGFILEDIR=${_SHLIBDIR}/.debug
182.endif
183.if !exists(${DESTDIR}${DEBUGFILEDIR})
184DEBUGMKDIR=
185.endif
186.else
187SHLIB_NAME_FULL=${SHLIB_NAME}
188.endif
189.endif
190
191.include <bsd.symver.mk>
192
193# Allow libraries to specify their own version map or have it
194# automatically generated (see bsd.symver.mk above).
195.if ${MK_SYMVER} == "yes" && !empty(VERSION_MAP)
196${SHLIB_NAME_FULL}:	${VERSION_MAP}
197LDFLAGS+=	-Wl,--version-script=${VERSION_MAP}
198.endif
199
200.if defined(LIB) && !empty(LIB) || defined(SHLIB_NAME)
201OBJS+=		${SRCS:N*.h:${OBJS_SRCS_FILTER:ts:}:S/$/.o/}
202BCOBJS+=	${SRCS:N*.[hsS]:N*.asm:${OBJS_SRCS_FILTER:ts:}:S/$/.bco/g}
203LLOBJS+=	${SRCS:N*.[hsS]:N*.asm:${OBJS_SRCS_FILTER:ts:}:S/$/.llo/g}
204CLEANFILES+=	${OBJS} ${BCOBJS} ${LLOBJS} ${STATICOBJS}
205.endif
206
207.if defined(LIB) && !empty(LIB)
208_LIBS=		lib${LIB_PRIVATE}${LIB}.a
209
210lib${LIB_PRIVATE}${LIB}.a: ${OBJS} ${STATICOBJS}
211	@${ECHO} building static ${LIB} library
212	@rm -f ${.TARGET}
213	${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' NMFLAGS='${NMFLAGS}' \
214	    ${LORDER} ${OBJS} ${STATICOBJS} | ${TSORT} ${TSORTFLAGS}` ${ARADD}
215	${RANLIB} ${RANLIBFLAGS} ${.TARGET}
216.endif
217
218.if !defined(INTERNALLIB)
219
220.if ${MK_PROFILE} != "no" && defined(LIB) && !empty(LIB)
221_LIBS+=		lib${LIB_PRIVATE}${LIB}_p.a
222POBJS+=		${OBJS:.o=.po} ${STATICOBJS:.o=.po}
223DEPENDOBJS+=	${POBJS}
224CLEANFILES+=	${POBJS}
225
226lib${LIB_PRIVATE}${LIB}_p.a: ${POBJS}
227	@${ECHO} building profiled ${LIB} library
228	@rm -f ${.TARGET}
229	${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' NMFLAGS='${NMFLAGS}' \
230	    ${LORDER} ${POBJS} | ${TSORT} ${TSORTFLAGS}` ${ARADD}
231	${RANLIB} ${RANLIBFLAGS} ${.TARGET}
232.endif
233
234.if defined(LLVM_LINK)
235lib${LIB_PRIVATE}${LIB}.bc: ${BCOBJS}
236	${LLVM_LINK} -o ${.TARGET} ${BCOBJS}
237
238lib${LIB_PRIVATE}${LIB}.ll: ${LLOBJS}
239	${LLVM_LINK} -S -o ${.TARGET} ${LLOBJS}
240
241CLEANFILES+=	lib${LIB_PRIVATE}${LIB}.bc lib${LIB_PRIVATE}${LIB}.ll
242.endif
243
244.if defined(SHLIB_NAME) || \
245    defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB)
246SOBJS+=		${OBJS:.o=.pico}
247DEPENDOBJS+=	${SOBJS}
248CLEANFILES+=	${SOBJS}
249.endif
250
251.if defined(SHLIB_NAME)
252_LIBS+=		${SHLIB_NAME}
253
254SOLINKOPTS+=	-shared -Wl,-x
255.if defined(LD_FATAL_WARNINGS) && ${LD_FATAL_WARNINGS} == "no"
256SOLINKOPTS+=	-Wl,--no-fatal-warnings
257.else
258SOLINKOPTS+=	-Wl,--fatal-warnings
259.endif
260SOLINKOPTS+=	-Wl,--warn-shared-textrel
261
262.if target(beforelinking)
263beforelinking: ${SOBJS}
264${SHLIB_NAME_FULL}: beforelinking
265.endif
266
267.if defined(SHLIB_LINK)
268.if defined(SHLIB_LDSCRIPT) && !empty(SHLIB_LDSCRIPT) && exists(${.CURDIR}/${SHLIB_LDSCRIPT})
269${SHLIB_LINK:R}.ld: ${.CURDIR}/${SHLIB_LDSCRIPT}
270	sed -e 's,@@SHLIB@@,${_SHLIBDIR}/${SHLIB_NAME},g' \
271	    -e 's,@@LIBDIR@@,${_LIBDIR},g' \
272	    ${.ALLSRC} > ${.TARGET}
273
274${SHLIB_NAME_FULL}: ${SHLIB_LINK:R}.ld
275CLEANFILES+=	${SHLIB_LINK:R}.ld
276.endif
277CLEANFILES+=	${SHLIB_LINK}
278.endif
279
280${SHLIB_NAME_FULL}: ${SOBJS}
281	@${ECHO} building shared library ${SHLIB_NAME}
282	@rm -f ${SHLIB_NAME} ${SHLIB_LINK}
283.if defined(SHLIB_LINK) && !commands(${SHLIB_LINK:R}.ld) && ${MK_DEBUG_FILES} == "no"
284	@${INSTALL_LIBSYMLINK} ${TAG_ARGS:D${TAG_ARGS},development} ${SHLIB_NAME} ${SHLIB_LINK}
285.endif
286	${_LD:N${CCACHE_BIN}} ${LDFLAGS} ${SSP_CFLAGS} ${SOLINKOPTS} \
287	    -o ${.TARGET} -Wl,-soname,${SONAME} \
288	    `NM='${NM}' NMFLAGS='${NMFLAGS}' ${LORDER} ${SOBJS} | \
289	    ${TSORT} ${TSORTFLAGS}` ${LDADD}
290.if ${MK_CTF} != "no"
291	${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SOBJS}
292.endif
293
294.if ${MK_DEBUG_FILES} != "no"
295CLEANFILES+=	${SHLIB_NAME_FULL} ${SHLIB_NAME}.debug
296${SHLIB_NAME}: ${SHLIB_NAME_FULL} ${SHLIB_NAME}.debug
297	${OBJCOPY} --strip-debug --add-gnu-debuglink=${SHLIB_NAME}.debug \
298	    ${SHLIB_NAME_FULL} ${.TARGET}
299.if defined(SHLIB_LINK) && !commands(${SHLIB_LINK:R}.ld)
300	@${INSTALL_LIBSYMLINK} ${TAG_ARGS:D${TAG_ARGS},development} ${SHLIB_NAME} ${SHLIB_LINK}
301.endif
302
303${SHLIB_NAME}.debug: ${SHLIB_NAME_FULL}
304	${OBJCOPY} --only-keep-debug ${SHLIB_NAME_FULL} ${.TARGET}
305.endif
306.endif #defined(SHLIB_NAME)
307
308.if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no"
309_LIBS+=		lib${LIB_PRIVATE}${LIB}_pic.a
310
311lib${LIB_PRIVATE}${LIB}_pic.a: ${SOBJS}
312	@${ECHO} building special pic ${LIB} library
313	@rm -f ${.TARGET}
314	${AR} ${ARFLAGS} ${.TARGET} ${SOBJS} ${ARADD}
315	${RANLIB} ${RANLIBFLAGS} ${.TARGET}
316.endif
317
318.if defined(BUILD_NOSSP_PIC_ARCHIVE) && defined(LIB) && !empty(LIB)
319NOSSPSOBJS+=	${OBJS:.o=.nossppico}
320DEPENDOBJS+=	${NOSSPSOBJS}
321CLEANFILES+=	${NOSSPSOBJS}
322_LIBS+=		lib${LIB_PRIVATE}${LIB}_nossp_pic.a
323
324lib${LIB_PRIVATE}${LIB}_nossp_pic.a: ${NOSSPSOBJS}
325	@${ECHO} building special nossp pic ${LIB} library
326	@rm -f ${.TARGET}
327	${AR} ${ARFLAGS} ${.TARGET} ${NOSSPSOBJS} ${ARADD}
328	${RANLIB} ${RANLIBFLAGS} ${.TARGET}
329.endif
330
331.endif # !defined(INTERNALLIB)
332
333.if defined(_SKIP_BUILD)
334all:
335.else
336.if defined(_LIBS) && !empty(_LIBS)
337all: ${_LIBS}
338.endif
339
340.if ${MK_MAN} != "no" && !defined(LIBRARIES_ONLY)
341all: all-man
342.endif
343.endif
344
345CLEANFILES+=	${_LIBS}
346
347_EXTRADEPEND:
348.if !defined(NO_EXTRADEPEND) && defined(SHLIB_NAME)
349.if defined(DPADD) && !empty(DPADD)
350	echo ${SHLIB_NAME_FULL}: ${DPADD} >> ${DEPENDFILE}
351.endif
352.endif
353
354.if !target(install)
355
356.if defined(PRECIOUSLIB)
357.if !defined(NO_FSCHG)
358SHLINSTALLFLAGS+= -fschg
359.endif
360.endif
361# Install libraries with -S to avoid risk of modifying in-use libraries when
362# installing to a running system.  It is safe to avoid this for NO_ROOT builds
363# that are only creating an image.
364.if !defined(NO_SAFE_LIBINSTALL) && !defined(NO_ROOT)
365SHLINSTALLFLAGS+= -S
366.endif
367
368_INSTALLFLAGS:=	${INSTALLFLAGS}
369.for ie in ${INSTALLFLAGS_EDIT}
370_INSTALLFLAGS:=	${_INSTALLFLAGS${ie}}
371.endfor
372_SHLINSTALLFLAGS:=	${SHLINSTALLFLAGS}
373.for ie in ${INSTALLFLAGS_EDIT}
374_SHLINSTALLFLAGS:=	${_SHLINSTALLFLAGS${ie}}
375.endfor
376
377.if !defined(INTERNALLIB)
378realinstall: _libinstall
379.ORDER: beforeinstall _libinstall
380_libinstall:
381.if defined(LIB) && !empty(LIB) && ${MK_INSTALLLIB} != "no"
382	${INSTALL} ${TAG_ARGS:D${TAG_ARGS},development} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
383	    ${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}.a ${DESTDIR}${_LIBDIR}/
384.endif
385.if ${MK_PROFILE} != "no" && defined(LIB) && !empty(LIB)
386	${INSTALL} ${TAG_ARGS:D${TAG_ARGS},profile} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
387	    ${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}_p.a ${DESTDIR}${_LIBDIR}/
388.endif
389.if defined(SHLIB_NAME)
390	${INSTALL} ${TAG_ARGS} ${STRIP} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
391	    ${_INSTALLFLAGS} ${_SHLINSTALLFLAGS} \
392	    ${SHLIB_NAME} ${DESTDIR}${_SHLIBDIR}/
393.if ${MK_DEBUG_FILES} != "no"
394.if defined(DEBUGMKDIR)
395	${INSTALL} ${TAG_ARGS:D${TAG_ARGS},debug} -d ${DESTDIR}${DEBUGFILEDIR}/
396.endif
397	${INSTALL} ${TAG_ARGS:D${TAG_ARGS},debug} -o ${LIBOWN} -g ${LIBGRP} -m ${DEBUGMODE} \
398	    ${_INSTALLFLAGS} \
399	    ${SHLIB_NAME}.debug ${DESTDIR}${DEBUGFILEDIR}/
400.endif
401.if defined(SHLIB_LINK)
402.if commands(${SHLIB_LINK:R}.ld)
403	${INSTALL} ${TAG_ARGS:D${TAG_ARGS},development} -S -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
404	    ${_INSTALLFLAGS} ${SHLIB_LINK:R}.ld \
405	    ${DESTDIR}${_LIBDIR}/${SHLIB_LINK}
406.for _SHLIB_LINK_LINK in ${SHLIB_LDSCRIPT_LINKS}
407	${INSTALL_LIBSYMLINK} ${SHLIB_LINK} ${DESTDIR}${_LIBDIR}/${_SHLIB_LINK_LINK}
408.endfor
409.else
410.if ${_SHLIBDIR} == ${_LIBDIR}
411.if ${SHLIB_LINK:Mlib*}
412	${INSTALL_RSYMLINK} ${TAG_ARGS:D${TAG_ARGS},development} ${SHLIB_NAME} ${DESTDIR}${_LIBDIR}/${SHLIB_LINK}
413.else
414	${INSTALL_RSYMLINK} ${TAG_ARGS} ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} \
415	    ${DESTDIR}${_LIBDIR}/${SHLIB_LINK}
416.endif
417.else
418.if ${SHLIB_LINK:Mlib*}
419	${INSTALL_RSYMLINK} ${TAG_ARGS:D${TAG_ARGS},development} ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} \
420	    ${DESTDIR}${_LIBDIR}/${SHLIB_LINK}
421.else
422	${INSTALL_RSYMLINK} ${TAG_ARGS} ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} \
423	    ${DESTDIR}${_LIBDIR}/${SHLIB_LINK}
424.endif
425.if exists(${DESTDIR}${_LIBDIR}/${SHLIB_NAME})
426	-chflags noschg ${DESTDIR}${_LIBDIR}/${SHLIB_NAME}
427	rm -f ${DESTDIR}${_LIBDIR}/${SHLIB_NAME}
428.endif
429.endif
430.endif # SHLIB_LDSCRIPT
431.endif # SHLIB_LINK
432.endif # SHIB_NAME
433.if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no"
434	${INSTALL} ${TAG_ARGS:D${TAG_ARGS},development} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
435	    ${_INSTALLFLAGS} lib${LIB}_pic.a ${DESTDIR}${_LIBDIR}/
436.endif
437.endif # !defined(INTERNALLIB)
438
439.if !defined(LIBRARIES_ONLY)
440.include <bsd.nls.mk>
441.include <bsd.confs.mk>
442.include <bsd.files.mk>
443.include <bsd.incs.mk>
444.endif
445
446LINKOWN?=	${LIBOWN}
447LINKGRP?=	${LIBGRP}
448LINKMODE?=	${LIBMODE}
449SYMLINKOWN?=	${LIBOWN}
450SYMLINKGRP?=	${LIBGRP}
451.include <bsd.links.mk>
452
453.if ${MK_MAN} != "no" && !defined(LIBRARIES_ONLY)
454realinstall: maninstall
455.ORDER: beforeinstall maninstall
456.endif
457
458.endif
459
460.if ${MK_MAN} != "no" && !defined(LIBRARIES_ONLY)
461.include <bsd.man.mk>
462.endif
463
464.if defined(LIB) && !empty(LIB)
465OBJS_DEPEND_GUESS+= ${SRCS:M*.h}
466.for _S in ${SRCS:N*.[hly]}
467OBJS_DEPEND_GUESS.${_S:${OBJS_SRCS_FILTER:ts:}}.po+=	${_S}
468.endfor
469.endif
470.if defined(SHLIB_NAME) || \
471    defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB)
472.for _S in ${SRCS:N*.[hly]}
473OBJS_DEPEND_GUESS.${_S:${OBJS_SRCS_FILTER:ts:}}.pico+=	${_S}
474.endfor
475.endif
476.if defined(BUILD_NOSSP_PIC_ARCHIVE) && defined(LIB) && !empty(LIB)
477.for _S in ${SRCS:N*.[hly]}
478OBJS_DEPEND_GUESS.${_S:${OBJS_SRCS_FILTER:ts:}}.nossppico+=	${_S}
479.endfor
480.endif
481
482.if defined(HAS_TESTS)
483MAKE+=			MK_MAKE_CHECK_USE_SANDBOX=yes
484SUBDIR_TARGETS+=	check
485TESTS_LD_LIBRARY_PATH+=	${.OBJDIR}
486.endif
487
488.include <bsd.dep.mk>
489.include <bsd.clang-analyze.mk>
490.include <bsd.obj.mk>
491.include <bsd.sys.mk>
492