]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Allow DEPENDOBJS/DEPENDSRCS to work with only OBJS set and no SRCS.
authorbdrewery <bdrewery@FreeBSD.org>
Sat, 15 Jun 2019 17:08:35 +0000 (17:08 +0000)
committerbdrewery <bdrewery@FreeBSD.org>
Sat, 15 Jun 2019 17:08:35 +0000 (17:08 +0000)
commit08ae9367c4201d2b1b4d9665d92f6d41427393bd
tree1369bf305b61213656673874fdd54ee9c29c5c30
parent15c0cf863a4c052fa68b6ad8422c4566a2ad754d
Allow DEPENDOBJS/DEPENDSRCS to work with only OBJS set and no SRCS.

Default to tracking .depend.* for OBJS rather than SRCS.

This helps cover some special case builds like gnu/lib/csu which
do more of a PROGS-like thing with bsd.prog.mk.

It is possible this causes out-of-tree Makefiles to have problems if they use
this pattern:
foo.o: foo.c
${CC} -o ${.TARGET} ${.ALLSRC}
This may cause multiple source files to be compiled due to finding the
'foo.o: foo.c' dependency both in the Makefile at the .depend file. Or
it may try compiling headers. This can be worked around by either of these:
foo.o: foo.c
${CC} -o ${.TARGET} ${.ALLSRC:N*.h:[1]}
Or
foo.o: foo.c
${CC} -o ${.TARGET} ${.CURDIR}/foo.c
In the latter case the ${.CURDIR} may need to be a different path. The
first case covers automatically using .PATH.

Sponsored by: DellEMC
share/mk/bsd.dep.mk