source: trunk/adm/guides/makefile @ 15

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

ajout source enonce en XML/\DocBook; manque figures et pb \!MathML

File size: 8.9 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# add svnbasiccommands.html and svnbasiccommands.pdf
22#
23# EVOLUTIONS
24# ==========
25#
26# $Id$
27#
28# - fplod 2009-08-24T13:45:08Z zeus.locean-ipsl.upmc.fr (Linux)
29#
30#       * add enonce (prototype)
31#
32# - fplod 2009-08-21T10:19:52Z aedon.locean-ipsl.upmc.fr (Darwin)
33#
34#   * creation
35#
36#-
37PRODUCT = \
38tpacpandreg
39
40DIRSRC = \
41./
42
43DIRADM = \
44../
45
46DIRTMP = \
47./
48
49DIRWWW = \
50../../doc/guides/users/
51
52# here are some examples of DIRPUBLISH/URLPUBLISH, the first on for Françoise Pinsard on her mac,
53#
54# the official one ++ is http://www.locean-ipsl.upmc.fr/~fplod/tpacpandreg/tpacpandreg_ws/doc/guides/users/
55#
56# comment all of them and define your own
57
58# one for me (Françoise) on my Mac aedon
59# URL is http://localhost/~fplod/tpacpandreg/ on this machine when run under
60# fplod account
61DIRPUBLISH = \
62fplod@aedon.locean-ipsl.upmc.fr:Sites/$(PRODUCT)
63
64#uncomment these lines for official publication
65URLPUBLISH = \
66http://www.locean-ipsl.upmc.fr/~fplod/$(PRODUCT)/$(PRODUCT)_ws/doc/guides/users/
67
68DIRWIKI = \
69$(DIRWWW)/wiki/fr/
70
71LIST_XML = \
72LIST_XML_en \
73LIST_XML_fr
74
75LIST_XML_fr = \
76$(DIRSRC)/web.xml
77
78LIST_XML_en = \
79$(DIRSRC)/svnbasiccommands.xml
80
81MAKEDATE = \
82`date -u +"%Y-%m-%dT%H:%M:%SZ"`
83
84.PHONY : \
85all \
86clean \
87before \
88dbkcheck \
89htmllinkcheckb \
90htmllinkchecka \
91spellcheck \
92help \
93html \
94html_one \
95html_many \
96pdf \
97tracwiki
98
99help :
100        @echo "Prepare output directories :"
101        @echo "\$$ make clean"
102        @echo "\$$ make before"
103        @echo ""
104        @echo "Following commands are available to build outputs :"
105        @echo "\$$ make all"
106        @echo " "
107        @echo "Check DocBook conformity :"
108        @echo "\$$ make dbkcheck"
109        @echo " "
110        @echo "Check links before installation : "
111        @echo "\$$ make htmllinkcheckb"
112        @echo " "
113        @echo "Last step = installation of HTML, pdf and wiki files"
114        @echo "\$$ make install_all"
115        @echo "++ depot html et wiki"
116        @echo " "
117        @echo "Check links after installation : "
118        @echo "\$$ make htmllinkchecka"
119        @echo " "
120
121
122before :
123        @-mkdir -p ${DIRWWW}/html/css/
124        @-mkdir -p ${DIRWWW}/html/images/
125        @-mkdir -p ${DIRWWW}/html/en/one/
126        @-mkdir -p ${DIRWWW}/html/en/many/
127        @-mkdir -p ${DIRWWW}/pdf/en/one/
128        @-cp -p $(DIRSRC)/*.css ${DIRWWW}/html/css/
129        @-cp $(DIRSRC)/*.gif $(DIRWWW)/html/images/
130        @-cp $(DIRSRC)/*.bmp $(DIRWWW)/html/images/
131        @-mkdir -p ${DIRWIKI}
132
133install_all : \
134install_html \
135install_pdf
136
137install_html :
138        #@$(DIRADM)/install.sh -w $(DIRWWW)/html/ -p $(DIRPUBLISH)/html/
139        @$(DIRADM)/install.sh -w $(DIRWWW)/html/ -u $(URLPUBLISH)/html/
140
141install_pdf :
142        #@$(DIRADM)/install.sh -w $(DIRWWW)/pdf/ -p $(DIRPUBLISH)/pdf/
143        @$(DIRADM)/install.sh -w $(DIRWWW)/pdf/ -u $(URLPUBLISH)/pdf/
144
145clean : \
146cleantmp
147        -@rm -rf ${DIRWWW}/html/
148        -@rm -rf ${DIRWWW}/pdf/
149        -@rm -rf ${DIRWWW}/wiki/
150
151cleantmp :
152        -@rm -f $(DIRTMP)/*_full*.xml
153        -@rm -f $(DIRTMP)/*_dblatex.err
154        -@rm -f $(DIRTMP)/*_dblatex.log
155        -@rm -f $(DIRTMP)/err_xmlstarlet_xsd
156
157htmllinkcheckb :
158        @$(DIRADM)linkchecker.sh -d $(DIRWWW)
159
160htmllinkchecka :
161        $(DIRADM)/linkchecker.sh -u http://localhost/~fplod/tpacpandreg/
162        @-#$(DIRADM)/linkchecker.sh -d $(DIRPUBLISH)
163        @-#$(DIRADM)/linkchecker.sh -u $(URLPUBLISH)
164        @echo "++wiki
165
166spellcheck :
167        @for file in $(LIST_XML_fr); do \
168         aspell --mode=sgml --master=french -c $${file}; done
169        @for file in $(LIST_XML_en); do \
170         aspell --mode=sgml --master=english -c $${file}; done
171
172dbkcheck :
173        @-rm $(DIRTMP)/err_xmlstarlet_xsd 2> /dev/null
174        @for file in $(DIRTMP)/*_full.xml; do \
175        xml val --err \
176        --xsd http://www.docbook.org/xml/5.0/xsd/docbook.xsd \
177        $${file} 1>> $(DIRTMP)/err_xmlstarlet_xsd 2>&1; done
178        @echo "check for valid diag for each file in $(DIRTMP)/err_xmlstarlet_xsd"
179
180all : \
181html \
182pdf \
183tracwiki
184
185html : \
186html_one \
187html_many
188
189html_one : \
190$(DIRWWW)/html/en/one/index.html \
191$(DIRWWW)/html/en/one/enonce.html
192
193html_many : \
194$(DIRWWW)/html/en/many/$(PRODUCT)01/ \
195$(DIRWWW)/html/en/many/$(PRODUCT)02/
196
197pdf : \
198$(DIRWWW)/pdf/en/one/$(PRODUCT).pdf \
199$(DIRWWW)/pdf/en/one/enonce.pdf
200
201tracwiki : \
202$(DIRWIKI)/WikiStart \
203$(DIRWIKI)/SvnBasicCommands
204        @echo "Do not forget to import wiki pages"
205        @echo "\$$ ssh $(PRODUCT)@forge.ipsl.jussieu.fr mkdir -p /tmp/$(PRODUCT)/"
206        @echo "\$$ rsync -av --exclude=".DS_Store" --exclude=".svn" $(DIRWIKI) $(PRODUCT)@forge.ipsl.jussieu.fr:/tmp/$(PRODUCT)/"
207        @echo "\$$ ssh $(PRODUCT)@forge.ipsl.jussieu.fr trac-admin /ipsl/forge/projets/$(PRODUCT)/trac wiki load /tmp/$(PRODUCT)/"
208
209        @echo "\$$ ssh $(PRODUCT)@forge.ipsl.jussieu.fr rmdir -f /tmp/$(PRODUCT)/"
210
211$(DIRWIKI)/WikiStart : \
212$(DIRTMP)/web_full.xml \
213$(DIRSRC)/tracwiki.xsl
214        @xsltproc \
215        $(DIRSRC)/tracwiki.xsl \
216        $< | \
217        awk 'sub(/ @star@ $$/,""){printf(" * %s", $$0);next};1' | \
218        sed -e "s+@star@+ *+" \
219        > $@
220
221$(DIRWWW)/html/en/one/index.html : \
222$(DIRTMP)/web_full.xml \
223$(DIRSRC)/html.xsl \
224$(DIRSRC)/style.css \
225$(DIRSRC)/$(PRODUCT).css
226        @xsltproc \
227        --param makedate "'$(MAKEDATE)'" \
228        --param html.stylesheet "'../../css/style.css ../../css/$(PRODUCT).css'" \
229        --param css.decoration 1 \
230        --param link.mailto.url "'mailto:Francoise.Pinsard@locean-ipsl.upmc.fr'" \
231        --param section.autolabel 1 \
232        --output $@ \
233        $(DIRSRC)/html.xsl \
234        $<
235
236$(DIRWWW)/html/en/one/enonce.html : \
237$(DIRTMP)/enonce_full.xml \
238$(DIRSRC)/html.xsl \
239$(DIRSRC)/style.css \
240$(DIRSRC)/$(PRODUCT).css
241        @xsltproc \
242        --param makedate "'$(MAKEDATE)'" \
243        --param html.stylesheet "'../../css/style.css ../../css/$(PRODUCT).css'" \
244        --param css.decoration 1 \
245        --param link.mailto.url "'mailto:Francoise.Pinsard@locean-ipsl.upmc.fr'" \
246        --param section.autolabel 1 \
247        --output $@ \
248        $(DIRSRC)/html.xsl \
249        $<
250
251$(DIRWWW)/html/en/many/$(PRODUCT)01/ : \
252$(DIRTMP)/web_full_many01.xml \
253$(DIRSRC)/style.css \
254$(DIRSRC)/$(PRODUCT).css \
255$(DIRSRC)/main_many01_html.xsl
256        @xsltproc \
257        --param makedate "'$(MAKEDATE)'" \
258        --param html.stylesheet "'../../../css/style.css ../../../css/$(PRODUCT).css'" \
259        --param css.decoration 1 \
260        --param link.mailto.url "'mailto:Francoise.Pinsard@locean-ipsl.upmc.fr'" \
261        --param base.dir "'$@/'" \
262        $(DIRSRC)/main_many01_html.xsl \
263        $<
264        @touch $@/
265
266$(DIRTMP)/web_full_many01.xml : \
267$(DIRTMP)/web_full.xml
268        @xml ed \
269        -N dbk="http://docbook.org/ns/docbook" \
270        -N xl="http://www.w3.org/1999/xlink" \
271        -P -S \
272        -u "//dbk:link[@xl:href='../../../../../manuals/html/one/index.html']/@xl:href" -v '../../../../../../manuals/html/one/index.html'  \
273        $< > $@
274
275$(DIRWWW)/html/en/many/$(PRODUCT)02/ : \
276$(DIRTMP)/web_full_many02.xml \
277$(DIRSRC)/$(PRODUCT).css \
278$(DIRSRC)/v1.css \
279$(DIRSRC)/style.css \
280$(DIRSRC)/bg.gif \
281$(DIRSRC)/left.gif \
282$(DIRSRC)/left_on.gif \
283$(DIRSRC)/right.gif \
284$(DIRSRC)/right_on.gif \
285$(DIRTMP)/logo2.bmp \
286$(DIRSRC)/main_many02_html.xsl \
287$(DIRSRC)/navigation02_html.xsl \
288$(DIRSRC)/message_lang.xsl
289        @xsltproc \
290        --param language "'en'" \
291        --param makedate "'$(MAKEDATE)'" \
292        --param html.stylesheet "'../../../css/style.css ../../../css/$(PRODUCT).css ../../../css/v1.css'" \
293        --param css.decoration 1 \
294        --param link.mailto.url "'mailto:Francoise.Pinsard@locean-ipsl.upmc.fr'" \
295        --param base.dir "'$@/'" \
296        $(DIRSRC)/main_many02_html.xsl \
297        $<
298        @touch $@/
299
300$(DIRTMP)/web_full_many02.xml : \
301$(DIRTMP)/web_full.xml
302        @xml ed \
303        -N dbk="http://docbook.org/ns/docbook" \
304        -N xl="http://www.w3.org/1999/xlink" \
305        -P -S \
306        -u "//dbk:link[@xl:href='../../../../../manuals/html/one/index.html']/@xl:href" -v '../../../../../../manuals/html/one/index.html'  \
307        $< > $@
308
309$(DIRWWW)/pdf/en/one/$(PRODUCT).pdf : \
310$(DIRTMP)/web_full.xml
311        @-dblatex \
312        -b pdftex \
313        -T simple \
314        -o $@ \
315        -d \
316        -x "--nonet" \
317        -I "$(DIRWWW)/images/" \
318        -f png \
319        $< \
320        1> $(DIRTMP)/main_dblatex.log \
321        2> $(DIRTMP)/main_dblatex.err
322
323$(DIRWWW)/pdf/en/one/enonce.pdf : \
324$(DIRTMP)/enonce_full.xml
325        @-dblatex \
326        -b pdftex \
327        -T simple \
328        -o $@ \
329        -d \
330        -x "--nonet" \
331        -I "$(DIRWWW)/images/" \
332        -f png \
333        $< \
334        1> $(DIRTMP)/main_dblatex.log \
335        2> $(DIRTMP)/main_dblatex.err
336
337$(DIRTMP)/web_full.xml : \
338$(DIRSRC)/web.xml
339        @xmllint \
340        --xinclude \
341        --encode utf-8 \
342        --noent \
343        --output $@ \
344        $<
345
346$(DIRWIKI)/SvnBasicCommands : \
347$(DIRTMP)/svnbasiccommands_full.xml \
348$(DIRSRC)/tracwiki.xsl
349        @xsltproc \
350        $(DIRSRC)/tracwiki.xsl \
351        $< | \
352        awk 'sub(/ @star@ $$/,""){printf(" * %s", $$0);next};1' | \
353        sed -e "s+@star@+*+" \
354        > $@
355
356$(DIRTMP)/svnbasiccommands_full.xml : \
357$(DIRSRC)/svnbasiccommands.xml
358        @xmllint \
359        --xinclude \
360        --encode utf-8 \
361        --noent \
362        --output $@ \
363        $<
364
365$(DIRWIKI)/Enonce : \
366$(DIRTMP)/enonce_full.xml \
367$(DIRSRC)/tracwiki.xsl
368        @xsltproc \
369        $(DIRSRC)/tracwiki.xsl \
370        $< | \
371        awk 'sub(/ @star@ $$/,""){printf(" * %s", $$0);next};1' | \
372        sed -e "s+@star@+*+" \
373        > $@
374
375$(DIRTMP)/enonce_full.xml : \
376$(DIRSRC)/enonce.xml
377        @xmllint \
378        --xinclude \
379        --encode utf-8 \
380        --noent \
381        --output $@ \
382        $<
383
384$(DIRTMP)/logo2.bmp :
385        @convert -size 200x50 \
386        xc:white -fill black -stroke transparent \
387        -font Palatino-Roman -pointsize 40 -gravity center \
388        -draw "text 0,0 'TP_MLP_AEROSOLS'" $@
389
Note: See TracBrowser for help on using the repository browser.