title: Why does GNU make delete a file
body: <p>I've got a slightly hackish makefile for running tests:</p>
  
  <pre><code>### Run the tests
  
  tests := tests/test1 tests/test2 ...
  
  test: $(tests)
  
  $(tests): %: %.c
      gcc -o $@ $(testflags) $&lt;
      $@
  </code></pre>
  
  <p>It works, but it makes Make do something I've never seen it do before. My test is currently broken, and causes a bus error. Make gives the following output:</p>
  
  <pre><code>gcc -o tests/test1 [flags blah blah] tests/test1.c
  tests/test1
  make: *** [tests/test1] Bus error
  make: *** Deleting file `tests/test1'
  </code></pre>
  
  <p>I'm curious about the last line. I've never seen Make do that before. Why does Make delete the compiled test?</p>
  
  <p>Note: I edited this example pretty heavily to make it simpler. I might have introduced some mistakes.</p>