bugmake - Bugs: bug #12124, Make does not allow $(eval) of new...

 
 

bug #12124: Make does not allow $(eval) of new targets inside command scripts

Submitter:  None
Submitted:  Thu 24 Feb 2005 12:38:48 AM UTC
Votes: 1
 
Severity:  3 - Normal Priority:  5 - Normal
Item Group:  Enhancement Status:  Later
Privacy:  Public Assigned to:  psmith
Open/Closed:  Open Component Version:  3.80
Operating System:  POSIX-Based Fixed Release:  None
Triage Status:  Major Effort
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

  Spam posted by sevanath
Sun 27 Feb 2005 05:48:32 PM UTC, comment #1: 

Hm.  There is a serious problem with defining new prerequisites inside a target like this: make goes through a sanitization/canonicalization process on all targets and prerequisites after all makefiles are read in (file.c:snap_deps()), and the rest of the make algorithm expects this to have been done.  Of course it is not done on the target/prerequisite definitions from eval inside a command script.

Changing this will be fairly challenging, and I don't have time to solve this problem before the next release, so I am deferring this bug although I'll leave it open.  In the meantime I'm going to install a check to disallow target/prerequisite definitions inside evals in command script contexts, so at least you'll get an error and not a core dump.

As for your issue, I suggest you post to the -email is unavailable- list with a more detailed description of exactly what you want to do.  I strongly suspect that your situation can be handled through auto-generated included makefiles.

Paul D. Smith <psmith>
Group administrator
Thu 24 Feb 2005 12:38:48 AM UTC, original submission:  

The following makefile will cause make to crash with nice little stack-dance when doing "make foo":

-----{Makefile}-----
deps:
echo deps
$(eval foo: fie)

fie:
echo fie

foo: deps
echo foo
-----{/Makefile}-----

[redhog@ystra:~]$ make -d foo
GNU Make 3.80
...
Considering target file `foo'.
  Considering target file `deps'.
   File `deps' does not exist.
   Finished prerequisites of target file `deps'.
  Must remake target `deps'.
echo deps
Putting child 0x089fc8e0 (deps) PID 1806 on the chain.
Live child 0x089fc8e0 (deps) PID 1806
deps
Got a SIGCHLD; 1 unreaped children.
Reaping winning child 0x089fc8e0 PID 1806
Removing child 0x089fc8e0 PID 1806 from chain.
  Successfully remade target file `deps'.
Segmentation fault (core dumped)

I'm also interrested in getting help with accomplishing the same as the above code ought to accomplish, but in a way that actually works with the current make program (in reality, deps is an implicit rule, whose stem is used in a shell-command which computes the arguments to eval, and no the ordinary way for automatic prerequisites from the manual with a patsubst and a dirlisting won't cut it, since this must work even for intermediate files...). My e-mail-adress is -email is unavailable-

Anonymous

 

Attached Files

This item currently has no attached files.

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

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

Carbon-Copy List
  • -email is unavailable- added by sevanath (Posted a comment)
  • -email is unavailable- added by psmith (Updated the item)
  •  

    Votes

    There is 1 vote 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.

     

    History

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-09-21 psmith Triage StatusNone Major Effort
    2007-02-26 hashproduct Carbon-Copy- Added hashproduct
    2005-03-04 psmith Item GroupBug Enhancement
    2005-02-27 psmith SummaryMake segfaults when using $(eval) in some ways Make does not allow $(eval) of new targets inside command scripts
    2005-02-27 psmith StatusNone Later
        Assigned toNone psmith
        Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.16-11ef.
    Corresponding source code