[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug #20501] "MAKEFLAGS += -rR" doesn't turn off default suffix rule
From: |
Philip Guenther |
Subject: |
Re: [bug #20501] "MAKEFLAGS += -rR" doesn't turn off default suffix rules, variables |
Date: |
Wed, 23 Jan 2008 05:33:50 -0700 |
On Jan 23, 2008 4:33 AM, Hendrik de Goede wrote:
> To quote the make 3.81 documentation 'You can also set MAKEFLAGS in a
> makefile, to specify additional flags that should also be in effect for that
> makefile', in the same chapter you specified.
Unfortunately, it's not clear how "MAKEFLAGS += -R" can be made to
work as desired, as the built-in variables are set before the user's
makefile is parsed. For example, what's it suppose to do with this
Makefile:
all: foo-$(shell echo $(RM))
foo-rm:
@echo rm
foo-:
@echo nothing
ifdef RM
MAKEFLAGS += -R
endif
Does the MAKEFLAGS setting force a reexec? To give the 'all' target
the 'correct' prereq list would require that. Hmm, what if you
_remove_ -R from MAKEFLAGS?
Or maybe I'm over analyzing. What if the effect of adding -R to
MAKEFLAGS was that make immediately unset all variables whose origin
is 'default'?
Hmm, the operation of the -r option (which is implied by -R, yes) is
actually worse, as there's no way to remove a rule from make's memory.
Then again, is there any way to detect that a rule exists from inside
a Makefile? If not, then make could delay the addition of the
implicit rules until the makefile is completely parsed, albeit with
some ugly complexity to do the "insert these as if they had occurred
before all other rules" effect. E.g., if the makefile has this:
%:: %,v
then the RCS checkout rule has to remain canceled.
That's looking line a ton of complexity to achieve logical
completeness. Even though the main project I have builds slightly
faster (and just as correctly) when the -R option is given, I don't
find myself worrying about it. I would much rather have GNU make
behave like it does than have it handle MAKEFLAGS+=-Rr as I suggested
above at the cost of new, subtle processing bugs. As cute as being
able to set -R from inside the makefile is, I just don't see it as a
feature that's worth introducing *any* bugs over.
I vote that Paul just change the info pages to document the current behavior.
Philip Guenther
- [bug #20501] "MAKEFLAGS += -rR" doesn't turn off default suffix rules, variables, Hendrik de Goede, 2008/01/23
- [bug #20501] "MAKEFLAGS += -rR" doesn't turn off default suffix rules, variables, Dave Korn, 2008/01/23
- [bug #20501] "MAKEFLAGS += -rR" doesn't turn off default suffix rules, variables, Hendrik de Goede, 2008/01/23
- [bug #20501] "MAKEFLAGS += -rR" doesn't turn off default suffix rules, variables, Dave Korn, 2008/01/23
- [bug #20501] "MAKEFLAGS += -rR" doesn't turn off default suffix rules, variables, Matt McCutchen, 2008/01/23
- [bug #20501] "MAKEFLAGS += -rR" doesn't turn off default suffix rules, variables, Boris Kolpackov, 2008/01/24
- [bug #20501] "MAKEFLAGS += -rR" doesn't turn off default suffix rules, variables, Hendrik de Goede, 2008/01/24
- Re: [bug #20501] "MAKEFLAGS += -rR" doesn't turn off default suffix rules, variables,
Philip Guenther <=
- Re: [bug #20501] "MAKEFLAGS += -rR" doesn't turn off default suffix rules, variables, Hendrik de Goede, 2008/01/23