Re: [PATCH 3/3] Makefile: split prefix flags from GIT-CFLAGS
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:54:08
Jeff King [off-list ref] writes:
On Tue, Jun 19, 2012 at 01:51:14PM -0700, Junio C Hamano wrote:quoted
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.
Oh, I wouldn't question the "speeding up" part. I simply expected that people who use separate prefix depending on branch would have separate checkout for these branches they build and install regularly to their own prefixes, so recompilation due to prefix change would not be an issue, because by definition in such a set-up you won't change branch in a checkout.
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).
Yeah, I didn't go through the list of Make variables to see how much damage I was talking about ;-).