# HG changeset patch # User Oleksandr Gavenko # Date 1311154649 -10800 # Node ID 6ee132e4cd5f3ff16c0d5088fd314d429cec4b69 Build html version of tips. diff -r 000000000000 -r 6ee132e4cd5f Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Makefile Wed Jul 20 12:37:29 2011 +0300 @@ -0,0 +1,62 @@ + +SHELL = /bin/sh + +# Disable built in pattern rules. +MAKEFLAGS += -r +# Disable built in variables. +MAKEFLAGS += -R +# Disable built in suffix rules. +.SUFFIXES: +# Default target. +.DEFAULT_GOAL = all + +################################################################ +# Proj dirs/files. + +RST_FILES := $(wildcard *.rst) +TXT_FILES := $(wildcard *.txt) + +HTML_DIR := tips-html +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)) + +DIRS := $(HTML_DIR) + +################################################################ +# Build targets. + +.PHONY: all +all: + +.PHONY: html +html: $(HTML_FILES) $(TXT__FILES) + +$(HTML_DIR)/%.html: %.rst | $(HTML_DIR) + rst2html.py --stylesheet=rst.css $*.rst $@ + +$(HTML_DIR)/index.html: index.sh | $(HTML_DIR) + ./index.sh >$@ + +$(HTML_DIR)/%.html: %.html | $(HTML_DIR) + cp $< $@ + +$(HTML_DIR)/%.txt: %.txt | $(HTML_DIR) + cp $< $@ + +################################################################ +# Init targets. + +$(DIRS): + mkdir -p $@ + +################################################################ +# Clean targets. + +.PHONY: distclean +distclean: clean + +.PHONY: clean +clean: + rm -r -f $(DIRS) + +