Revision: 1739
http://nagios.svn.sourceforge.net/nagios/?rev=1739&view=rev
Author: ageric
Date: 2011-05-31 13:10:22 +0000 (Tue, 31 May 2011)
Log Message:
-----------
Add a make-target to indent all sources
Using astyle + find, this implements the style discussed in the
thread at http://comments.gmane.org/gmane.network.nagios.devel/7683
which is sort of what we agreed on at the first (very informal)
Nagios core dev conference in Sweden in 2008.
"make indent" or "make pretty" should enforce the rules to all
sources located in the checked out tree. It's probably wise to
run it after applying a patch and recommend patch submitters to
run it before creating their patches. The fact that it's a
readily available make target makes it quite simple to add janitor
commits, re-fixing any broken indentation every once in a while
though.
Signed-off-by: Andreas Ericsson <ae@...>
Modified Paths:
--------------
nagioscore/trunk/Makefile.in
Modified: nagioscore/trunk/Makefile.in
===================================================================
--- nagioscore/trunk/Makefile.in 2011-05-31 13:10:03 UTC (rev 1738)
+++ nagioscore/trunk/Makefile.in 2011-05-31 13:10:22 UTC (rev 1739)
@@ -60,6 +60,12 @@
# FreeBSD make does not support -C option, so we'll use the Apache style... (patch by Stanley Hopcroft 12/27/1999)
+pretty: indent
+
+indent:
+ @astyle --indent=tab --unpad-paren --pad-oper --pad-header --suffix=none \
+ --brackets=linux $$(find . -type f -name "*.[ch]")
+
all:
cd $(SRC_BASE) && $(MAKE)
cd $(SRC_CGI) && $(MAKE)
@@ -362,3 +368,6 @@
pkgclean:
rm -rf pkg Prototype nagios.SPARC.pkg.tar.gz
+
+# Targets that always get built
+.PHONY: indent clean clean distclean
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|