1 | #+ |
---|
2 | # |
---|
3 | # module |
---|
4 | # ====== |
---|
5 | # |
---|
6 | # generation of documentations from XML files in HTML and wiki forms |
---|
7 | # |
---|
8 | # TODO |
---|
9 | # ==== |
---|
10 | # |
---|
11 | # revision of Bibliography production |
---|
12 | # |
---|
13 | # improve HTML one style |
---|
14 | # |
---|
15 | # improve PDF one style |
---|
16 | # |
---|
17 | # improve logo |
---|
18 | # |
---|
19 | # improve htmllinkchecka (no clear between URL and DIR, test and official) |
---|
20 | # |
---|
21 | # EVOLUTIONS |
---|
22 | # ========== |
---|
23 | # |
---|
24 | # $Id$ |
---|
25 | # |
---|
26 | # - fplod 20100603T134510Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
27 | # |
---|
28 | # * add sphinx for HTML and PDF productions |
---|
29 | # |
---|
30 | # - fplod 2009-05-15T10:39:16Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
31 | # |
---|
32 | # * re-creation |
---|
33 | # |
---|
34 | #- |
---|
35 | PRODUCT = \ |
---|
36 | varamma |
---|
37 | |
---|
38 | DIRSRC = \ |
---|
39 | ./ |
---|
40 | |
---|
41 | DIRADM = \ |
---|
42 | ../ |
---|
43 | |
---|
44 | DIRTMP = \ |
---|
45 | ./ |
---|
46 | |
---|
47 | DIRDESIGN = \ |
---|
48 | ./design/ |
---|
49 | |
---|
50 | DIRWWW = \ |
---|
51 | ../../doc/guides/users/ |
---|
52 | |
---|
53 | # here are some examples of DIRPUBLISH/URLPUBLISH, the first on for Françoise Pinsard on her mac, |
---|
54 | # |
---|
55 | # the official one ++ is http://www.locean-ipsl.upmc.fr/~fplod/varamma/varamma_ws/doc/ |
---|
56 | # |
---|
57 | # comment all of them and define your own |
---|
58 | |
---|
59 | # one for me (Françoise) on my Mac aedon |
---|
60 | # URL is http://localhost/~fplod/varamma/ on this machine when run under |
---|
61 | # fplod account |
---|
62 | DIRPUBLISH = \ |
---|
63 | fplod@aedon.locean-ipsl.upmc.fr:Sites/$(PRODUCT) |
---|
64 | |
---|
65 | #uncomment these lines for official publication |
---|
66 | URLPUBLISH = \ |
---|
67 | http://www.locean-ipsl.upmc.fr/~fplod/$(PRODUCT)/$(PRODUCT)_ws/doc/guides/users/ |
---|
68 | |
---|
69 | DIRWIKI = \ |
---|
70 | $(DIRWWW)/wiki/fr |
---|
71 | |
---|
72 | LIST_XML = \ |
---|
73 | LIST_XML_en \ |
---|
74 | LIST_XML_fr |
---|
75 | |
---|
76 | LIST_XML_fr = \ |
---|
77 | $(DIRSRC)/web.xml |
---|
78 | |
---|
79 | LIST_XML_en = \ |
---|
80 | $(DIRSRC)/svnbasiccommands.xml |
---|
81 | |
---|
82 | LIST_RST = \ |
---|
83 | $(shell find $(DIRSRC) -name "*.rst" | sort) |
---|
84 | |
---|
85 | MAKEDATE = \ |
---|
86 | `date -u +"%Y-%m-%dT%H:%M:%SZ"` |
---|
87 | |
---|
88 | .PHONY : \ |
---|
89 | all \ |
---|
90 | clean \ |
---|
91 | cleantmp \ |
---|
92 | design \ |
---|
93 | before \ |
---|
94 | dbkcheck \ |
---|
95 | htmllinkcheckb \ |
---|
96 | htmllinkchecka \ |
---|
97 | spellcheck \ |
---|
98 | help \ |
---|
99 | html \ |
---|
100 | html_sphinx \ |
---|
101 | pdf \ |
---|
102 | pdf_sphinx \ |
---|
103 | tracwiki |
---|
104 | |
---|
105 | help : |
---|
106 | @echo "Prepare output directories :" |
---|
107 | @echo "\$$ make clean" |
---|
108 | @echo "\$$ make before" |
---|
109 | @echo "" |
---|
110 | @echo "Following commands are available to build outputs :" |
---|
111 | @echo "\$$ make all" |
---|
112 | @echo " " |
---|
113 | @echo "Check DocBook conformity :" |
---|
114 | @echo "\$$ make dbkcheck" |
---|
115 | @echo " " |
---|
116 | @echo "Check links before installation : " |
---|
117 | @echo "\$$ make htmllinkcheckb" |
---|
118 | @echo " " |
---|
119 | @echo "Last step = installation of HTML, pdf and wiki files" |
---|
120 | @echo "\$$ make install_all" |
---|
121 | @echo "++ depot html et wiki" |
---|
122 | @echo " " |
---|
123 | @echo "Check links after installation : " |
---|
124 | @echo "\$$ make htmllinkchecka" |
---|
125 | @echo " " |
---|
126 | |
---|
127 | before : |
---|
128 | @-mkdir -p ${DIRWWW}/html/css/ |
---|
129 | @-mkdir -p ${DIRWWW}/html/images/ |
---|
130 | @-mkdir -p ${DIRWWW}/html/en/sphinx/ |
---|
131 | @-mkdir -p ${DIRWWW}/pdf/en/sphinx/ |
---|
132 | @mkdir -p $(DIRTMP)/sphinx_tmpdir/doctrees/ |
---|
133 | @-cp -p $(DIRSRC)/*.css ${DIRWWW}/html/css/ |
---|
134 | @-cp $(DIRSRC)/*.gif $(DIRWWW)/html/images/ |
---|
135 | @-cp $(DIRSRC)/*.bmp $(DIRWWW)/html/images/ |
---|
136 | @-mkdir -p ${DIRWIKI} |
---|
137 | |
---|
138 | install_all : \ |
---|
139 | install_html \ |
---|
140 | install_pdf |
---|
141 | |
---|
142 | install_html : |
---|
143 | #@$(DIRADM)/install.sh -w $(DIRWWW)/html/ -p $(DIRPUBLISH)/html/ |
---|
144 | @$(DIRADM)/install.sh -w $(DIRWWW)/html/ -u $(URLPUBLISH)/html/ |
---|
145 | |
---|
146 | install_pdf : |
---|
147 | #@$(DIRADM)/install.sh -w $(DIRWWW)/pdf/ -p $(DIRPUBLISH)/pdf/ |
---|
148 | @$(DIRADM)/install.sh -w $(DIRWWW)/pdf/ -u $(URLPUBLISH)/pdf/ |
---|
149 | |
---|
150 | clean : \ |
---|
151 | cleantmp |
---|
152 | -@rm -rf ${DIRWWW}/html/ |
---|
153 | -@rm -rf ${DIRWWW}/pdf/ |
---|
154 | -@rm -rf ${DIRWWW}/wiki/ |
---|
155 | |
---|
156 | cleantmp : |
---|
157 | -@rm -f $(DIRTMP)/all.xml |
---|
158 | -@rm -f $(DIRTMP)/*_full*.xml |
---|
159 | -@rm -fr $(DIRTMP)/dblatex_tmpdir/ |
---|
160 | -@rm -f $(DIRTMP)/*_dblatex.err |
---|
161 | -@rm -f $(DIRTMP)/*_dblatex.log |
---|
162 | -@rm -f $(DIRTMP)/err_xmlstarlet_xsd |
---|
163 | -@rm -fr $(DIRTMP)/sphinx_tmpdir/ |
---|
164 | -@rm -f $(DIRTMP)/sphinx_*.log |
---|
165 | |
---|
166 | design : \ |
---|
167 | $(DIRDESIGN)/images/$(PRODUCT)_fulldependencies.png \ |
---|
168 | $(DIRDESIGN)/images/$(PRODUCT)_fulldependencies.svg |
---|
169 | |
---|
170 | htmllinkcheckb : |
---|
171 | @$(DIRADM)linkchecker.sh -d $(DIRWWW) |
---|
172 | |
---|
173 | htmllinkchecka : |
---|
174 | $(DIRADM)/linkchecker.sh -u http://localhost/~fplod/varamma/ |
---|
175 | @-#$(DIRADM)/linkchecker.sh -d $(DIRPUBLISH) |
---|
176 | @-#$(DIRADM)/linkchecker.sh -u $(URLPUBLISH) |
---|
177 | @echo "++wiki |
---|
178 | |
---|
179 | spellcheck : |
---|
180 | @for file in $(LIST_XML_fr); do \ |
---|
181 | aspell --mode=sgml --master=french -c $${file}; done |
---|
182 | @for file in $(LIST_XML_en); do \ |
---|
183 | aspell --mode=sgml --master=english -c $${file}; done |
---|
184 | |
---|
185 | dbkcheck : |
---|
186 | @-rm $(DIRTMP)/err_xmlstarlet_xsd 2> /dev/null |
---|
187 | @for file in $(DIRTMP)/*_full.xml; do \ |
---|
188 | xml val --err \ |
---|
189 | --xsd http://www.docbook.org/xml/5.0/xsd/docbook.xsd \ |
---|
190 | $${file} 1>> $(DIRTMP)/err_xmlstarlet_xsd 2>&1; done |
---|
191 | @echo "check for valid diag for each file in $(DIRTMP)/err_xmlstarlet_xsd" |
---|
192 | |
---|
193 | all : \ |
---|
194 | html \ |
---|
195 | pdf \ |
---|
196 | tracwiki |
---|
197 | |
---|
198 | html : \ |
---|
199 | html_sphinx |
---|
200 | |
---|
201 | html_sphinx : \ |
---|
202 | $(DIRADM)/sphinx/conf.py \ |
---|
203 | $(LIST_RST) |
---|
204 | @cp $(LIST_RST) $(DIRTMP)/sphinx_tmpdir/ |
---|
205 | @sphinx-build -b html -c $(DIRADM)/sphinx \ |
---|
206 | -d $(DIRTMP)/sphinx_tmpdir/doctrees \ |
---|
207 | -w $(DIRTMP)/sphinx_html.log \ |
---|
208 | $(DIRTMP)/sphinx_tmpdir/ \ |
---|
209 | $(DIRWWW)/html/en/sphinx/ |
---|
210 | |
---|
211 | pdf : \ |
---|
212 | pdf_sphinx |
---|
213 | |
---|
214 | pdf_sphinx : \ |
---|
215 | $(DIRADM)/sphinx/conf.py \ |
---|
216 | $(LIST_RST) |
---|
217 | @cp $(LIST_RST) $(DIRTMP)/sphinx_tmpdir/ |
---|
218 | @sphinx-build -b latex -c $(DIRADM)/sphinx \ |
---|
219 | -d $(DIRTMP)/sphinx_tmpdir/doctrees \ |
---|
220 | -w $(DIRTMP)/sphinx_pdf.log \ |
---|
221 | $(DIRTMP)/sphinx_tmpdir/ \ |
---|
222 | $(DIRTMP)/sphinx_tmpdir/latex_output |
---|
223 | cd $(DIRTMP)/sphinx_tmpdir/latex_output/; make all-pdf |
---|
224 | cp $(DIRTMP)/sphinx_tmpdir/latex_output/*.pdf \ |
---|
225 | $(DIRWWW)/pdf/en/sphinx/ |
---|
226 | |
---|
227 | tracwiki : \ |
---|
228 | $(DIRWIKI)/WikiStart |
---|
229 | @echo "Do not forget to import wiki pages" |
---|
230 | @echo "\$$ ssh $(PRODUCT)@forge.ipsl.jussieu.fr mkdir -p /tmp/$(PRODUCT)/" |
---|
231 | @echo "\$$ rsync -av --exclude=".DS_Store" --exclude=".svn" $(DIRWIKI) $(PRODUCT)@forge.ipsl.jussieu.fr:/tmp/$(PRODUCT)/" |
---|
232 | @echo "\$$ ssh $(PRODUCT)@forge.ipsl.jussieu.fr trac-admin /ipsl/forge/projets/$(PRODUCT)/trac wiki load /tmp/$(PRODUCT)/" |
---|
233 | |
---|
234 | @echo "\$$ ssh $(PRODUCT)@forge.ipsl.jussieu.fr rmdir -f /tmp/$(PRODUCT)/" |
---|
235 | |
---|
236 | $(DIRWIKI)/WikiStart : \ |
---|
237 | $(DIRTMP)/web_full.xml \ |
---|
238 | $(DIRSRC)/tracwiki.xsl |
---|
239 | @xsltproc \ |
---|
240 | $(DIRSRC)/tracwiki.xsl \ |
---|
241 | $< | \ |
---|
242 | awk 'sub(/ @star@ $$/,""){printf(" * %s", $$0);next};1' | \ |
---|
243 | sed -e "s+@star@+ *+" \ |
---|
244 | > $@ |
---|
245 | |
---|
246 | $(DIRTMP)/web_full.xml : \ |
---|
247 | $(DIRSRC)/web.xml |
---|
248 | @xmllint \ |
---|
249 | --xinclude \ |
---|
250 | --encode utf-8 \ |
---|
251 | --noent \ |
---|
252 | --output $@ \ |
---|
253 | $< |
---|
254 | |
---|
255 | $(DIRTMP)/svnbasiccommands_full.xml : \ |
---|
256 | $(DIRSRC)/svnbasiccommands.xml |
---|
257 | @xmllint \ |
---|
258 | --xinclude \ |
---|
259 | --encode utf-8 \ |
---|
260 | --noent \ |
---|
261 | --output $@ \ |
---|
262 | $< |
---|
263 | |
---|
264 | $(DIRTMP)/logo2.bmp : |
---|
265 | @convert -size 200x50 \ |
---|
266 | xc:white -fill black -stroke transparent \ |
---|
267 | -font Palatino-Roman -pointsize 40 -gravity center \ |
---|
268 | -draw "text 0,0 'VARAMMA'" $@ |
---|
269 | |
---|
270 | $(DIRDESIGN)/images/%.png : $(DIRDESIGN)/images/%.svg |
---|
271 | @convert $< $@ |
---|
272 | |
---|
273 | $(DIRDESIGN)/images/%.svg : $(DIRDESIGN)/%.dot |
---|
274 | @dot -Tsvg -o $@ $< |
---|
275 | |
---|
276 | $(DIRDESIGN)/$(PRODUCT)_fulldependencies.dot : \ |
---|
277 | ./makefile |
---|
278 | @makeppgraph --graphviz --output=$@ |
---|