Makefile
changeset 1 fd4cd9134e53
parent 0 6ee132e4cd5f
child 2 ee2c7334966e
--- a/Makefile	Wed Jul 20 12:37:29 2011 +0300
+++ b/Makefile	Wed Jul 20 14:10:15 2011 +0300
@@ -20,6 +20,8 @@
 HTML_FILES := $(patsubst %.rst,$(HTML_DIR)/%.html,$(RST_FILES)) $(HTML_DIR)/index.html $(HTML_DIR)/index-frame.html
 TXT__FILES := $(addprefix $(HTML_DIR)/,$(TXT_FILES))
 
+CHM_FILES := $(addprefix $(HTML_DIR)/,chm.hhp chm.hhc chm.stp)
+
 DIRS := $(HTML_DIR)
 
 ################################################################
@@ -35,7 +37,7 @@
 	rst2html.py --stylesheet=rst.css $*.rst $@
 
 $(HTML_DIR)/index.html: index.sh | $(HTML_DIR)
-	./index.sh >$@
+	./index.sh frame >$@
 
 $(HTML_DIR)/%.html: %.html | $(HTML_DIR)
 	cp $< $@
@@ -43,6 +45,22 @@
 $(HTML_DIR)/%.txt: %.txt | $(HTML_DIR)
 	cp $< $@
 
+.PHONY: chm
+chm: html $(CHM_FILES) $(HTML_DIR)/index-chm.html
+	cd $(HTML_DIR); for file in *.html; do sed -i '/<\?xml.*\?>/d' $$file; done
+
+$(HTML_DIR)/%.stp: %.stp | $(HTML_DIR)
+	cp $< $@
+
+$(HTML_DIR)/chm.hhp: chm-hhp.sh | $(HTML_DIR)
+	./chm-hhp.sh >$@
+
+$(HTML_DIR)/chm.hhc: chm-hhc.sh | $(HTML_DIR)
+	./chm-hhc.sh >$@
+
+$(HTML_DIR)/index-chm.html: index.sh | $(HTML_DIR)
+	./index.sh chm >$@
+
 ################################################################
 # Init targets.