[bug #20501] MAKEFLAGS += -rR doesn't turn off default suffix rules, variables

2011-12-20 Thread Paul D. Smith
Follow-up Comment #9, bug #20501 (project make):

It's not completely true that -p shows the rules as if they were there. 
Recall that there are two types of implicit rules in GNU make: suffix rules
and pattern rules.

If you use MAKEFLAGS+=-r then the _pattern rules_ will not be present in the
-p output.

However, MAKEFLAGS+=-r is not the same as make -r because the latter ALSO
prevents suffix rules from being defined, while the former does not.  The
former only applies to pattern rules.

That's why in the makefile you need BOTH the .SUFFIXES: special target AND the
MAKEFLAGS+=-r.  Having the .SUFFIXES: special target set to empty ensures that
no suffix rules are searched but it does NOT remove all the suffix rules from
the database.  So they still show up with -p, but they don't have any impact
on the algorithms make uses to build targets.

___

Reply to this item at:

  http://savannah.gnu.org/bugs/?20501

___
  Message sent via/by Savannah
  http://savannah.gnu.org/


___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


[bug #20501] MAKEFLAGS += -rR doesn't turn off default suffix rules, variables

2011-12-20 Thread Paul D. Smith
Update of bug #20501 (project make):

Operating System: POSIX-Based = Any


___

Reply to this item at:

  http://savannah.gnu.org/bugs/?20501

___
  Message sent via/by Savannah
  http://savannah.gnu.org/


___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


[bug #20501] MAKEFLAGS += -rR doesn't turn off default suffix rules, variables

2011-12-20 Thread Paul D. Smith
Update of bug #20501 (project make):

   Triage Status:None = Verified   


___

Reply to this item at:

  http://savannah.gnu.org/bugs/?20501

___
  Message sent via/by Savannah
  http://savannah.gnu.org/


___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


[bug #20501] MAKEFLAGS += -rR doesn't turn off default suffix rules, variables

2008-01-24 Thread Hendrik de Goede

Follow-up Comment #7, bug #20501 (project make):

Does it matter that the built-in variables get set before reading makefiles?
I hope not.
I think the people involved in this project are clever enough to unset a
'default' variable if the make flag -R is encountered.

I mean, the 'origin' function in makefiles can determine just that, if its
value is default or not, so there must be some functionality in the sources to
determine so. I guess there's also some sort of functionality to loop through
all the defined variables.

Combine the two and what do you get?
Exactly what it should do... well, at least what I suggested :)

The documentation should then be updated to state that -r should come before
any rule, and -R before any inbuilt variable gets a conditional assignment
(the ?= assignment).

As for -r working properly, that's great, but then -p should be fixed.

p.s. The 'ifeq ($(filter -r,$(MAKEFLAGS)),)' isn't really needed, -r won't
get added twice.

___

Reply to this item at:

  http://savannah.gnu.org/bugs/?20501

___
  Message sent via/by Savannah
  http://savannah.gnu.org/



___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


[bug #20501] MAKEFLAGS += -rR doesn't turn off default suffix rules, variables

2008-01-23 Thread Hendrik de Goede

Follow-up Comment #1, bug #20501 (project make):

I'm using GNU make 3.81 through cygwin on Windows XP.

The -rR flags are not the only ones not working as expected (expected by me
at least), the option -S doesn't work as well.
However, when running a subsequent call from the Makefile, they all work just
fine.
The flags '--no-print-directory', '-s' and '--warn-undefined-variables'
function properly immediately.

The main problem I'm having with this is that we use various .mk files which
can be included from the Makefile. I want to set defaults for the programs,
flags and such (like CC ?= gcc) in those .mk files. But this 'bug' prevents me
from doing so, as CC already gets a default value.



___

Reply to this item at:

  http://savannah.gnu.org/bugs/?20501

___
  Message sent via/by Savannah
  http://savannah.gnu.org/



___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


[bug #20501] MAKEFLAGS += -rR doesn't turn off default suffix rules, variables

2008-01-23 Thread Dave Korn

Follow-up Comment #2, bug #20501 (project make):

As far as I can see this is not a bug, this is make performing exactly as
described in the manual.  MAKEFLAGS is not a live way of controlling a running
make's behaviour, it is used solely for the purpose of passing down to a
recursive invocation of make; that is why you find they work when you run a
subsequent call from the makefile, by which I think you mean a recursive
submake invocation.

Please review the make documentation, 5.7.3 Communicating Options to a
Sub-`make', and verify whether you really have a bug here or not.

http://www.gnu.org/software/make/manual/html_node/Options_002fRecursion.html#Options_002fRecursion

cheers,
  DaveK


___

Reply to this item at:

  http://savannah.gnu.org/bugs/?20501

___
  Message sent via/by Savannah
  http://savannah.gnu.org/



___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


[bug #20501] MAKEFLAGS += -rR doesn't turn off default suffix rules, variables

2008-01-23 Thread Hendrik de Goede

Follow-up Comment #3, bug #20501 (project make):

I think it is a bug.

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.

p.s. Indeed, I meant the recursive submake invocation.

___

Reply to this item at:

  http://savannah.gnu.org/bugs/?20501

___
  Message sent via/by Savannah
  http://savannah.gnu.org/



___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


[bug #20501] MAKEFLAGS += -rR doesn't turn off default suffix rules, variables

2008-01-23 Thread Dave Korn

Follow-up Comment #4, bug #20501 (project make):

I'm sorry, I missed that!  I think you're right; it is a bug.

___

Reply to this item at:

  http://savannah.gnu.org/bugs/?20501

___
  Message sent via/by Savannah
  http://savannah.gnu.org/



___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


Re: [bug #20501] MAKEFLAGS += -rR doesn't turn off default suffix rules, variables

2008-01-23 Thread Philip Guenther
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-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


Re: [bug #20501] MAKEFLAGS += -rR doesn't turn off default suffix rules, variables

2008-01-23 Thread Hendrik de Goede
I see the problem, however I think the solution is 'rather' simple.
The MAKEFLAGS -r should be specified before any rule, and -R unsets
all defaults still set.

If this is unwanted, and for some reason these 2 flags won't be
supported from inside a Makefile, I would at least like the
possibility to specify alternate default values.
Maybe having 'CC?=gcc' also set CC if it only has a default value?

p.s. Shouldn't these comments be made in the case?


2008/1/23, Philip Guenther [EMAIL PROTECTED]:
 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-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


[bug #20501] MAKEFLAGS += -rR doesn't turn off default suffix rules, variables

2008-01-23 Thread Boris Kolpackov

Follow-up Comment #6, bug #20501 (project make):

Actually adding -r to MAKEFLAGS does work. It just that -p still prints the
rules as if they were there. I use the following makefile fragment in our
build system to get rid of all built-in (suffix and pattern) rules:

# Remove all built-in rules.
#
.SUFFIXES:

ifeq ($(filter -r,$(MAKEFLAGS)),)
MAKEFLAGS += -r
endif

There was a thread on one of the GNU make mailing lists about this
interesting behavior some time ago.

As for adding -R, I think it is quite obvious why it does not work: make sets
built-in variables before it starts reading makefiles.

Boris

___

Reply to this item at:

  http://savannah.gnu.org/bugs/?20501

___
  Message sent via/by Savannah
  http://savannah.gnu.org/



___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


[bug #20501] MAKEFLAGS += -rR doesn't turn off default suffix rules, variables

2007-07-16 Thread Matt McCutchen

URL:
  http://savannah.gnu.org/bugs/?20501

 Summary: MAKEFLAGS += -rR doesn't turn off default suffix
rules, variables
 Project: make
Submitted by: hashproduct
Submitted on: Tuesday 07/17/2007 at 03:58
Severity: 3 - Normal
  Item Group: Bug
  Status: None
 Privacy: Public
 Assigned to: None
 Open/Closed: Open
 Discussion Lock: Any
   Component Version: None
Operating System: POSIX-Based
   Fixed Release: None

___

Details:

I'm using GNU make 3.81 on Fedora Core 7 Linux.

I put MAKEFLAGS += -rR at the top of my makefile and expected this to
disable all default rules and variables.  However, make -p shows that the
default suffix rules and variables are still present.

My makefile, makeflags.mk is the following:

-
MAKEFLAGS += -rR

all:
-

This illustrates that the options in the makefile do not turn off suffix
rules:

$ make -f makeflags.mk -p | grep '^\..*\..*'
.LIBPATTERNS = lib%.so lib%.a
.web.p:
.l.r:
.F.o:
.y.ln:
.def.sym:
.p.o:
.txinfo.dvi:
.l.ln:
.w.c:
.texi.dvi:
.cc.o:
.SUFFIXES: .out .a .ln .o .c .cc .C .cpp .p .f .F .r .y .l .s .S .mod .sym
.def .h .info .dvi .tex .texinfo .texi .txinfo .w .ch .web .sh .elc .el
.c.o:
.r.o:
.l.c:
.r.f:
.texinfo.info:
.w.tex:
.c.ln:
.s.o:
.texinfo.dvi:
.y.c:
.web.tex:
.texi.info:
.tex.dvi:
.cpp.o:
.C.o:
.txinfo.info:
.S.s:
.mod.o:
.F.f:
.S.o:
.f.o:
$ make -f makeflags.mk -p -rR | grep '^\..*\..*'
(No output)

This happens because default suffix rules and variables are loaded too soon
to be governed by the second call to decode_env_switches that picks up the
MAKEFLAGS set by the makefile.




___

Reply to this item at:

  http://savannah.gnu.org/bugs/?20501

___
  Message sent via/by Savannah
  http://savannah.gnu.org/



___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make