]> granicus.if.org Git - curl/commitdiff
make: add 'checksrc' as target to check code style
authorDaniel Stenberg <daniel@haxx.se>
Wed, 27 Apr 2011 08:23:27 +0000 (10:23 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 27 Apr 2011 08:23:27 +0000 (10:23 +0200)
The make target checksrc now works in the root makefile and in both the
src and lib directories.

It is also run automatically on "all" if configure --enable-debug was
used.

Makefile.am
lib/Makefile.am
src/Makefile.am

index e562010002de48c4e7de6ea6438e08f634889d09..177b0ea618402cb5033e2443a3f78184ee352490 100644 (file)
@@ -155,3 +155,7 @@ ca-bundle: lib/mk-ca-bundle.pl
 ca-firefox: lib/firefox-db2pem.sh
        @echo "generate a fresh ca-bundle.crt"
        ./lib/firefox-db2pem.sh lib/ca-bundle.crt
+
+checksrc:
+       cd lib && $(MAKE) checksrc
+       cd src && $(MAKE) checksrc
index 0e80f5e1858f1ec8c39cb1e925a4f04b8594f613..fa6b846ad2a5e332a367fc8bb065bcd1d3ac6e43 100644 (file)
@@ -185,9 +185,11 @@ $(VCPROJ): vc8proj.head vc8proj.foot Makefile.am
        done; \
        cat $(srcdir)/vc8proj.foot $(VCPROJOUT) )
 
+
+checksrc:
+       @@PERL@ $(top_srcdir)/lib/checksrc.pl -D$(top_srcdir)/lib $(CSOURCES) $(HHEADERS)
+
 if CURLDEBUG
 # for debug builds, we scan the sources on all regular make invokes
-all-local:
-       @@PERL@ $(top_srcdir)/lib/checksrc.pl -D$(top_srcdir)/lib $(CSOURCES) $(HHEADERS)
+all-local: checksrc
 endif
-
index c1915f7f77f8f4922d3029cba3fc3487bc4d3ca4..d697e78ea32c6189a423a71f2e634e4756fca43e 100644 (file)
@@ -96,10 +96,12 @@ $(HUGE):
        echo "void hugehelp(void) {}" >>$(HUGE)
 endif
 
-if CURLDEBUG
-# for debug builds, we scan the sources on all regular make invokes
 # ignore hugehelp.c since it is generated source code and it plays by slightly
 # different rules!
-all-local:
+checksrc:
        @@PERL@ $(top_srcdir)/lib/checksrc.pl -D$(top_srcdir)/src -Whugehelp.c $(curl_SOURCES)
+
+if CURLDEBUG
+# for debug builds, we scan the sources on all regular make invokes
+all-local: checksrc
 endif