title: In Makefile, how to cleanup lockfile files?
body: <p>In GNU Make 3.81, I need to remove a lockfile in the event of an error in any part of the toolchain. Is there a special target that will allow me to do this? Do I need to write a wrapper script?</p>
  
  <p>In the example below, I need unlock_id to happen if the rule for file.out fails.</p>
  
  <p>Thanks!
  -Jeff</p>
  
  <pre><code>all: lock_id file.out unlock_id
  
  file.out: file.in
      file-maker &lt; file.in &gt; $@
  
  lock_id:
      lockfile file.lock
  
  unlock_id:
      rm -rf file.lock
  </code></pre>