title: Checking if file exists before removing it in makefile
body: <p>I have a makefile within a C++ project (compiler: C++11).  How can you check to see if a particular file exists before removing it with a makefile command?<br>
  Here is the code:</p>
  
  <pre><code>bin: charstack.h error.h
          g++ -Wall -std=c++11 main.cpp charstack.cpp error.cpp -o bin
  
  run:
          ./bin.exe
  
  clean:
          rm bin.exe
  
  # This statement removes auto generated backups on my system.
  cl:
          rm charstack.h~ charstack.cpp~ main.cpp~ makefile~ error.h~ error.cpp~
  </code></pre>
  
  <p>How would I have the makefile check to see whether the auto generated .~ backup files exist before attempting to remove them when the user passes</p>
  
  <pre><code>make cl
  </code></pre>
  
  <p>in the command line?  The goal here is to avoid outputting these errors to the terminal upon running "make cl":</p>
  
  <pre><code>rm: cannot remove `charstack.h~': No such file or directory
  rm: cannot remove `charstack.cpp~': No such file or directory
  rm: cannot remove `main.cpp~': No such file or directory
  rm: cannot remove `error.h~': No such file or directory
  rm: cannot remove `error.cpp~': No such file or directory
  make: *** [cl] Error 1
  </code></pre>