author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Sat, 08 Sep 2012 18:48:53 +0300 | |
changeset 40 | 1c030a906e58 |
parent 39 | fb55f2e84db1 |
child 44 | e7fc05196363 |
permissions | -rw-r--r-- |
0
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
1 |
SHELL = /bin/sh |
3
194bc8d6504a
Add work-around for PATH. Under Windows find.exe going in collision with
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2
diff
changeset
|
2 |
export PATH := /bin:/usr/bin:${PATH} |
0
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
3 |
|
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
4 |
# Disable built in pattern rules. |
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
5 |
MAKEFLAGS += -r |
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
6 |
# Disable built in variables. |
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
7 |
MAKEFLAGS += -R |
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
8 |
# Disable built in suffix rules. |
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
9 |
.SUFFIXES: |
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
10 |
# Default target. |
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
11 |
.DEFAULT_GOAL = all |
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
12 |
|
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
13 |
################################################################ |
7 | 14 |
# Platform definition. |
15 |
||
16 |
host_os := linux |
|
17 |
ifneq '' '$(WINDIR)' |
|
18 |
host_os := cygwin |
|
19 |
endif |
|
20 |
target_os := $(host_os) |
|
21 |
||
22 |
################################################################ |
|
23 |
# Build tool definition/switches. |
|
24 |
||
12 | 25 |
RST2HTML := rst2html |
7 | 26 |
ifeq '$(host_os)' 'cygwin' |
12 | 27 |
RST2HTML := rst2html.py |
7 | 28 |
endif |
29 |
||
11
00d3a2f1f32b
Add warning flag for RST utils.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
10
diff
changeset
|
30 |
RST_WARNING_FLAGS := --halt warning |
00d3a2f1f32b
Add warning flag for RST utils.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
10
diff
changeset
|
31 |
RST_FLAGS := --strip-comments |
00d3a2f1f32b
Add warning flag for RST utils.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
10
diff
changeset
|
32 |
RST_FLAGS += $(RST_WARNING_FLAGS) |
00d3a2f1f32b
Add warning flag for RST utils.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
10
diff
changeset
|
33 |
|
7 | 34 |
################################################################ |
0
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
35 |
# Proj dirs/files. |
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
36 |
|
17
c7017f58585c
Include common header with quick links.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
16
diff
changeset
|
37 |
RST_FILES := $(filter-out HEADER.rst,$(wildcard *.rst)) |
0
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
38 |
TXT_FILES := $(wildcard *.txt) |
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
39 |
|
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
40 |
HTML_DIR := tips-html |
8 | 41 |
RST_HTML_FILES := $(patsubst %.rst,$(HTML_DIR)/%.html,$(RST_FILES)) |
10 | 42 |
HTML_FILES := $(RST_HTML_FILES) \ |
9
f40912333875
Generate index.html without "target=article" so links open in current browser tab.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
8
diff
changeset
|
43 |
$(HTML_DIR)/index.html $(HTML_DIR)/frame.html $(HTML_DIR)/frame-index.html |
0
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
44 |
TXT__FILES := $(addprefix $(HTML_DIR)/,$(TXT_FILES)) |
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
45 |
|
1
fd4cd9134e53
Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
46 |
CHM_FILES := $(addprefix $(HTML_DIR)/,chm.hhp chm.hhc chm.stp) |
fd4cd9134e53
Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
47 |
|
0
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
48 |
DIRS := $(HTML_DIR) |
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
49 |
|
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
50 |
################################################################ |
14
a36529d7dc2b
Add 'deploy2sourceforge' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
13
diff
changeset
|
51 |
# Deploy targets. |
a36529d7dc2b
Add 'deploy2sourceforge' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
13
diff
changeset
|
52 |
|
22
a2914ae81c6d
Update build info for deploy targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
21
diff
changeset
|
53 |
ifneq '' '$(filter deploy%,$(MAKECMDGOALS))' |
a2914ae81c6d
Update build info for deploy targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
21
diff
changeset
|
54 |
$(shell rm -f HEADER.rst) |
a2914ae81c6d
Update build info for deploy targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
21
diff
changeset
|
55 |
endif |
a2914ae81c6d
Update build info for deploy targets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
21
diff
changeset
|
56 |
|
14
a36529d7dc2b
Add 'deploy2sourceforge' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
13
diff
changeset
|
57 |
.PHONY: deploy |
36
7fb39a216cef
Push sources on 'deploy' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
35
diff
changeset
|
58 |
deploy: deploy2sf-web deploy2sf-hg |
14
a36529d7dc2b
Add 'deploy2sourceforge' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
13
diff
changeset
|
59 |
|
15
390e45e1fcc3
Will be accessible via.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
14
diff
changeset
|
60 |
# Will be accessible via: http://gavenkoa.users.sourceforge.net/tips-html/frame.html |
36
7fb39a216cef
Push sources on 'deploy' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
35
diff
changeset
|
61 |
.PHONY: deploy2sf-web |
40
1c030a906e58
Fix typo in target name.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
39
diff
changeset
|
62 |
deploy2sf-web: html |
14
a36529d7dc2b
Add 'deploy2sourceforge' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
13
diff
changeset
|
63 |
rsync --delete -avP -e ssh tips-html/ gavenkoa@frs.sourceforge.net:/home/user-web/g/ga/gavenkoa/htdocs/tips-html/ |
a36529d7dc2b
Add 'deploy2sourceforge' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
13
diff
changeset
|
64 |
|
36
7fb39a216cef
Push sources on 'deploy' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
35
diff
changeset
|
65 |
.PHONY: deploy2sf-hg |
7fb39a216cef
Push sources on 'deploy' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
35
diff
changeset
|
66 |
deploy2sf-hg: |
39
fb55f2e84db1
If 'hg' found no changes it report error code 1. Ignore them as it is valid.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
36
diff
changeset
|
67 |
hg push ssh://gavenkoa@hg.code.sf.net/u/gavenkoa/tips || [ $$? = 1 ] |
36
7fb39a216cef
Push sources on 'deploy' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
35
diff
changeset
|
68 |
|
14
a36529d7dc2b
Add 'deploy2sourceforge' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
13
diff
changeset
|
69 |
################################################################ |
0
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
70 |
# Build targets. |
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
71 |
|
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
72 |
.PHONY: all |
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
73 |
all: |
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
74 |
|
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
75 |
.PHONY: html |
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
76 |
html: $(HTML_FILES) $(TXT__FILES) |
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
77 |
|
17
c7017f58585c
Include common header with quick links.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
16
diff
changeset
|
78 |
$(HTML_DIR)/%.html: %.rst HEADER.rst rst.css $(MAKEFILE_LIST) | $(HTML_DIR) |
11
00d3a2f1f32b
Add warning flag for RST utils.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
10
diff
changeset
|
79 |
$(RST2HTML) $(RST_FLAGS) --stylesheet=rst.css $*.rst $@ |
0
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
80 |
|
17
c7017f58585c
Include common header with quick links.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
16
diff
changeset
|
81 |
HEADER.rst: Makefile |
c7017f58585c
Include common header with quick links.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
16
diff
changeset
|
82 |
{ \ |
20 | 83 |
echo '.. _`Home`: index.html'; \ |
21 | 84 |
echo '.. _About: README.html'; \ |
85 |
echo '.. _`About author`: http://gavenkoa.users.sourceforge.net/'; \ |
|
18
2454ae5af5cc
Add About and Licence statements.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
17
diff
changeset
|
86 |
echo '.. _Licence: README.html#tips-licence'; \ |
2454ae5af5cc
Add About and Licence statements.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
17
diff
changeset
|
87 |
echo '.. _`Contact`: gavenkoa@gmail.com'; \ |
17
c7017f58585c
Include common header with quick links.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
16
diff
changeset
|
88 |
echo; \ |
21 | 89 |
echo '[ Home_ | About_ | Licence_ | `About author`_ | `Contact`_ ]'; \ |
19
be271bde35fa
Sign each document with author name and build info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
18
diff
changeset
|
90 |
echo; \ |
21 | 91 |
echo 'Written by Oleksandr Gavenko (AKA gavenkoa), compiled at ``'`date +%F`'`` from rev ``'`hg id -i`'``.'; \ |
17
c7017f58585c
Include common header with quick links.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
16
diff
changeset
|
92 |
} >$@ |
c7017f58585c
Include common header with quick links.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
16
diff
changeset
|
93 |
|
13
245100f28fc0
Add dependency on build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
12
diff
changeset
|
94 |
$(HTML_DIR)/frame-index.html: index.sh $(RST_HTML_FILES) $(MAKEFILE_LIST) | $(HTML_DIR) |
9
f40912333875
Generate index.html without "target=article" so links open in current browser tab.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
8
diff
changeset
|
95 |
./index.sh frame >$@ |
f40912333875
Generate index.html without "target=article" so links open in current browser tab.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
8
diff
changeset
|
96 |
|
13
245100f28fc0
Add dependency on build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
12
diff
changeset
|
97 |
$(HTML_DIR)/index.html: index.sh $(RST_HTML_FILES) $(MAKEFILE_LIST) | $(HTML_DIR) |
9
f40912333875
Generate index.html without "target=article" so links open in current browser tab.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
8
diff
changeset
|
98 |
./index.sh html >$@ |
0
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
99 |
|
13
245100f28fc0
Add dependency on build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
12
diff
changeset
|
100 |
$(HTML_DIR)/%.html: %.html $(MAKEFILE_LIST) | $(HTML_DIR) |
0
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
101 |
cp $< $@ |
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
102 |
|
13
245100f28fc0
Add dependency on build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
12
diff
changeset
|
103 |
$(HTML_DIR)/%.txt: %.txt $(MAKEFILE_LIST) | $(HTML_DIR) |
0
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
104 |
cp $< $@ |
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
105 |
|
1
fd4cd9134e53
Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
106 |
.PHONY: chm |
fd4cd9134e53
Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
107 |
chm: html $(CHM_FILES) $(HTML_DIR)/index-chm.html |
fd4cd9134e53
Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
108 |
cd $(HTML_DIR); for file in *.html; do sed -i '/<\?xml.*\?>/d' $$file; done |
fd4cd9134e53
Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
109 |
|
13
245100f28fc0
Add dependency on build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
12
diff
changeset
|
110 |
$(HTML_DIR)/%.stp: %.stp $(MAKEFILE_LIST) | $(HTML_DIR) |
1
fd4cd9134e53
Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
111 |
cp $< $@ |
fd4cd9134e53
Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
112 |
|
13
245100f28fc0
Add dependency on build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
12
diff
changeset
|
113 |
$(HTML_DIR)/chm.hhp: chm-hhp.sh $(MAKEFILE_LIST) | $(HTML_DIR) |
1
fd4cd9134e53
Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
114 |
./chm-hhp.sh >$@ |
fd4cd9134e53
Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
115 |
|
13
245100f28fc0
Add dependency on build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
12
diff
changeset
|
116 |
$(HTML_DIR)/chm.hhc: chm-hhc.sh $(MAKEFILE_LIST) | $(HTML_DIR) |
1
fd4cd9134e53
Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
117 |
./chm-hhc.sh >$@ |
fd4cd9134e53
Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
118 |
|
13
245100f28fc0
Add dependency on build script.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
12
diff
changeset
|
119 |
$(HTML_DIR)/index-chm.html: index.sh $(MAKEFILE_LIST) | $(HTML_DIR) |
9
f40912333875
Generate index.html without "target=article" so links open in current browser tab.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
8
diff
changeset
|
120 |
./index.sh html >$@ |
1
fd4cd9134e53
Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
121 |
|
0
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
122 |
################################################################ |
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
123 |
# Init targets. |
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
124 |
|
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
125 |
$(DIRS): |
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
126 |
mkdir -p $@ |
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
127 |
|
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
128 |
################################################################ |
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
129 |
# Clean targets. |
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
130 |
|
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
131 |
.PHONY: distclean |
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
132 |
distclean: clean |
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
133 |
|
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
134 |
.PHONY: clean |
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
135 |
clean: |
17
c7017f58585c
Include common header with quick links.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
16
diff
changeset
|
136 |
rm -r -f $(DIRS) HEADER.rst |
0
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
137 |
|
5 | 138 |
################################################################ |
139 |
# Helper target. |
|
0
6ee132e4cd5f
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
140 |
|
35
648d3bf5204d
Add 'check-format-policy' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
141 |
.PHONY: help |
5 | 142 |
help: |
143 |
@echo Supported targets: |
|
144 |
@sed -n -e '/^[[:alnum:]_-]*:/{s=^\(.*\):.*= \1=;p;}' $(MAKEFILE_LIST) |
|
145 |
||
35
648d3bf5204d
Add 'check-format-policy' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
146 |
.PHONY: check-format-policy |
648d3bf5204d
Add 'check-format-policy' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
147 |
check-format-policy: |
648d3bf5204d
Add 'check-format-policy' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
148 |
\ |
648d3bf5204d
Add 'check-format-policy' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
149 |
for f in *.rst; do \ |
648d3bf5204d
Add 'check-format-policy' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
150 |
if grep '.. -\*- coding: utf-8; -\*-' $$f >/dev/null; then :; else \ |
648d3bf5204d
Add 'check-format-policy' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
151 |
echo $$f:1:" Has no 'coding: utf-8' directive."; \ |
648d3bf5204d
Add 'check-format-policy' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
152 |
fi; \ |
648d3bf5204d
Add 'check-format-policy' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
153 |
if grep '.. include:: HEADER.rst' $$f >/dev/null; then :; else \ |
648d3bf5204d
Add 'check-format-policy' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
154 |
echo $$f:2:" Has no 'include:: HEADER.rst' directive."; \ |
648d3bf5204d
Add 'check-format-policy' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
155 |
fi; \ |
648d3bf5204d
Add 'check-format-policy' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
156 |
if grep '.. contents::' $$f >/dev/null; then :; else \ |
648d3bf5204d
Add 'check-format-policy' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
157 |
echo $$f:7:" Has no 'contents::' directive."; \ |
648d3bf5204d
Add 'check-format-policy' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
158 |
fi; \ |
648d3bf5204d
Add 'check-format-policy' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
159 |
done |
5 | 160 |