Add warning flags to 'rst2html'.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Thu, 12 Jan 2012 23:18:00 +0200
changeset 107 4cfb94e11b5d
parent 106 092b25d032af
child 108 1f1363141da7
Add warning flags to 'rst2html'.
Makefile
--- a/Makefile	Thu Jan 12 23:04:59 2012 +0200
+++ b/Makefile	Thu Jan 12 23:18:00 2012 +0200
@@ -53,16 +53,25 @@
   ifneq '' '$(WINDIR)'
     # Probably under Windows.
     host_os = windows
+    ifneq '' '$(wildcard /etc/setup/*cygwin*)'
+      # Probably under Cygwin.
+      host_os = cygwin
+    endif
   endif
 endif
 
 ################################################################
-# Build tool definition/switches.
+# Build tools definition/switches.
+
+RST_WARNING_FLAGS := --halt warning
+RST_FLAGS := --strip-comments
+RST_FLAGS += $(RST_WARNING_FLAGS)
 
-RST2HTML = rst2html
-ifeq '$(host_os)' 'windows'
-  RST2HTML = rst2html.py
+RST2HTML := rst2html
+ifeq '$(host_os)' 'cygwin'
+  RST2HTML := rst2html.py
 endif
+RST2HTML_FLAGS := $(RST_FLAGS)
 
 ################################################################
 # Install paths.
@@ -80,6 +89,8 @@
 ################################################################
 # Project dirs/files.
 
+BUILD_SCRIPT := $(first-word $(MAKEFILE_LIST))
+
 C5_FILES := $(wildcard *.dict-c5)
 DICT_FILES := $(C5_FILES:.dict-c5=.dict)
 DICTDZ_FILES := $(C5_FILES:.dict-c5=.dict.dz)
@@ -174,7 +185,7 @@
 html: $(HTML_FILES)
 
 $(HTML_FILES): %.html: %.rst
-	$(RST2HTML) --stylesheet=rst.css $*.rst $@
+	$(RST2HTML) $(RST2HTML_FLAGS) --stylesheet=rst.css $*.rst $@
 
 ################################################################
 # Statistics targets.