HomeFreeBSD

Allow DEPENDOBJS/DEPENDSRCS to work with only OBJS set and no SRCS.

Description

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

Details

Committed
bdreweryJun 15 2019, 5:08 PM
Parents
rS349067: Support reading in .depend files.
Branches
Unknown
Tags
Unknown