bugmake - Bugs: bug #35455, “Empty Recipes” documentation...


bug #35455: “Empty Recipes” documentation update

Submitted by:  Simon Wright <sjw>
Submitted on:  Sun 05 Feb 2012 05:11:29 PM UTC  
Severity:  3 - Normal Item Group:  Documentation
Status:  Fixed Privacy:  Public
Assigned to:  Paul D. Smith <psmith> Open/Closed:  Closed
Component Version:  3.80 Operating System:  POSIX-Based
Fixed Release:  4.2 Triage Status:  Small Effort

Add a New Comment (Rich Markup)

You are not logged in

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


Mon 29 Feb 2016 08:32:19 AM UTC, comment #2: 

Thanks for that. Looking at it, I think the point is that

   foo: bar-stamp

would leave make baffled about how it is supposed to make foo from bar-stamp; whereas

   foo: bar-stamp ;

means that the way to do it is to do nothing (and rely on the side-effect); and also that there is now a reason to consider whether foo has changed as a result of the side-effect. I think this last point is why I needed to make the change to my Makefiles.

Simon Wright <sjw>
Mon 29 Feb 2016 06:47:23 AM UTC, comment #1: 

I added a bit more text here.  I'm not sure I captured everything but at least I made it less definitive that there's only one useful way to use empty recipes.

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Sun 05 Feb 2012 05:11:29 PM UTC, original submission:  

I found it necessary to use the “empty recipe” rule in circumstances which don’t seem to match those in the documentation (edition 0.71 as at http://www.gnu.org).

I’ve attached a Makefile with comments to indicate what works for me and what goes wrong.

In summary, I process a .uml file to extract the .norm files implied by its contents, and then process the .norm files to create .gen files. Most of this can be standardised, but there’s no way for standard processing to determine beforehand which .norm files are “contained” in a .uml file.

I created a .norm-stamp file whenever I’ve processed a .uml file, and then added a rule to say that many.uml “contains” a.norm and b.norm:

a.norm b.norm: many.norm-stamp

The first time I say “make a.gen”, all is well. If I then touch many.uml and say “make a.gen” again, make only gets as far as creating many.norm-stamp (and a.norm, b.norm); you have to run make again to regenerate a.gen.

I found that I can get the behaviour I need by adding an empty recipe:

a.norm b.norm: many.norm-stamp ;

Simon Wright <sjw>


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

Attach Files:

Attached Files
file #24990:  Makefile added by sjw (909B - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by bgwf (had a very similar problem here)
  • -email is unavailable- added by sjw (Submitted the item)

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

    Only logged-in users can vote.




    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-02-29 psmith StatusNone => Fixed
        Assigned toNone => psmith
        Open/ClosedOpen => Closed
        Fixed ReleaseNone => 4.2
        Triage StatusNone => Small Effort
    2012-07-05 bgwf Carbon-Copy- => Added bgwf
    2012-02-05 sjw Attached File- => Added Makefile, #24990

    Back to the top

    Powered by Savane 3.5