svn commit: r288966 - head/share/mk

Simon J. Gerraty sjg at juniper.net
Thu Nov 19 03:53:32 UTC 2015


Bryan Drewery <bdrewery at FreeBSD.org> wrote:
> As for the actual change in local.autodep.mk, I don't think it is needed
> or right since bsd.lib.mk and bsd.prog.mk already do exactly the same
> thing via ${OBJS}: ${SRCS:M*.h} if .depend is not yet generated. This
> does work in meta mode as I ran into a failure due to it before r291046
> (I had removed the libbfd/Makefile.depend.host for other testing). It's
> also hooked in far too late and orthogonally to the OBJS in the graph
> that need the headers.

Forgive me; what is "it" in the last sentence?

It is never too late to add a dependency.
It can easily be too late to add a value to a variable - to affect
dependencies.

Eg.

goo: ${OBJS}
     echo OBJS=${OBJS}

OBJS+= foo.c

will not behave as 99% of readers assume.

foo.c being newer than goo, will not cause the target to be updated
because in goo: ${OBJS} OBJS is evaluated as the line is read.
Whereas echo OBJS=${OBJS} is evaluated when the script is run which is
much later in the game.

OBJS+= foo.c
goo: foo.c

would be correct fwiw.



More information about the svn-src-all mailing list