Question about makefiles
How could I make a command that would remove all the executables in the current directory without listing all of the executables explicitly?
|
Two ways come to mind. The first is not a Makefile-ish style:
Code:
find . -type f -perm +111 -maxdepth 1 -exec rm -f {} \; The second would be more in line with Makefile standards/form/guidelines. Create a TARGETS variable or something like that. Put in the explicit list of executable to delete in that variable. Then do an "rm $(TARGETS)" later. Depending on your setup, you might be able to do clever things such as automatic extension swapping. What I mean is, I've seen some Makefiles store all the object files into an OBJS variable, and then create a TARGETS (or similarly named variable) by using a Makefile syntax that dropped the ".o" extension from the OBJS variable. I'm no Makefile expert and can't tell you what the syntax is, but I know it's possible. |
Thanks a bunch, I will give it a try.
|
All times are GMT -5. The time now is 03:48 PM. |