From: Johannes Sixt Date: Wed, 07 Mar 2007 13:41:54 GMT Subject: [PATCH] Avoid rebuilding everything if user changes CFLAGS on the make command line Message-ID: <45EEC122.EA43CB72@eudaptics.com> In-Reply-To: From: Johannes Sixt The following sequence of commands is commonly used to recompile selected files with different flags, for example, to change the debug information: make rm builtin-diff.o make CFLAGS="-g -O0" However, the Makefile is clever enough to notice that the second 'make' invocation changes the build flags and rebuilds everything. This change exempts the value of CFLAGS (which is explicitly declared as reserved for the user to change from the command line) from this auto-detection. Signed-off-by: Johannes Sixt --- Johannes Schindelin wrote: > GIT-CFLAGS: .FORCE-GIT-CFLAGS > @FLAGS='$(TRACK_CFLAGS)'; \ > - if test x"$$FLAGS" != x"`cat GIT-CFLAGS 2>/dev/null`" ; then \ > + if test x"$$FLAGS" != x"`cat GIT-CFLAGS 2>/dev/null`" -a \ > + -z "$(IGNORE_GIT_CFLAGS)"; then \ > echo 1>&2 " * new build flags or prefix"; \ > echo "$$FLAGS" >GIT-CFLAGS; \ > fi IMHO, the value of $(CFLAGS) (which the Makefile declares as "for the users to override from the command line") should never take part in this build-flags-change-autodetection. -- Hannes Makefile | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Makefile b/Makefile index 9a37b15..8410530 100644 --- a/Makefile +++ b/Makefile @@ -812,7 +812,7 @@ tags: find . -name '*.[hcS]' -print | xargs ctags -a ### Detect prefix changes -TRACK_CFLAGS = $(subst ','\'',$(ALL_CFLAGS)):\ +TRACK_CFLAGS = $(subst ','\'',$(BASIC_CFLAGS)):\ $(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ) GIT-CFLAGS: .FORCE-GIT-CFLAGS -- 1.5.0.2.279.g4808