Re: [PATCHv3 07/11] Makefile: split prefix flags from GIT-CFLAGS
From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:54:09
Jeff King wrote:
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.
Micronit: s/branc/branch/. [...]
quoted hunk ↗ jump to hunk
@@ -2385,14 +2391,22 @@ cscope: $(FIND_SOURCE_FILES) | xargs cscope -b ### Detect prefix changes -TRACK_CFLAGS = $(CC):$(subst ','\'',$(ALL_CFLAGS)):\ - $(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ):\ - $(localedir_SQ):$(USE_GETTEXT_SCHEME) +TRACK_PREFIX = $(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ):\ + $(localedir_SQ) + +GIT-PREFIX: FORCE + @FLAGS='$(TRACK_PREFIX)'; \ + if test x"$$FLAGS" != x"`cat GIT-PREFIX 2>/dev/null`" ; then \ + echo 1>&2 " * new prefix flags"; \ + echo "$$FLAGS" >GIT-PREFIX; \ + fi
Hmm, nothing to do with this particular patch but the above list includes gitexecdir and not htmldir. Is there any particular logic behind the list of variables? Nit: I think it would be easier to understand a name like GIT-PATHS (making the absence of htmldir a bug, if not a particularly important one). No other complaints. :) Thanks. Jonathan