bug-make
[Top][All Lists]
Advanced

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

Re: 'withfile' function implementation


From: David Boyce
Subject: Re: 'withfile' function implementation
Date: Mon, 16 Jan 2012 08:55:29 -0500

2012/1/16 Paul Smith <address@hidden>:
>     2. Unclear what to do about newlines.  The code doesn't add any but
>        getting a newline into a make variable is tricky.

Is it possible https://savannah.gnu.org/bugs/?35063 would help here? I
think it's a simple, robust, helpful extension (but I would).

> '>>' : Open the file with mode "a" (append) and write the second
> argument to the file, plus a newline.  If no second argument is given,
> nothing is written (if the file didn't exist it will be created but
> empty; if the file did exist it will be unchanged).

Would it make sense to guarantee timestamp update even with an empty
second argument? Reasons in favor:

- Make is inherently timestamp based and clear rules are important. It
could create a new class of mysterious, hard-to-reproduce bugs if this
function sometimes updates the file and other times not.
- Something like  $(info touch address@hidden(file >>$@)) could become an
efficient, portable, in-process pattern for "touching" a file.

> Do people think this would be useable?

Looks good to me.

-David Boyce



reply via email to

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