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

 
 

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

Submitter:  None
Submitted:  Tue 04 Dec 2007 09:01:41 AM UTC
Votes: 100
 
Severity:  3 - Normal Item Group:  Bug
Status:  Not A Bug Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Component Version:  3.81 Operating System:  POSIX-Based
Fixed Release:  None Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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 Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 100 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-05-26 psmith StatusNone Not A Bug
        Open/ClosedOpen Closed
    2007-12-29 zoltan68 Carbon-Copy- Added zoltan68

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code