bugmake - Bugs: bug #23793, MAKEFLAGS with only variable...

 
 

bug #23793: MAKEFLAGS with only variable settings X=y does not work properly

Submitted by:  Roland Bless <rbless>
Submitted on:  Mon 07 Jul 2008 01:04:23 PM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: Not A BugPrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Component Version: 3.81Operating System: POSIX-Based
Fixed Release: NoneTriage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 07 Jul 2008 01:33:46 PM UTC, comment #1:

I don't believe this is a bug. The GNU make manual says:

`MAKEFLAGS' begins with a hyphen only when it begins with an option that has no single-letter version, such as `--warn-undefined-variables'

In general, it's not correct to put $(MAKEFLAGS) in a recipe line when invoking a sub-make. MAKEFLAGS is intended to be passed to the sub-make through the environment, not the command line, and this will happen automatically for you all the time.

Sub-makes should be invoked as just $(MAKE), with no $(MAKEFLAGS).

For more information, see section "Communicating Options to a Sub-make" in the GNU make manual.

Paul D. Smith <psmith>
Project Administrator
Mon 07 Jul 2008 01:04:23 PM UTC, original submission:

If you call make with a variable override X=y it will
not be propagated correctly to other Makefiles:

make TARGET=success
will lead to
make -f Makefile.sub -$(MAKEFLAGS)
being expanded into
make -f Makefile.sub -TARGET=success

but using
make -w TARGET=SUCCESS
will correctly expand to
make -f Makefile.sub -w -- TARGET=SUCCESS

See attached Makefiles as an example
make TARGET=success
fails badly, whereas
make -w TARGET=success
succeeds. To my understanding
make TARGET=success
should expand "make -f Makefile.sub -$(MAKEFLAGS)" to
make -f Makefile.sub -- TARGET=success

Platform: Linux, Ubuntu 8.04, make -v
GNU Make 3.81

Roland Bless <rbless>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #16017:  Makefile added by rbless (88B - application/octet-stream - Makefiles for demonstrating the bug.)
file #16018:  Makefile.sub added by rbless (128B - application/octet-stream - Makefiles for demonstrating the bug.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by psmith (Posted a comment)
  • -unavailable- added by rbless (Submitted the item)
  • -unavailable- added by rbless
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 07 Jul 2008 01:33:46 PM UTCpsmithStatusNone=>Not A Bug
      Open/ClosedOpen=>Closed
    Mon 07 Jul 2008 01:04:23 PM UTCrblessAttached File-=>Added Makefile, #16017
      Attached File-=>Added Makefile.sub, #16018
      Carbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1