Review comments; fail build if nits found

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2202)
diff --git a/.gitignore b/.gitignore
index 0a7edfc..bf4a9de 100644
--- a/.gitignore
+++ b/.gitignore
@@ -177,3 +177,4 @@
 
 # Windows manifest files
 *.manifest
+doc-nits
diff --git a/.travis.yml b/.travis.yml
index b6c8766..a60c402 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -29,9 +29,9 @@
     - gcc
 
 env:
-    - CONFIG_OPTS="" DESTDIR="_install" CHECKDOCS="yes"
+    - CONFIG_OPTS="" DESTDIR="_install"
     - CONFIG_OPTS="--debug no-shared enable-crypto-mdebug enable-rc5 enable-md2"
-    - CONFIG_OPTS="no-pic --strict-warnings" BUILDONLY="yes"
+    - CONFIG_OPTS="no-pic --strict-warnings" BUILDONLY="yes" CHECKDOCS="yes"
     - CONFIG_OPTS="no-engine no-shared --strict-warnings" BUILDONLY="yes"
     - CONFIG_OPTS="no-stdio --strict-warnings" BUILDONLY="yes"
 
diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl
index eefb50a..a2b197d 100644
--- a/Configurations/unix-Makefile.tmpl
+++ b/Configurations/unix-Makefile.tmpl
@@ -323,9 +323,6 @@
 
 uninstall_sw: uninstall_runtime uninstall_engines uninstall_dev
 
-doc-nits:
-	$(PERL) util/find-doc-nits.pl -n
-
 install_docs: install_man_docs install_html_docs
 
 uninstall_docs: uninstall_man_docs uninstall_html_docs
@@ -677,6 +674,10 @@
 generate: generate_apps generate_crypto_bn generate_crypto_objects \
           generate_crypto_conf generate_crypto_asn1
 
+doc-nits:
+	(cd $(SRCDIR); $(PERL) util/find-doc-nits.pl -n ) >doc-nits
+	if [ -s doc-nits ] ; then cat doc-nits; exit 1; fi
+
 # Test coverage is a good idea for the future
 #coverage: $(PROGRAMS) $(TESTPROGRAMS)
 #	...