source: trunk/docs/docs_dev/source/guides/makefile

Last change on this file was 640, checked in by pinsard, 10 years ago

fix thanks to coding rules; typo; dupe empty lines

  • Property svn:keywords set to Id
File size: 6.2 KB
Line 
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#-
35PRODUCT = \
36varamma
37
38DIRSRC = \
39./
40
41DIRADM = \
42../
43
44DIRTMP = \
45./
46
47DIRDESIGN = \
48./design/
49
50DIRWWW = \
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
62DIRPUBLISH = \
63fplod@aedon.locean-ipsl.upmc.fr:Sites/$(PRODUCT)
64
65#uncomment these lines for official publication
66URLPUBLISH = \
67http://www.locean-ipsl.upmc.fr/~fplod/$(PRODUCT)/$(PRODUCT)_ws/doc/guides/users/
68
69DIRWIKI = \
70$(DIRWWW)/wiki/fr
71
72LIST_XML = \
73LIST_XML_en \
74LIST_XML_fr
75
76LIST_XML_fr = \
77$(DIRSRC)/web.xml
78
79LIST_XML_en = \
80$(DIRSRC)/svnbasiccommands.xml
81
82LIST_RST = \
83$(shell find $(DIRSRC) -name "*.rst" | sort)
84
85MAKEDATE = \
86`date -u +"%Y-%m-%dT%H:%M:%SZ"`
87
88.PHONY : \
89all \
90clean \
91cleantmp \
92design \
93before \
94dbkcheck \
95htmllinkcheckb \
96htmllinkchecka \
97spellcheck \
98help \
99html \
100html_sphinx \
101pdf \
102pdf_sphinx \
103tracwiki
104
105help :
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
127before :
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
138install_all : \
139install_html \
140install_pdf
141
142install_html :
143        #@$(DIRADM)/install.sh -w $(DIRWWW)/html/ -p $(DIRPUBLISH)/html/
144        @$(DIRADM)/install.sh -w $(DIRWWW)/html/ -u $(URLPUBLISH)/html/
145
146install_pdf :
147        #@$(DIRADM)/install.sh -w $(DIRWWW)/pdf/ -p $(DIRPUBLISH)/pdf/
148        @$(DIRADM)/install.sh -w $(DIRWWW)/pdf/ -u $(URLPUBLISH)/pdf/
149
150clean : \
151cleantmp
152        -@rm -rf ${DIRWWW}/html/
153        -@rm -rf ${DIRWWW}/pdf/
154        -@rm -rf ${DIRWWW}/wiki/
155
156cleantmp :
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
166design : \
167$(DIRDESIGN)/images/$(PRODUCT)_fulldependencies.png \
168$(DIRDESIGN)/images/$(PRODUCT)_fulldependencies.svg
169
170htmllinkcheckb :
171        @$(DIRADM)linkchecker.sh -d $(DIRWWW)
172
173htmllinkchecka :
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
179spellcheck :
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
185dbkcheck :
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
193all : \
194html \
195pdf \
196tracwiki
197
198html : \
199html_sphinx
200
201html_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
211pdf : \
212pdf_sphinx
213
214pdf_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
227tracwiki : \
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=$@
Note: See TracBrowser for help on using the repository browser.