xref: /freebsd/contrib/bmake/mk/dirdeps2dplibs.mk (revision 0b46a53a2f50b5ab0f4598104119a049b9c42cc9)
1# SPDX-License-Identifier: BSD-2-Clause
2#
3# $Id: dirdeps2dplibs.mk,v 1.3 2025/05/29 18:32:53 sjg Exp $
4
5# DIRDEPS generally reflects things *actually used* by RELDIR.
6# dirdeps2dplibs allows us to turn DIRDEPS into a DPLIBS list
7# The order will however be sorted, so some
8# manual tweaking may be needed.
9#
10
11dirdeps2dplibs:
12
13.if ${.MAKE.LEVEL} > 0
14# for customization
15.-include <local.dirdeps2dplibs.mk>
16
17_DEPENDFILE ?= ${.MAKE.DEPENDFILE}
18
19.dinclude "${_DEPENDFILE}"
20
21INCS_DIRS += h include incs
22DIRDEPS2DPLIBS_FILTER += C;/(${INCS_DIRS:O:u:ts|})(\.common.*)*$$;;
23
24dirdeps2dplibs:
25	@echo
26.if ${DEBUG_DIRDEPS2DPLIBS:Uno:@x@${RELDIR:M$x}@} != ""
27	@echo "# DIRDEPS=${DIRDEPS:M*lib*}"
28.endif
29	@echo -n 'DPLIBS += \'; \
30	echo '${DIRDEPS:M*lib*:${DIRDEPS2DPLIBS_FILTER:ts:}:T:O:u:tu:@d@${.newline}${.tab}_{LIB${d:S,^LIB,,}} \\@}' | \
31	sed 's,_{,$${,g'; \
32	echo
33
34
35.endif
36