help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Empty recipes handling


From: Paul Smith
Subject: Re: Empty recipes handling
Date: Thu, 09 Mar 2017 17:54:36 -0500

On Thu, 2017-03-09 at 23:15 +0100, Marcin Świgoń wrote:
> I stumbled upon make behavior that bothers me a lot. I was looking
> through Make documentation and closest description I've found was:

I don't understand what information you would like from us.  Do you
have a question?  A suggestion for a change in behavior?  A bug report?

> a:
>     touch b
> b: a
> c: b
>     touch c

First, it's not valid in a makefile for a recipe to create a target
that is different from the one it told make it would create.  Here your
target lists "a" as the file it will create, but it really creates "b".
 Make cannot know that, so it has no way of knowing "b" is ever
modified.

Second, your "b: a" line does NOT create an empty recipe.  That's
simple a prerequisite definition, with no recipe (note that the manual
wants to make a distinction between no recipe at all, and a recipe that
exists but is empty: has no text in it).

To create an empty recipe in the meaning of the manual, you can write:

  b: a ;

By adding the semicolon you've created an empty recipe (much, much
better than a line with just a TAB in it).

Beyond that, I don't know what else to say.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]