equal
deleted
inserted
replaced
|
1 |
|
2 SHELL = /bin/sh |
|
3 |
|
4 # Disable built in pattern rules. |
|
5 MAKEFLAGS += -r |
|
6 # Disable built in variables. |
|
7 MAKEFLAGS += -R |
|
8 # Disable built in suffix rules. |
|
9 .SUFFIXES: |
|
10 # Default target. |
|
11 .DEFAULT_GOAL = all |
|
12 |
|
13 ################################################################ |
|
14 # Proj dirs/files. |
|
15 |
|
16 RST_FILES := $(wildcard *.rst) |
|
17 TXT_FILES := $(wildcard *.txt) |
|
18 |
|
19 HTML_DIR := tips-html |
|
20 HTML_FILES := $(patsubst %.rst,$(HTML_DIR)/%.html,$(RST_FILES)) $(HTML_DIR)/index.html $(HTML_DIR)/index-frame.html |
|
21 TXT__FILES := $(addprefix $(HTML_DIR)/,$(TXT_FILES)) |
|
22 |
|
23 DIRS := $(HTML_DIR) |
|
24 |
|
25 ################################################################ |
|
26 # Build targets. |
|
27 |
|
28 .PHONY: all |
|
29 all: |
|
30 |
|
31 .PHONY: html |
|
32 html: $(HTML_FILES) $(TXT__FILES) |
|
33 |
|
34 $(HTML_DIR)/%.html: %.rst | $(HTML_DIR) |
|
35 rst2html.py --stylesheet=rst.css $*.rst $@ |
|
36 |
|
37 $(HTML_DIR)/index.html: index.sh | $(HTML_DIR) |
|
38 ./index.sh >$@ |
|
39 |
|
40 $(HTML_DIR)/%.html: %.html | $(HTML_DIR) |
|
41 cp $< $@ |
|
42 |
|
43 $(HTML_DIR)/%.txt: %.txt | $(HTML_DIR) |
|
44 cp $< $@ |
|
45 |
|
46 ################################################################ |
|
47 # Init targets. |
|
48 |
|
49 $(DIRS): |
|
50 mkdir -p $@ |
|
51 |
|
52 ################################################################ |
|
53 # Clean targets. |
|
54 |
|
55 .PHONY: distclean |
|
56 distclean: clean |
|
57 |
|
58 .PHONY: clean |
|
59 clean: |
|
60 rm -r -f $(DIRS) |
|
61 |
|
62 |