Makefile.in
branchSDL-1.3
changeset 1670 eef792d31de8
parent 1664 cd3db072ba8a
child 1692 75f2ace8511a
--- a/Makefile.in	Mon May 29 05:08:33 2006 +0000
+++ b/Makefile.in	Wed Jun 07 16:10:28 2006 +0000
@@ -125,14 +125,6 @@
 	    rm -f $(mandir)/man3/$$file; \
 	done
 
-indent:
-	cd $(srcdir) && \
-	find . \( \
-	    -name '*.h' -o \
-	    -name '*.c' -o \
-	    -name '*.cc' \) \
-	    -exec indent {} \;
-
 clean:
 	rm -rf $(objects)
 	if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
@@ -173,6 +165,29 @@
 rpm: $(distfile)
 	rpmbuild -ta $?
 
+# Run indent on the source to standardize coding style
+indent:
+	@echo "Running indent... modified files:"
+	@cd $(srcdir) && \
+	find . \( \
+	    -name '*.h' -o \
+	    -name '*.c' -o \
+	    -name '*.cc' \) \
+	    -print | \
+	while read file; do \
+	    indent "$$file" -o "$$file.indent"; \
+	    if cmp "$$file" "$$file.indent" >/dev/null; then \
+	        rm -f "$$file.indent"; \
+	    else \
+	        echo "$$file"; \
+	        mv -f "$$file.indent" "$$file"; \
+	    fi; \
+	done
+
+# Run indent and then commit modified files
+commit: indent
+	svn commit
+
 # Create a SVN snapshot that people can run update on
 snapshot:
 	svn co svn://libsdl.org/trunk/SDL