diff Makefile.in @ 1670:eef792d31de8 SDL-1.3

Work in progress. :)
author Sam Lantinga <slouken@libsdl.org>
date Wed, 07 Jun 2006 16:10:28 +0000
parents cd3db072ba8a
children 75f2ace8511a
line wrap: on
line diff
--- 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