Include common header with quick links.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Fri, 13 Jul 2012 22:32:19 +0300
changeset 17 c7017f58585c
parent 16 dacdabba767c
child 18 2454ae5af5cc
Include common header with quick links.
Makefile
--- a/Makefile	Fri Jul 13 22:02:58 2012 +0300
+++ b/Makefile	Fri Jul 13 22:32:19 2012 +0300
@@ -34,7 +34,7 @@
 ################################################################
 # Proj dirs/files.
 
-RST_FILES := $(wildcard *.rst)
+RST_FILES := $(filter-out HEADER.rst,$(wildcard *.rst))
 TXT_FILES := $(wildcard *.txt)
 
 HTML_DIR := tips-html
@@ -67,9 +67,18 @@
 .PHONY: html
 html: $(HTML_FILES) $(TXT__FILES)
 
-$(HTML_DIR)/%.html: %.rst rst.css $(MAKEFILE_LIST) | $(HTML_DIR)
+$(HTML_DIR)/%.html: %.rst HEADER.rst rst.css $(MAKEFILE_LIST) | $(HTML_DIR)
 	$(RST2HTML) $(RST_FLAGS) --stylesheet=rst.css $*.rst $@
 
+HEADER.rst: Makefile
+	{ \
+echo '.. _Home: frame.html'; \
+echo '.. _`Home (no frame)`: index.html'; \
+echo '.. _About: http://gavenkoa.users.sourceforge.net/'; \
+echo; \
+echo '[ Home_ | `Home (no frame)`_ | About_ ]'; \
+} >$@
+
 $(HTML_DIR)/frame-index.html: index.sh $(RST_HTML_FILES) $(MAKEFILE_LIST) | $(HTML_DIR)
 	./index.sh frame >$@
 
@@ -112,7 +121,7 @@
 
 .PHONY: clean
 clean:
-	rm -r -f $(DIRS)
+	rm -r -f $(DIRS) HEADER.rst
 
 ################################################################
 # Helper target.