source: trunk/adm/guides/makefile @ 89

Last change on this file since 89 was 89, checked in by pinsard, 14 years ago

modif in headers for manuals improvements

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