title: Consider makefile out of date if include updated, only if it exists
body: <p>Consider the following Makefile which knows to clean and rebuild itself if the Makefile or its included configuration files <code>config.mk</code> or <code>local.mk</code> are changed:</p>
  
  <pre><code>include config.mk
  -include local.mk
  
  -include dummy.rebuild
  
  all: ...
  # other targets...
  
  # https://stackoverflow.com/a/3892826/149138
  dummy.rebuild: Makefile config.mk local.mk
      touch $@
      $(MAKE) -s clean
  </code></pre>
  
  <p>This works fine if <code>config.mk</code> and <code>local.mk</code> actually exist - if either is modified, the <code>dummy.rebuild</code> target fires and the project is rebuild.</p>
  
  <p>However, imagine that <code>local.mk</code> is an optional file which may or may not exist. In the case that it doesn't exist, the <code>dummy.rebuild</code> rule never seems to run at all, even if the Makefile or <code>config.mk</code> is changed. This is  different behavior than a normal rule where a dependency doesn't exist, usually you'd get an error like:</p>
  
  <pre><code>make: *** No rule to make target 'local.mk', needed by 'dummy.rebuild'.  Stop.
  </code></pre>
  
  <p>... but in the case of the <code>dummy.rebuild</code> target implicitly added as a target via inclusion, you just get:</p>
  
  <pre><code>make: Nothing to be done for 'all'.
  </code></pre>
  
  <p>How can I implement the makefile so that if any of <code>Makefile</code>, <code>config.mk</code> or <code>local.mk</code> are changed, the <code>dummy.rebuild</code> target is executed, where the <code>local.mk</code> file may not exist?</p>