On Tue, Jun 19, 2012 at 01:51:14PM -0700, Junio C Hamano wrote:
Jeff King [off-list ref] writes:
quoted
Most of the build targets do not care about the setting of $prefix
(or its derivative variables), but will be rebuilt if the prefix
changes. For most setups this doesn't matter (they set prefix once
and never change it), but for a setup which puts each branch or
version in its own prefix, this unnecessarily causes a full
rebuild whenever the branc is changed.
[...]
I have to wonder if is this something we care about that much.
It does speed up my build a fair bit, but I admit I have a somewhat
uncommon setup.
The damage is not too bad from the point of view of linecount, but
this embeds the implicit knowledge of dependencies from $prefix to
various path variables to selected object files that embed these
paths variables by scattering dependencies on GIT-PREFIX in the
Makefile, which does not seem to scale very well. I wonder if it
makes sense to have a single default-paths.o file that holds these
strings and recompile only that file when any of the paths change,
to localize the damage.
Of course, the current users of GIT_HTML_PATH that expect they can
do sizeof(GIT_HTML_PATH)-1 in place of strlen(GIT_HTML_PATH) may
need to be adjusted if we go that route.
Yeah, I think that would be nicer overall. If we move to a link-time
dependency, then we can even put _all_ of the Makefile-based strings in
there without ever having to care about who uses it. Of course, it won't
work for things that truly need to be preprocessor macros (for
conditional compilation), so we'd still be stuck with those (most of
them just end up in CFLAGS and trigger a full rebuild, which is probably
OK).
-Peff