title: How can I make a pattern rule dependency optional in a Makefile?
body: <p>I would like make to reference the timestamp of a dependency <em>if and only if</em> the file already exists. I have a pattern rule like this:</p>
  
  <pre><code>%.pdf: %.sil
      sile $&lt; -o $@
  </code></pre>
  
  <p>This works great in normal situations, but the .sil file makes an external reference to a lua file of the same name if it exists. How do I make make aware of this so it checks the timestamps and regenerates the PDF if the lua file is newer but ignores the dependency if the file doesn't exist at all?</p>
  
  <p>This:</p>
  
  <pre><code>%.pdf: %.sil %.lua
      sile $&lt; -o $@
  </code></pre>
  
  <p>…only works for cases where the file exists and causes an error if it doesn't.</p>