Makefile
changeset 84 898facea8832
parent 83 41a9c64f3fb7
child 86 592ad4c25644
equal deleted inserted replaced
83:41a9c64f3fb7 84:898facea8832
    43 RST_FILES := $(wildcard *.rst)
    43 RST_FILES := $(wildcard *.rst)
    44 
    44 
    45 HTML_DIR := tips-html
    45 HTML_DIR := tips-html
    46 RST_HTML_FILES := $(patsubst %.rst,$(HTML_DIR)/%.html,$(RST_FILES))
    46 RST_HTML_FILES := $(patsubst %.rst,$(HTML_DIR)/%.html,$(RST_FILES))
    47 HTML_FILES := $(RST_HTML_FILES)
    47 HTML_FILES := $(RST_HTML_FILES)
    48 
       
    49 CHM_FILES := $(addprefix $(HTML_DIR)/,chm.hhp chm.hhc chm.stp)
       
    50 
    48 
    51 DIRS := $(HTML_DIR)
    49 DIRS := $(HTML_DIR)
    52 
    50 
    53 ################################################################
    51 ################################################################
    54 # Deploy targets.
    52 # Deploy targets.
   104 $(HTML_DIR)/%.html: %.rst www/rst.css www/rst-multi.css $(HTML_DIR)/rst.tmpl $(MAKEFILE_LIST) | $(HTML_DIR)
   102 $(HTML_DIR)/%.html: %.rst www/rst.css www/rst-multi.css $(HTML_DIR)/rst.tmpl $(MAKEFILE_LIST) | $(HTML_DIR)
   105 	$(RST2HTML) $(RST_FLAGS) --stylesheet=www/rst.css,www/rst-multi.css --template=$(HTML_DIR)/rst.tmpl $*.rst $@
   103 	$(RST2HTML) $(RST_FLAGS) --stylesheet=www/rst.css,www/rst-multi.css --template=$(HTML_DIR)/rst.tmpl $*.rst $@
   106 
   104 
   107 $(HTML_DIR)/rst.tmpl: www/rst.tmpl $(MAKEFILE_LIST) | $(HTML_DIR)
   105 $(HTML_DIR)/rst.tmpl: www/rst.tmpl $(MAKEFILE_LIST) | $(HTML_DIR)
   108 	sed -e "s|{date}|$$(date +%F)|" -e "s|{rev}|$$(hg id -i)|"  <$< >$@
   106 	sed -e "s|{date}|$$(date +%F)|" -e "s|{rev}|$$(hg id -i)|"  <$< >$@
   109 
       
   110 .PHONY: chm
       
   111 chm: html $(CHM_FILES) $(HTML_DIR)/iframe.html
       
   112 	cd $(HTML_DIR); for file in *.html; do sed -i '/<\?xml.*\?>/d' $$file; done
       
   113 
       
   114 $(HTML_DIR)/%.stp: misc/%.stp $(MAKEFILE_LIST) | $(HTML_DIR)
       
   115 	cp $< $@
       
   116 
       
   117 $(HTML_DIR)/chm.hhp: misc/chm-hhp.sh $(MAKEFILE_LIST) | $(HTML_DIR)
       
   118 	./$<  >$@
       
   119 
       
   120 $(HTML_DIR)/chm.hhc: misc/chm-hhc.sh $(MAKEFILE_LIST) | $(HTML_DIR)
       
   121 	./$<  >$@
       
   122 
   107 
   123 .PHONY: single-html
   108 .PHONY: single-html
   124 single-html: $(HTML_DIR)/single.html
   109 single-html: $(HTML_DIR)/single.html
   125 
   110 
   126 $(HTML_DIR)/single.html: $(HTML_DIR)/single.rest www/rst.css www/rst-single.css $(RST_FILES)
   111 $(HTML_DIR)/single.html: $(HTML_DIR)/single.rest www/rst.css www/rst-single.css $(RST_FILES)