0

I want to write a makefile that has a build rule, a run rule and a clean (delete the exe file) rule . This is quite a simple task, but how can one incorporate some rule in the makefile such that the executable is only created if it doesn't already exist ?

user43389
  • 643
  • 1
    Your question is quite broad you can probably accomplish this several ways [ -e file ] || make ... Post your file if you need help. – Panther Jan 26 '15 at 17:47

1 Answers1

0

If your build rule depends on the source needed to create the executable, then it will automatically only do the build process if the executable is not present (or any source files have modification time newer than the existing executable). So unless I'm missing something, you don't need anything special to make this happen.

roadmr
  • 34,222
  • 9
  • 81
  • 93