source: trunk/adm/guides/makefile @ 32

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

detection of OS; explicit xy, explicit marker size

File size: 9.0 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/fr/one/
127        @-mkdir -p ${DIRWWW}/html/en/many/
128        @-mkdir -p ${DIRWWW}/html/fr/many/
129        @-mkdir -p ${DIRWWW}/pdf/en/one/
130        @-mkdir -p ${DIRWWW}/pdf/fr/one/
131        @-cp -p $(DIRSRC)/*.css ${DIRWWW}/html/css/
132        @-cp $(DIRSRC)/*.gif $(DIRWWW)/html/images/
133        @-cp $(DIRSRC)/*.bmp $(DIRWWW)/html/images/
134        @-mkdir -p ${DIRWIKI}
135
136install_all : \
137install_html \
138install_pdf
139
140install_html :
141        #@$(DIRADM)/install.sh -w $(DIRWWW)/html/ -p $(DIRPUBLISH)/html/
142        @$(DIRADM)/install.sh -w $(DIRWWW)/html/ -u $(URLPUBLISH)/html/
143
144install_pdf :
145        #@$(DIRADM)/install.sh -w $(DIRWWW)/pdf/ -p $(DIRPUBLISH)/pdf/
146        @$(DIRADM)/install.sh -w $(DIRWWW)/pdf/ -u $(URLPUBLISH)/pdf/
147
148clean : \
149cleantmp
150        -@rm -rf ${DIRWWW}/html/
151        -@rm -rf ${DIRWWW}/pdf/
152        -@rm -rf ${DIRWWW}/wiki/
153
154cleantmp :
155        -@rm -f $(DIRTMP)/*_full*.xml
156        -@rm -f $(DIRTMP)/*_dblatex.err
157        -@rm -f $(DIRTMP)/*_dblatex.log
158        -@rm -f $(DIRTMP)/err_xmlstarlet_xsd
159
160htmllinkcheckb :
161        @$(DIRADM)linkchecker.sh -d $(DIRWWW)
162
163htmllinkchecka :
164        $(DIRADM)/linkchecker.sh -u http://localhost/~fplod/tpacpandreg/
165        @-#$(DIRADM)/linkchecker.sh -d $(DIRPUBLISH)
166        @-#$(DIRADM)/linkchecker.sh -u $(URLPUBLISH)
167        @echo "++wiki
168
169spellcheck :
170        @for file in $(LIST_XML_fr); do \
171         aspell --mode=sgml --master=french -c $${file}; done
172        @for file in $(LIST_XML_en); do \
173         aspell --mode=sgml --master=english -c $${file}; done
174
175dbkcheck :
176        @-rm $(DIRTMP)/err_xmlstarlet_xsd 2> /dev/null
177        @for file in $(DIRTMP)/*_full.xml; do \
178        xml val --err \
179        --xsd http://www.docbook.org/xml/5.0/xsd/docbook.xsd \
180        $${file} 1>> $(DIRTMP)/err_xmlstarlet_xsd 2>&1; done
181        @echo "check for valid diag for each file in $(DIRTMP)/err_xmlstarlet_xsd"
182
183all : \
184html \
185pdf \
186tracwiki
187
188html : \
189html_one \
190html_many
191
192html_one : \
193$(DIRWWW)/html/en/one/index.html \
194$(DIRWWW)/html/fr/one/enonce.html
195
196html_many : \
197$(DIRWWW)/html/en/many/$(PRODUCT)01/ \
198$(DIRWWW)/html/en/many/$(PRODUCT)02/
199
200pdf : \
201$(DIRWWW)/pdf/en/one/$(PRODUCT).pdf \
202$(DIRWWW)/pdf/fr/one/enonce.pdf
203
204tracwiki : \
205$(DIRWIKI)/WikiStart \
206$(DIRWIKI)/SvnBasicCommands
207        @echo "Do not forget to import wiki pages"
208        @echo "\$$ ssh $(PRODUCT)@forge.ipsl.jussieu.fr mkdir -p /tmp/$(PRODUCT)/"
209        @echo "\$$ rsync -av --exclude=".DS_Store" --exclude=".svn" $(DIRWIKI) $(PRODUCT)@forge.ipsl.jussieu.fr:/tmp/$(PRODUCT)/"
210        @echo "\$$ ssh $(PRODUCT)@forge.ipsl.jussieu.fr trac-admin /ipsl/forge/projets/$(PRODUCT)/trac wiki load /tmp/$(PRODUCT)/"
211
212        @echo "\$$ ssh $(PRODUCT)@forge.ipsl.jussieu.fr rmdir -f /tmp/$(PRODUCT)/"
213
214$(DIRWIKI)/WikiStart : \
215$(DIRTMP)/web_full.xml \
216$(DIRSRC)/tracwiki.xsl
217        @xsltproc \
218        $(DIRSRC)/tracwiki.xsl \
219        $< | \
220        awk 'sub(/ @star@ $$/,""){printf(" * %s", $$0);next};1' | \
221        sed -e "s+@star@+ *+" \
222        > $@
223
224$(DIRWWW)/html/en/one/index.html : \
225$(DIRTMP)/web_full.xml \
226$(DIRSRC)/html.xsl \
227$(DIRSRC)/style.css \
228$(DIRSRC)/$(PRODUCT).css
229        @xsltproc \
230        --param makedate "'$(MAKEDATE)'" \
231        --param html.stylesheet "'../../css/style.css ../../css/$(PRODUCT).css'" \
232        --param css.decoration 1 \
233        --param link.mailto.url "'mailto:Francoise.Pinsard@locean-ipsl.upmc.fr'" \
234        --param section.autolabel 1 \
235        --output $@ \
236        $(DIRSRC)/html.xsl \
237        $<
238
239$(DIRWWW)/html/fr/one/enonce.html : \
240$(DIRTMP)/enonce_full.xml \
241$(DIRSRC)/html.xsl \
242$(DIRSRC)/style.css \
243$(DIRSRC)/$(PRODUCT).css
244        @xsltproc \
245        --param makedate "'$(MAKEDATE)'" \
246        --param html.stylesheet "'../../css/style.css ../../css/$(PRODUCT).css'" \
247        --param css.decoration 1 \
248        --param link.mailto.url "'mailto:Francoise.Pinsard@locean-ipsl.upmc.fr'" \
249        --param section.autolabel 1 \
250        --output $@ \
251        $(DIRSRC)/html.xsl \
252        $<
253
254$(DIRWWW)/html/en/many/$(PRODUCT)01/ : \
255$(DIRTMP)/web_full_many01.xml \
256$(DIRSRC)/style.css \
257$(DIRSRC)/$(PRODUCT).css \
258$(DIRSRC)/main_many01_html.xsl
259        @xsltproc \
260        --param makedate "'$(MAKEDATE)'" \
261        --param html.stylesheet "'../../../css/style.css ../../../css/$(PRODUCT).css'" \
262        --param css.decoration 1 \
263        --param link.mailto.url "'mailto:Francoise.Pinsard@locean-ipsl.upmc.fr'" \
264        --param base.dir "'$@/'" \
265        $(DIRSRC)/main_many01_html.xsl \
266        $<
267        @touch $@/
268
269$(DIRTMP)/web_full_many01.xml : \
270$(DIRTMP)/web_full.xml
271        @xml ed \
272        -N dbk="http://docbook.org/ns/docbook" \
273        -N xl="http://www.w3.org/1999/xlink" \
274        -P -S \
275        -u "//dbk:link[@xl:href='../../../../../manuals/html/one/index.html']/@xl:href" -v '../../../../../../manuals/html/one/index.html'  \
276        $< > $@
277
278$(DIRWWW)/html/en/many/$(PRODUCT)02/ : \
279$(DIRTMP)/web_full_many02.xml \
280$(DIRSRC)/$(PRODUCT).css \
281$(DIRSRC)/v1.css \
282$(DIRSRC)/style.css \
283$(DIRSRC)/bg.gif \
284$(DIRSRC)/left.gif \
285$(DIRSRC)/left_on.gif \
286$(DIRSRC)/right.gif \
287$(DIRSRC)/right_on.gif \
288$(DIRTMP)/logo2.bmp \
289$(DIRSRC)/main_many02_html.xsl \
290$(DIRSRC)/navigation02_html.xsl \
291$(DIRSRC)/message_lang.xsl
292        @xsltproc \
293        --param language "'en'" \
294        --param makedate "'$(MAKEDATE)'" \
295        --param html.stylesheet "'../../../css/style.css ../../../css/$(PRODUCT).css ../../../css/v1.css'" \
296        --param css.decoration 1 \
297        --param link.mailto.url "'mailto:Francoise.Pinsard@locean-ipsl.upmc.fr'" \
298        --param base.dir "'$@/'" \
299        $(DIRSRC)/main_many02_html.xsl \
300        $<
301        @touch $@/
302
303$(DIRTMP)/web_full_many02.xml : \
304$(DIRTMP)/web_full.xml
305        @xml ed \
306        -N dbk="http://docbook.org/ns/docbook" \
307        -N xl="http://www.w3.org/1999/xlink" \
308        -P -S \
309        -u "//dbk:link[@xl:href='../../../../../manuals/html/one/index.html']/@xl:href" -v '../../../../../../manuals/html/one/index.html'  \
310        $< > $@
311
312$(DIRWWW)/pdf/en/one/$(PRODUCT).pdf : \
313$(DIRTMP)/web_full.xml
314        @-dblatex \
315        -b pdftex \
316        -T simple \
317        -o $@ \
318        -d \
319        -x "--nonet" \
320        -I "$(DIRWWW)/images/" \
321        -f png \
322        $< \
323        1> $(DIRTMP)/main_dblatex.log \
324        2> $(DIRTMP)/main_dblatex.err
325
326$(DIRWWW)/pdf/fr/one/enonce.pdf : \
327$(DIRTMP)/enonce_full.xml
328        @-dblatex \
329        -b pdftex \
330        -T simple \
331        -o $@ \
332        -d \
333        -x "--nonet" \
334        -I "$(DIRWWW)/images/" \
335        -f png \
336        $< \
337        1> $(DIRTMP)/main_dblatex.log \
338        2> $(DIRTMP)/main_dblatex.err
339
340$(DIRTMP)/web_full.xml : \
341$(DIRSRC)/web.xml
342        @xmllint \
343        --xinclude \
344        --encode utf-8 \
345        --noent \
346        --output $@ \
347        $<
348
349$(DIRWIKI)/SvnBasicCommands : \
350$(DIRTMP)/svnbasiccommands_full.xml \
351$(DIRSRC)/tracwiki.xsl
352        @xsltproc \
353        $(DIRSRC)/tracwiki.xsl \
354        $< | \
355        awk 'sub(/ @star@ $$/,""){printf(" * %s", $$0);next};1' | \
356        sed -e "s+@star@+*+" \
357        > $@
358
359$(DIRTMP)/svnbasiccommands_full.xml : \
360$(DIRSRC)/svnbasiccommands.xml
361        @xmllint \
362        --xinclude \
363        --encode utf-8 \
364        --noent \
365        --output $@ \
366        $<
367
368$(DIRWIKI)/Enonce : \
369$(DIRTMP)/enonce_full.xml \
370$(DIRSRC)/tracwiki.xsl
371        @xsltproc \
372        $(DIRSRC)/tracwiki.xsl \
373        $< | \
374        awk 'sub(/ @star@ $$/,""){printf(" * %s", $$0);next};1' | \
375        sed -e "s+@star@+*+" \
376        > $@
377
378$(DIRTMP)/enonce_full.xml : \
379$(DIRSRC)/enonce.xml
380        @xmllint \
381        --xinclude \
382        --encode utf-8 \
383        --noent \
384        --output $@ \
385        $<
386
387$(DIRTMP)/logo2.bmp :
388        @convert -size 200x50 \
389        xc:white -fill black -stroke transparent \
390        -font Palatino-Roman -pointsize 40 -gravity center \
391        -draw "text 0,0 'TP_MLP_AEROSOLS'" $@
392
Note: See TracBrowser for help on using the repository browser.