xref: /freebsd/share/mk/bsd.lib.mk (revision 9065390ddc7b1ce2613777f6a947200950a5ac71)
1.include <bsd.init.mk>
2.include <bsd.compiler.mk>
3.include <bsd.linker.mk>
4.include <bsd.compat.pre.mk>
5
6__<bsd.lib.mk>__:	.NOTMAIN
7
8.if defined(LIB_CXX) || defined(SHLIB_CXX)
9_LD=	${CXX}
10.else
11_LD=	${CC}
12.endif
13.if defined(LIB_CXX)
14LIB=	${LIB_CXX}
15.endif
16.if defined(SHLIB_CXX)
17SHLIB=	${SHLIB_CXX}
18.endif
19
20LIB_PRIVATE=	${PRIVATELIB:Dprivate}
21# Set up the variables controlling shared libraries.  After this section,
22# SHLIB_NAME will be defined only if we are to create a shared library.
23# SHLIB_LINK will be defined only if we are to create a link to it.
24# INSTALL_PIC_ARCHIVE will be defined only if we are to create a PIC archive.
25# BUILD_NOSSP_PIC_ARCHIVE will be defined only if we are to create a PIC archive.
26.if defined(NO_PIC)
27.undef SHLIB_NAME
28.undef INSTALL_PIC_ARCHIVE
29.undef BUILD_NOSSP_PIC_ARCHIVE
30.else
31.if !defined(SHLIB) && defined(LIB)
32SHLIB=		${LIB}
33.endif
34.if !defined(SHLIB_NAME) && defined(SHLIB) && defined(SHLIB_MAJOR)
35SHLIB_NAME=	lib${LIB_PRIVATE}${SHLIB}.so.${SHLIB_MAJOR}
36.endif
37.if defined(SHLIB_NAME) && !empty(SHLIB_NAME:M*.so.*)
38SHLIB_LINK?=	${SHLIB_NAME:R}
39.endif
40SONAME?=	${SHLIB_NAME}
41.endif
42
43.if defined(CRUNCH_CFLAGS)
44CFLAGS+=	${CRUNCH_CFLAGS}
45.endif
46
47.for _libcompat in ${_ALL_libcompats}
48.if ${SHLIBDIR:M*/lib${_libcompat}} || ${SHLIBDIR:M*/lib${_libcompat}/*}
49TAGS+=	lib${_libcompat}
50.endif
51.endfor
52
53.if defined(NO_ROOT)
54.if !defined(TAGS) || ! ${TAGS:Mpackage=*}
55TAGS+=	package=${PACKAGE:Uutilities}
56.endif
57
58# By default, if PACKAGE=foo, then the native runtime libraries will go into
59# the FreeBSD-foo package, and subpackages will be created for -dev, -lib32,
60# and so on.  If LIB_PACKAGE is set, then we also create a subpackage for
61# runtime libraries with a -lib suffix.  This is used when a package has
62# libraries and some other content (e.g., executables) to allow consumers to
63# depend on the libraries.
64.if defined(LIB_PACKAGE) && ! ${TAGS:Mlib*}
65.if !defined(PACKAGE)
66.error LIB_PACKAGE cannot be used without PACKAGE
67.endif
68
69LIB_TAG_ARGS=	${TAG_ARGS},lib
70.else
71LIB_TAG_ARGS=	${TAG_ARGS}
72.endif
73
74TAG_ARGS=	-T ${TAGS:ts,:[*]}
75
76DBG_TAG_ARGS=	${TAG_ARGS},dbg
77# Usually we want to put development files (e.g., static libraries) into a
78# separate -dev packages but for a few cases, like tests, that's not wanted,
79# so allow the caller to disable it by setting NO_DEV_PACKAGE.
80.if !defined(NO_DEV_PACKAGE)
81DEV_TAG_ARGS=	${TAG_ARGS},dev
82.else
83DEV_TAG_ARGS=	${TAG_ARGS}
84.endif
85.endif	# !defined(NO_ROOT)
86
87# ELF hardening knobs
88.if ${MK_BIND_NOW} != "no"
89LDFLAGS+= -Wl,-znow
90.endif
91.if ${LINKER_TYPE} != "mac"
92.if ${MK_RELRO} == "no"
93LDFLAGS+= -Wl,-znorelro
94.else
95LDFLAGS+= -Wl,-zrelro
96.endif
97.endif
98.if ${MK_RETPOLINE} != "no"
99.if ${COMPILER_FEATURES:Mretpoline} && ${LINKER_FEATURES:Mretpoline}
100CFLAGS+= -mretpoline
101CXXFLAGS+= -mretpoline
102LDFLAGS+= -Wl,-zretpolineplt
103.else
104.warning Retpoline requested but not supported by compiler or linker
105.endif
106.endif
107# LLD sensibly defaults to -znoexecstack, so do the same for BFD
108LDFLAGS.bfd+= -Wl,-znoexecstack
109.if ${MK_BRANCH_PROTECTION} != "no"
110CFLAGS+=  -mbranch-protection=standard
111.if ${LINKER_FEATURES:Mbti-report} && defined(BTI_REPORT_ERROR)
112LDFLAGS+= -Wl,-zbti-report=error
113.endif
114.endif
115
116# Initialize stack variables on function entry
117.if ${OPT_INIT_ALL} != "none"
118.if ${COMPILER_FEATURES:Minit-all}
119CFLAGS+= -ftrivial-auto-var-init=${OPT_INIT_ALL}
120CXXFLAGS+= -ftrivial-auto-var-init=${OPT_INIT_ALL}
121.if ${OPT_INIT_ALL} == "zero" && ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 160000
122CFLAGS+= -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang
123CXXFLAGS+= -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang
124.endif
125.else
126.warning INIT_ALL (${OPT_INIT_ALL}) requested but not supported by compiler
127.endif
128.endif
129
130# Zero used registers on return (mitigate some ROP)
131.if ${MK_ZEROREGS} != "no"
132.if ${COMPILER_FEATURES:Mzeroregs}
133ZEROREG_TYPE?= used
134CFLAGS+= -fzero-call-used-regs=${ZEROREG_TYPE}
135CXXFLAGS+= -fzero-call-used-regs=${ZEROREG_TYPE}
136.endif
137.endif
138
139# bsd.sanitizer.mk is not installed, so don't require it (e.g. for ports).
140.sinclude "bsd.sanitizer.mk"
141
142.if ${MACHINE_CPUARCH} == "riscv" && ${LINKER_FEATURES:Mriscv-relaxations} == ""
143CFLAGS += -mno-relax
144.endif
145
146.include <bsd.libnames.mk>
147
148.include <bsd.suffixes-extra.mk>
149
150_LIBDIR:=${LIBDIR}
151_SHLIBDIR:=${SHLIBDIR}
152
153.if defined(SHLIB_NAME)
154.if ${MK_DEBUG_FILES} != "no"
155SHLIB_NAME_FULL=${SHLIB_NAME}.full
156DEBUGFILE= ${SHLIB_NAME}.debug
157# Use ${DEBUGDIR} for base system debug files, else .debug subdirectory
158.if ${_SHLIBDIR} == "/boot" ||\
159    ${SHLIBDIR:C%/lib(/.*)?$%/lib%} == "/lib" ||\
160    ${SHLIBDIR:C%/usr/lib(32|exec)?(/.*)?%/usr/lib%} == "/usr/lib" ||\
161    ${SHLIBDIR:C%/usr/tests(/.*)?%/usr/tests%} == "/usr/tests"
162DEBUGFILEDIR=${DEBUGDIR}${_SHLIBDIR}
163.else
164DEBUGFILEDIR=${_SHLIBDIR}/.debug
165.endif
166.if !exists(${DESTDIR}${DEBUGFILEDIR})
167DEBUGMKDIR=
168.endif
169.else
170SHLIB_NAME_FULL=${SHLIB_NAME}
171.endif
172.endif
173
174.include <bsd.symver.mk>
175
176# Allow libraries to specify their own version map or have it
177# automatically generated (see bsd.symver.mk above).
178.if !empty(VERSION_MAP)
179${SHLIB_NAME_FULL}:	${VERSION_MAP}
180LDFLAGS+=	-Wl,--version-script=${VERSION_MAP}
181
182# Ideally we'd always enable --no-undefined-version (default for lld >= 16),
183# but we have several symbols in our version maps that may or may not exist,
184# depending on compile-time defines and that needs to be handled first.
185.if ${MK_UNDEFINED_VERSION} == "no"
186LDFLAGS+=	-Wl,--no-undefined-version
187.else
188LDFLAGS+=	-Wl,--undefined-version
189.endif
190.endif
191
192.if defined(LIB) && !empty(LIB) || defined(SHLIB_NAME)
193OBJS+=		${SRCS:N*.h:${OBJS_SRCS_FILTER:ts:}:S/$/.o/}
194BCOBJS+=	${SRCS:N*.[hsS]:N*.asm:${OBJS_SRCS_FILTER:ts:}:S/$/.bco/g}
195LLOBJS+=	${SRCS:N*.[hsS]:N*.asm:${OBJS_SRCS_FILTER:ts:}:S/$/.llo/g}
196CLEANFILES+=	${OBJS} ${BCOBJS} ${LLOBJS} ${STATICOBJS}
197.endif
198
199.if defined(LIB) && !empty(LIB)
200.if defined(STATIC_LDSCRIPT)
201_STATICLIB_SUFFIX=	_real
202.endif
203_LIBS=		lib${LIB_PRIVATE}${LIB}${_STATICLIB_SUFFIX}.a
204
205lib${LIB_PRIVATE}${LIB}${_STATICLIB_SUFFIX}.a: ${OBJS} ${STATICOBJS}
206	@${ECHO} Building static ${LIB} library
207	@rm -f ${.TARGET}
208	${AR} ${ARFLAGS} ${.TARGET} ${OBJS} ${STATICOBJS} ${ARADD}
209.endif
210
211.if !defined(INTERNALLIB)
212
213.if defined(LLVM_LINK)
214lib${LIB_PRIVATE}${LIB}.bc: ${BCOBJS}
215	${LLVM_LINK} -o ${.TARGET} ${BCOBJS}
216
217lib${LIB_PRIVATE}${LIB}.ll: ${LLOBJS}
218	${LLVM_LINK} -S -o ${.TARGET} ${LLOBJS}
219
220CLEANFILES+=	lib${LIB_PRIVATE}${LIB}.bc lib${LIB_PRIVATE}${LIB}.ll
221.endif
222
223.if defined(SHLIB_NAME) || \
224    defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB)
225SOBJS+=		${OBJS:.o=.pico}
226DEPENDOBJS+=	${SOBJS}
227CLEANFILES+=	${SOBJS}
228.endif
229
230.if defined(SHLIB_NAME)
231_LIBS+=		${SHLIB_NAME}
232
233SOLINKOPTS+=	-shared -Wl,-x
234.if defined(LD_FATAL_WARNINGS) && ${LD_FATAL_WARNINGS} == "no"
235SOLINKOPTS+=	-Wl,--no-fatal-warnings
236.else
237SOLINKOPTS+=	-Wl,--fatal-warnings
238.endif
239SOLINKOPTS+=	-Wl,--warn-shared-textrel
240
241.if target(beforelinking)
242beforelinking: ${SOBJS}
243${SHLIB_NAME_FULL}: beforelinking
244.endif
245
246.if defined(SHLIB_LINK)
247.if defined(SHLIB_LDSCRIPT) && !empty(SHLIB_LDSCRIPT) && exists(${.CURDIR}/${SHLIB_LDSCRIPT})
248${SHLIB_LINK:R}.ld: ${.CURDIR}/${SHLIB_LDSCRIPT}
249	sed -e 's,@@SHLIB@@,${_SHLIBDIR}/${SHLIB_NAME},g' \
250	    -e 's,@@LIBDIR@@,${_LIBDIR},g' \
251	    ${.ALLSRC} > ${.TARGET}
252
253${SHLIB_NAME_FULL}: ${SHLIB_LINK:R}.ld
254CLEANFILES+=	${SHLIB_LINK:R}.ld
255.endif
256CLEANFILES+=	${SHLIB_LINK}
257.endif
258
259${SHLIB_NAME_FULL}: ${SOBJS}
260	@${ECHO} Building shared library ${SHLIB_NAME}
261	@rm -f ${SHLIB_NAME} ${SHLIB_LINK}
262.if defined(SHLIB_LINK) && !commands(${SHLIB_LINK:R}.ld) && ${MK_DEBUG_FILES} == "no"
263	# Note: This uses ln instead of ${INSTALL_LIBSYMLINK} since we are in OBJDIR
264	@${LN:Uln} -fs ${SHLIB_NAME} ${SHLIB_LINK}
265.endif
266	${_LD:N${CCACHE_BIN}} ${LDFLAGS} ${SSP_CFLAGS} ${SOLINKOPTS} \
267	    -o ${.TARGET} -Wl,-soname,${SONAME} ${SOBJS} ${LDADD}
268.if ${MK_CTF} != "no"
269	${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SOBJS}
270.endif
271
272.if ${MK_DEBUG_FILES} != "no"
273CLEANFILES+=	${SHLIB_NAME_FULL} ${DEBUGFILE}
274${SHLIB_NAME}: ${SHLIB_NAME_FULL} ${DEBUGFILE}
275	${OBJCOPY} --strip-debug --add-gnu-debuglink=${DEBUGFILE} \
276	    ${SHLIB_NAME_FULL} ${.TARGET}
277.if defined(SHLIB_LINK) && !commands(${SHLIB_LINK:R}.ld)
278	# Note: This uses ln instead of ${INSTALL_LIBSYMLINK} since we are in OBJDIR
279	@${LN:Uln} -fs ${SHLIB_NAME} ${SHLIB_LINK}
280.endif
281
282${DEBUGFILE}: ${SHLIB_NAME_FULL}
283	${OBJCOPY} --only-keep-debug ${SHLIB_NAME_FULL} ${.TARGET}
284.endif
285.endif #defined(SHLIB_NAME)
286
287.if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB)
288_LIBS+=		lib${LIB_PRIVATE}${LIB}_pic.a
289
290lib${LIB_PRIVATE}${LIB}_pic.a: ${SOBJS}
291	@${ECHO} Building special pic ${LIB} library
292	@rm -f ${.TARGET}
293	${AR} ${ARFLAGS} ${.TARGET} ${SOBJS} ${ARADD}
294.endif
295
296.if defined(BUILD_NOSSP_PIC_ARCHIVE) && defined(LIB) && !empty(LIB)
297NOSSPSOBJS+=	${OBJS:.o=.nossppico}
298DEPENDOBJS+=	${NOSSPSOBJS}
299CLEANFILES+=	${NOSSPSOBJS}
300_LIBS+=		lib${LIB_PRIVATE}${LIB}_nossp_pic.a
301
302lib${LIB_PRIVATE}${LIB}_nossp_pic.a: ${NOSSPSOBJS}
303	@${ECHO} Building special nossp pic ${LIB} library
304	@rm -f ${.TARGET}
305	${AR} ${ARFLAGS} ${.TARGET} ${NOSSPSOBJS} ${ARADD}
306.endif
307
308.endif # !defined(INTERNALLIB)
309
310.if defined(INTERNALLIB) && ${MK_PIE} != "no" && defined(LIB) && !empty(LIB)
311PIEOBJS+=	${OBJS:.o=.pieo}
312DEPENDOBJS+=	${PIEOBJS}
313CLEANFILES+=	${PIEOBJS}
314
315_LIBS+=		lib${LIB_PRIVATE}${LIB}_pie.a
316
317lib${LIB_PRIVATE}${LIB}_pie.a: ${PIEOBJS}
318	@${ECHO} Building pie ${LIB} library
319	@rm -f ${.TARGET}
320	${AR} ${ARFLAGS} ${.TARGET} ${PIEOBJS} ${ARADD}
321.endif
322
323.if defined(_SKIP_BUILD)
324all:
325.else
326.if defined(_LIBS) && !empty(_LIBS)
327all: ${_LIBS}
328.endif
329
330.if ${MK_MAN} != "no" && !defined(LIBRARIES_ONLY)
331all: all-man
332.endif
333.endif
334
335CLEANFILES+=	${_LIBS}
336
337_EXTRADEPEND:
338.if !defined(NO_EXTRADEPEND) && defined(SHLIB_NAME)
339.if defined(DPADD) && !empty(DPADD)
340	echo ${SHLIB_NAME_FULL}: ${DPADD} >> ${DEPENDFILE}
341.endif
342.endif
343
344.if !target(install)
345
346INSTALLFLAGS+= -C
347.if defined(PRECIOUSLIB)
348.if !defined(NO_FSCHG)
349SHLINSTALLFLAGS+= -fschg
350.endif
351.endif
352# Install libraries with -S to avoid risk of modifying in-use libraries when
353# installing to a running system.  It is safe to avoid this for NO_ROOT builds
354# that are only creating an image.
355#
356# XXX: Since Makefile.inc1 ends up building lib/libc both as part of
357# _startup_libs and as part of _generic_libs it ends up getting installed a
358# second time during the parallel build, and although the .WAIT in lib/Makefile
359# stops that mattering for lib, other directories like secure/lib are built in
360# parallel at the top level and are unaffected by that, so can sometimes race
361# with the libc.so.7 reinstall and see a missing or corrupt file. Ideally the
362# build system would be fixed to not build/install libc to WORLDTMP the second
363# time round, but for now using -S ensures the install is atomic and thus we
364# never see a broken intermediate state, so use it even for NO_ROOT builds.
365.if !defined(NO_SAFE_LIBINSTALL) #&& !defined(NO_ROOT)
366SHLINSTALLFLAGS+= -S
367SHLINSTALLSYMLINKFLAGS+= -S
368.endif
369
370_INSTALLFLAGS:=	${INSTALLFLAGS}
371.for ie in ${INSTALLFLAGS_EDIT}
372_INSTALLFLAGS:=	${_INSTALLFLAGS${ie}}
373.endfor
374_SHLINSTALLFLAGS:=	${SHLINSTALLFLAGS}
375_SHLINSTALLSYMLINKFLAGS:= ${SHLINSTALLSYMLINKFLAGS}
376.for ie in ${INSTALLFLAGS_EDIT}
377_SHLINSTALLFLAGS:=	${_SHLINSTALLFLAGS${ie}}
378.endfor
379
380.if defined(PCFILES)
381.for pcfile in ${PCFILES}
382installpcfiles: installpcfiles-${pcfile}
383
384installpcfiles-${pcfile}: ${pcfile}
385	${INSTALL} ${DEV_TAG_ARGS} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
386	    ${_INSTALLFLAGS} \
387	    ${.ALLSRC} ${DESTDIR}${LIBDATADIR}/pkgconfig/
388.endfor
389.endif
390installpcfiles: .PHONY
391
392.if !defined(INTERNALLIB)
393realinstall: _libinstall installpcfiles _debuginstall
394.ORDER: beforeinstall _libinstall _debuginstall
395_libinstall:
396.if defined(LIB) && !empty(LIB) && ${MK_INSTALLLIB} != "no"
397	${INSTALL} ${DEV_TAG_ARGS} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
398	    ${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}${_STATICLIB_SUFFIX}.a ${DESTDIR}${_LIBDIR}/
399.endif
400.if defined(SHLIB_NAME)
401	${INSTALL} ${LIB_TAG_ARGS} ${STRIP} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
402	    ${_INSTALLFLAGS} ${_SHLINSTALLFLAGS} \
403	    ${SHLIB_NAME} ${DESTDIR}${_SHLIBDIR}/
404.if defined(SHLIB_LINK)
405.if commands(${SHLIB_LINK:R}.ld)
406	${INSTALL} ${DEV_TAG_ARGS} -S -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
407	    ${_INSTALLFLAGS} ${SHLIB_LINK:R}.ld \
408	    ${DESTDIR}${_LIBDIR}/${SHLIB_LINK}
409.for _SHLIB_LINK_LINK in ${SHLIB_LDSCRIPT_LINKS}
410	${INSTALL_LIBSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${LIB_TAG_ARGS} \
411	    ${SHLIB_LINK} ${DESTDIR}${_LIBDIR}/${_SHLIB_LINK_LINK}
412.endfor
413.else
414.if ${_SHLIBDIR} == ${_LIBDIR}
415.if ${SHLIB_LINK:Mlib*}
416	${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${DEV_TAG_ARGS} \
417	    ${SHLIB_NAME} ${DESTDIR}${_LIBDIR}/${SHLIB_LINK}
418.else
419	${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${LIB_TAG_ARGS} \
420	    ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} \
421	    ${DESTDIR}${_LIBDIR}/${SHLIB_LINK}
422.endif
423.else
424.if ${SHLIB_LINK:Mlib*}
425	${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${DEV_TAG_ARGS} \
426	    ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} ${DESTDIR}${_LIBDIR}/${SHLIB_LINK}
427.else
428	${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${LIB_TAG_ARGS} \
429	    ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} ${DESTDIR}${_LIBDIR}/${SHLIB_LINK}
430.endif
431.if exists(${DESTDIR}${_LIBDIR}/${SHLIB_NAME})
432	-chflags noschg ${DESTDIR}${_LIBDIR}/${SHLIB_NAME}
433	rm -f ${DESTDIR}${_LIBDIR}/${SHLIB_NAME}
434.endif
435.endif # _SHLIBDIR == _LIBDIR
436.endif # SHLIB_LDSCRIPT
437.endif # SHLIB_LINK
438.endif # SHIB_NAME
439.if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB)
440	${INSTALL} ${DEV_TAG_ARGS} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
441	    ${_INSTALLFLAGS} lib${LIB}_pic.a ${DESTDIR}${_LIBDIR}/
442.endif
443.endif # !defined(INTERNALLIB)
444
445.if !defined(LIBRARIES_ONLY)
446.include <bsd.nls.mk>
447.include <bsd.confs.mk>
448.include <bsd.files.mk>
449#No need to install header for INTERNALLIB
450.if !defined(INTERNALLIB)
451.include <bsd.incs.mk>
452.endif
453.endif
454
455LINKOWN?=	${LIBOWN}
456LINKGRP?=	${LIBGRP}
457LINKMODE?=	${LIBMODE}
458SYMLINKOWN?=	${LIBOWN}
459SYMLINKGRP?=	${LIBGRP}
460.if !defined(NO_DEV_PACKAGE)
461LINKTAGS=	dev${_COMPAT_TAG}
462.else
463LINKTAGS=	${_COMPAT_TAG}
464.endif
465.include <bsd.links.mk>
466
467.if ${MK_MAN} != "no" && !defined(LIBRARIES_ONLY)
468realinstall: maninstall
469.ORDER: beforeinstall maninstall
470.endif
471
472.endif
473
474.if ${MK_MAN} != "no" && !defined(LIBRARIES_ONLY)
475.include <bsd.man.mk>
476.endif
477
478.if defined(LIB) && !empty(LIB)
479OBJS_DEPEND_GUESS+= ${SRCS:M*.h}
480.endif
481.if defined(SHLIB_NAME) || \
482    defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB)
483.for _S in ${SRCS:N*.[hly]}
484OBJS_DEPEND_GUESS.${_S:${OBJS_SRCS_FILTER:ts:}}.pico+=	${_S}
485.endfor
486.endif
487.if defined(BUILD_NOSSP_PIC_ARCHIVE) && defined(LIB) && !empty(LIB)
488.for _S in ${SRCS:N*.[hly]}
489OBJS_DEPEND_GUESS.${_S:${OBJS_SRCS_FILTER:ts:}}.nossppico+=	${_S}
490.endfor
491.endif
492
493.if defined(HAS_TESTS)
494MAKE+=			MK_MAKE_CHECK_USE_SANDBOX=yes
495SUBDIR_TARGETS+=	check
496TESTS_LD_LIBRARY_PATH+=	${.OBJDIR}
497.endif
498
499.include <bsd.debug.mk>
500.include <bsd.dep.mk>
501.include <bsd.clang-analyze.mk>
502.include <bsd.obj.mk>
503.include <bsd.sys.mk>
504