Makefile: Little Improvements
authorMarkus Bröker <mbroeker@largo.dyndns.tv>
Thu, 16 Apr 2009 12:50:39 +0200
changeset 71 9ac5a589211e
parent 70 ded389a5dc2a
child 72 4103c76d5bf2
Makefile: Little Improvements * not all platforms have gnu find * not all platforms have rm The user may adjust the settings in the header of the makefile committer: Markus Bröker <mbroeker@largo.homelinux.org>
Makefile
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,9 @@
      CC = gcc -g -ggdb $(PROF)
     CPP = g++ -g -ggdb $(PROF)
  CFLAGS = -Wall -O2 -Iinclude -ansi
+     RM = rm -f
+   FIND = find
+
 ifeq ("$(PROFILING)", "linux")
    PROF = -fprofile-arcs -ftest-coverage -pg
 endif
@@ -301,16 +304,20 @@
 .PHONY: beauty clean uninstall
 
 clean:
-	find -name '*~' -exec rm -f {} \;
-	find -name '*.[oa]' -exec rm -f {} \;
-	find -name '*.gcov' -exec rm -f {} \;
-	find -name '*.gcda' -exec rm -f {} \;
-	find -name '*.gcno' -exec rm -f {} \;
-	find -name 'gmon.out' -exec rm -f {} \;
-	rm -f $(TARGET)
+ifdef FIND
+	$(FIND) -name '*~' -exec $(RM) {} \;
+	$(FIND) -name '*.[oa]' -exec $(RM) {} \;
+	$(FIND) -name '*.gcov' -exec $(RM) {} \;
+	$(FIND) -name '*.gcda' -exec $(RM) {} \;
+	$(FIND) -name '*.gcno' -exec $(RM) {} \;
+	$(FIND) -name 'gmon.out' -exec $(RM) {} \;
+endif
+	$(RM) $(TARGET)
 
 beauty:
-	find -name '*.[ch]' -exec indent {} \;
-	find -name '*.[ch]' -exec eraser {} \;
-	find -name 'Makefile*' -exec eraser {} \;
+ifdef FIND
+	$(FIND) -name '*.[ch]' -exec indent {} \;
+	$(FIND) -name '*.[ch]' -exec eraser {} \;
+	$(FIND) -name 'Makefile*' -exec eraser {} \;
+endif
 	@make clean