bugmake - Bugs: bug #21716, The following works in 3.80 but...

 
 

bug #21716: The following works in 3.80 but not in 3.81

Submitted by:  None
Submitted on:  Tue 04 Dec 2007 09:01:41 AM UTC  
Votes:  100  
 
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.

 

Sat 29 Dec 2007 09:50:20 PM UTC, comment #2:

The change in behavior is listed in the 3.81 NEWS file. To quote:

  • WARNING: Backward-incompatibility!

GNU make now implements a generic "second expansion"
feature on the prerequisites of both explicit and implicit
(pattern) rules. In order to enable this feature, the
special target '.SECONDEXPANSION' must be defined before
the first target which takes advantage of it. If this
feature is enabled then after all rules have been parsed
the prerequisites are expanded again, this time with all
the automatic variables in scope. This means that in
addition to using standard SysV $$@ in prerequisites
lists, you can also use complex functions such as
$$(notdir $$@) etc. This behavior applies to implicit
rules, as well, where the second expansion occurs when
the rule is matched. However, this means that when
.SECONDEXPANSION' is enabled you must double-quote any
"$" in your filenames; instead of "foo: boo$$bar" you
now must write "foo: foo$$$$bar". Note that the SysV
$$@ etc. feature, which used to be available by default,
is now ONLY available when the .SECONDEXPANSION target
is defined. If your makefiles take advantage of this
SysV feature you will need to update them.

So, add the line
.SECONDEXPANSION:
to the makefile somewhere before any uses of $$(@F), etc. With that, the makefile will work with both 3.80 and 3.81.

Philip Guenther

Anonymous
Sat 29 Dec 2007 05:02:52 AM UTC, comment #1:

Quoting from the Changelog:

2005-02-27 Boris Kolpackov <boris@kolpackov.net>

Implementation of the second expansion in explicit rules, static pattern rules and implicit rules.

  • read.c (eval): Refrain from chopping up rule's dependencies. Store them in a struct dep as a single dependency line. Remove the code that implements SySV-style automatic variables.
  • read.c (record_files): Adjust the code that handles static pattern rules to expand all percents instead of only the first one. Reverse the order in which dependencies are stored so that when the second expansion reverses them again they appear in the makefile order (with some exceptions, see comments in the code). Remove the code that implements SySV-style automatic variables.

In particular, "Remove the code that implements SySV-style automatic variables" looks like would address this.

Boris, is this true? Were the $$(@), $$(@D), and $$(@F) automatic variables deliberately removed? I don't know why they would have been removed, but I'd cast a vote to put them back. They are quite useful...if there's another way, please let us know.

John <zoltan68>
Tue 04 Dec 2007 09:01:41 AM UTC, original submission:

$(EXECDIR)/ipadb $(EXECDIR)/mnconv $(EXECDIR)/mksubnet \ $(EXECDIR)/netnamconv $(EXECDIR)/tspnamconv : $$(@F)

on 3.81
make[2]: *** No rule to make target `$(@F)', needed by `../../bin/mnconv'. Stop

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by psmith (Updated the item)
  • -unavailable- added by zoltan68 (Voted in favor of this item)
  • -unavailable- added by zoltan68 (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 100 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 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 26 May 2008 02:35:33 AM UTCpsmithStatusNone=>Not A Bug
      Open/ClosedOpen=>Closed
    Sat 29 Dec 2007 05:04:14 AM UTCzoltan68Carbon-Copy-=>Added zoltan68

    Back to the top


    Powered by Savane 3.1-cleanup1