Thanks, Paul. One of those should fit the bill.
Paul Smith wrote:
> On Mon, 2008-03-03 at 17:55 +0000, Brendan Heading
wrote:
>> Is there a way for me to get make to rebuild a
target only if it does
>> not exist, and not merely when it's timestamp is
updated ?
>
> You could do something like:
>
> foo : $(if $(wildcard somefile),,somefile)
>
> The $(if ...) will expand to empty if somefile exists,
and "somefile" if
> it doesn't. This isn't quite the same as you asked for
because it
> requires changing the rules that depend on the target,
rather than just
> the target itself.
>
>> The example that I have in mind is that a certain
file requires that a
>> certain directory exists; however, during the make,
other files are
>> added to that same directory meaning that it's
timestamp is updated.
>> Make then tries to remake the file even though the
directory already
>> existed.
>
> This is typically handled using order-only
prerequisites, and declaring
> the directory as .PHONY. See the GNU make manual.
>
_______________________________________________
Help-make mailing list
Help-make gnu.org
http:
//lists.gnu.org/mailman/listinfo/help-make
|