in reply to [OT] Makefiles - nmake syntax v dmake syntax
clean: rm -f glversion.txt glversion.exe glversion.o
The -f option tells rm (among other things) that it's not an error if some of the files don't exist. Maybe there's a similar option for del?
Another way is it let the command fail, and ignore the failure by prepending a dash to the command:
clean: - rm glversion.txt glversion.exe glversion.o
This way rm will fail if some of these files don't exist, but make will ignore that error. Again I don't know if the various make dialects understand that.
To me it seems overkill to both add the leading dash and have the if exists in the makefile.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: [OT] Makefiles - nmake syntax v dmake syntax
by Corion (Patriarch) on Jul 16, 2008 at 09:07 UTC |