----- Original Message ----- 
"Paul D. Smith" <[EMAIL PROTECTED]> writes:
> %% gk <[EMAIL PROTECTED]> writes:
>
>   g> I have discovered a behavior that seems a bit odd; would appreciate
>   g> thoughts on this:
>   g> * a rule with prerequisite file that doesn't exist: 'afile'
>   g> * an empty rule for 'afile'
>   g> => target is never considered 'up to date'
>
> Yes.

>   g> I want the prerequisite file to affect building target, only if it
>   g> exists; otherwise target should be considered up to date.
>   g> How best to achieve this?
>
> You can't.

Excuse me for jumping in a month late on this message but wouldn't something
like this work:

target: $(if $(wildcard possible-prereq),possible-prereq)
        actions...

That is, if the file possible-prereq exists, include it as a prerequisite,
otherwise omit the file.  It seems like this does what gk wants.  Or have I
misunderstood something?

Cheers,
Robert



_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make

Reply via email to