On Tue, Jun 19, 2012 at 05:43:08PM -0400, Jeff King wrote: > Some of the existing locations did not do a great job of that, and > instead it like this: > > version.o git.spec \ > $(patsubst %.sh,%,$(SCRIPT_SH)) \ > $(patsubst %.perl,%,$(SCRIPT_PERL)) \ > : GIT-VERSION-FILE > > [... 500 lines later ...] > > git.spec: git.spec.in > sed -e 's/@@VERSION@@/$(GIT_VERSION)/g' <$< >$@+ > > If you read the latter hunk and wanted to emulate it, there is nothing > to indicate that you must also modify the earlier hunk. I think putting > them together makes more sense (even though it technically takes more > lines). Hmm. The deeper I dig into the Makefile, the more problems I find. I think I'm ready to come out of the rabbit hole for today, and I ended up with the series below. Some of it is cleanup and some of it fixes real problems. My philosophy in doing the series was: 1. Dependencies should be inclusive. That is, re-running "make" in an already-built tree with different parameters should produce the same result as running in a clean tree. 2. Dependencies do not have to be precise. That is, it's OK to re-run a build step even if it will produce the same output. Of course, it's nice to be more precise because it saves time, but for the sake of simplicity, we compartmentalize groups of changes (e.g., GIT-CFLAGS depends on SHELL_PATH even though only run-command.c needs it; that's OK because SHELL_PATH doesn't get changed often). 3. Dependencies on variables that change regularly _should_ be precise. GIT_VERSION (and anything that depends on it) is a good example, because you don't want to rebuild every time you check out a new version. [1/8]: Makefile: apply dependencies consistently to sparse/asm targets [2/8]: Makefile: do not replace @@GIT_USER_AGENT@@ in scripts [3/8]: Makefile: split GIT_USER_AGENT from GIT-CFLAGS [4/8]: Makefile: split prefix flags from GIT-CFLAGS [5/8]: Makefile: do not replace @@GIT_VERSION@@ in shell scripts [6/8]: Makefile: update scripts when build-time parameters change [7/8]: Makefile: build instaweb similar to other scripts [8/8]: Makefile: move GIT-VERSION-FILE dependencies closer to use This replaces the series I sent earlier today, and goes on top of jk/version-string. A lot of it could be a separate topic, but it's textually pretty tangled. If jk/version-string is soon to graduate, then I'd just as soon leave it as-is rather than go to the work of disentangling it. Even though there are fixes here, none of them is so critical that they can't be held hostage for a few days or a week. -Peff -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html