Makefile
changeset 17 c7017f58585c
parent 16 dacdabba767c
child 18 2454ae5af5cc
equal deleted inserted replaced
16:dacdabba767c 17:c7017f58585c
    32 RST_FLAGS += $(RST_WARNING_FLAGS)
    32 RST_FLAGS += $(RST_WARNING_FLAGS)
    33 
    33 
    34 ################################################################
    34 ################################################################
    35 # Proj dirs/files.
    35 # Proj dirs/files.
    36 
    36 
    37 RST_FILES := $(wildcard *.rst)
    37 RST_FILES := $(filter-out HEADER.rst,$(wildcard *.rst))
    38 TXT_FILES := $(wildcard *.txt)
    38 TXT_FILES := $(wildcard *.txt)
    39 
    39 
    40 HTML_DIR := tips-html
    40 HTML_DIR := tips-html
    41 RST_HTML_FILES := $(patsubst %.rst,$(HTML_DIR)/%.html,$(RST_FILES))
    41 RST_HTML_FILES := $(patsubst %.rst,$(HTML_DIR)/%.html,$(RST_FILES))
    42 HTML_FILES := $(RST_HTML_FILES) \
    42 HTML_FILES := $(RST_HTML_FILES) \
    65 all:
    65 all:
    66 
    66 
    67 .PHONY: html
    67 .PHONY: html
    68 html: $(HTML_FILES) $(TXT__FILES)
    68 html: $(HTML_FILES) $(TXT__FILES)
    69 
    69 
    70 $(HTML_DIR)/%.html: %.rst rst.css $(MAKEFILE_LIST) | $(HTML_DIR)
    70 $(HTML_DIR)/%.html: %.rst HEADER.rst rst.css $(MAKEFILE_LIST) | $(HTML_DIR)
    71 	$(RST2HTML) $(RST_FLAGS) --stylesheet=rst.css $*.rst $@
    71 	$(RST2HTML) $(RST_FLAGS) --stylesheet=rst.css $*.rst $@
       
    72 
       
    73 HEADER.rst: Makefile
       
    74 	{ \
       
    75 echo '.. _Home: frame.html'; \
       
    76 echo '.. _`Home (no frame)`: index.html'; \
       
    77 echo '.. _About: http://gavenkoa.users.sourceforge.net/'; \
       
    78 echo; \
       
    79 echo '[ Home_ | `Home (no frame)`_ | About_ ]'; \
       
    80 } >$@
    72 
    81 
    73 $(HTML_DIR)/frame-index.html: index.sh $(RST_HTML_FILES) $(MAKEFILE_LIST) | $(HTML_DIR)
    82 $(HTML_DIR)/frame-index.html: index.sh $(RST_HTML_FILES) $(MAKEFILE_LIST) | $(HTML_DIR)
    74 	./index.sh frame >$@
    83 	./index.sh frame >$@
    75 
    84 
    76 $(HTML_DIR)/index.html: index.sh $(RST_HTML_FILES) $(MAKEFILE_LIST) | $(HTML_DIR)
    85 $(HTML_DIR)/index.html: index.sh $(RST_HTML_FILES) $(MAKEFILE_LIST) | $(HTML_DIR)
   110 .PHONY: distclean
   119 .PHONY: distclean
   111 distclean: clean
   120 distclean: clean
   112 
   121 
   113 .PHONY: clean
   122 .PHONY: clean
   114 clean:
   123 clean:
   115 	rm -r -f $(DIRS)
   124 	rm -r -f $(DIRS) HEADER.rst
   116 
   125 
   117 ################################################################
   126 ################################################################
   118 # Helper target.
   127 # Helper target.
   119 
   128 
   120 help:
   129 help: