diff --git a/Makefile.am b/Makefile.am index 84d1670036..f4f4d06f64 100644 --- a/Makefile.am +++ b/Makefile.am @@ -195,3 +195,13 @@ ChangeLog: NEWS $(XSLTPROC) --stringparam strip-prefix "gnucash/trunk" \ --stringparam include-rev "yes" $(srcdir)/macros/svn2cl.xsl - > $@ endif + +ASTYLE = /usr/bin/astyle +.PHONY: indent +indent: + $(ASTYLE) --indent=spaces=4 --brackets=break --suffix=none `find ${srcdir}/src -name '*.[hc]'` +# Use the following line if you've got astyle-1.24, but don't use +# --pad=oper with astyle 1.22 as it will reformat e.g. "return +1;" in +# a very ugly way. +# $(ASTYLE) --indent=spaces=4 --brackets=break --pad-oper -pad-header --suffix=none `find ${srcdir}/src -name '*.[hc]'` + @echo "### GnuCash development hint: The above command might have re-indented much more files than what you intended. Please commit only those which you really want to have changed, and revert the changes in the others so that other devevelopers do not have unnecessary merge conflicts. Thanks! ###"