source: trunk/makefile @ 60

Last change on this file since 60 was 58, checked in by pinsard, 16 years ago

introduce language dependency on each update message (bibilo, user, html files)

  • Property svn:keywords set to Id
File size: 13.6 KB
Line 
1# module :
2# génération des pages superbib
3#
4# update :
5# $Id$
6# fplod 2008-04-30T09:52:22Z aedon.locean-ipsl.upmc.fr (Darwin)
7# chgt for dbk5
8# fplod 2008-04-28T10:27:33Z aedon.locean-ipsl.upmc.fr (Darwin)
9# add .PHONY to make possible usage of makeppgraph
10# get rid of tidy
11# introduce URLPUBLISH
12# fplod 2008-04-18T10:24:13Z aedon.locean-ipsl.upmc.fr (Darwin)
13# add year_ploticus.xsl (replacing years_gnuplot.xsl)
14# fplod 2007-11-22T09:57:16Z aedon.locean-ipsl.upmc.fr (Darwin)
15# replace --output parameter by --stringparam base.dir
16# according to Bob Stayton recommandation in
17# http://lists.oasis-open.org/archives/docbook-apps/200711/msg00095.html
18# fplod 2007-10-12T09:40:01Z aedon.locean-ipsl.upmc.fr (Darwin)
19# add linkcheck
20# ++ la génération de pdf ne marchent pas bien sans doute à cause des images top
21# fplod 2007-09-28T08:56:17Z aedon.locean-ipsl.upmc.fr (Darwin)
22# add before and install targets
23# fplod 2007-06-06T10:23:19Z aedon.locean-ipsl.upmc.fr (Darwin)
24# change hard coded DIRBASE
25# fplod 2007-05-21T14:01:20Z aedon.locean-ipsl.upmc.fr (Darwin)
26# ajout du plot nbpub/year
27# fplod 2007-03-30T09:53:48Z aedon.locean-ipsl.upmc.fr (Darwin)
28# creation
29#
30PRODUCT = \
31superbib
32
33DIRBASE = \
34./
35
36DIRSRC = \
37$(DIRBASE)
38
39DIRTMP = \
40./
41
42DIRXML = \
43$(DIRBASE)/xml/
44
45DIRDOC = \
46$(DIRBASE)/doc/
47
48DIRWWW = \
49/tmp/$(PRODUCT)/
50
51# here are some examples of DIRPUBLISH/URLPUBLISH, the first on for Seb on his Mac,
52#
53# the real one for NEMO is opatlod@cerbere.locean-ispl.upmc.fr:NEMO/general/biblio_new/
54#
55# comment all of them and define your own
56#
57DIRPUBLISH = \
58smasson@arete.locean-ipsl.upmc.fr:Sites/bibnemomaf/
59
60URLPUBLISH = \
61none
62
63# the second one for me (Françoise) on my Mac aedon
64#DIRPUBLISH = \
65#fplod@aedon.locean-ipsl.upmc.fr:Sites/$(PRODUCT)demo/
66
67#URLPUBLISH = \
68#none
69
70# the third for me (Françoise) on my home page at LOCEAN
71# http://www.locean-ipsl.upmc.fr/~fplod/superbibdemo/
72DIRPUBLISH = \
73none
74
75URLPUBLISH = \
76http://www.locean-ipsl.upmc.fr/~fplod/$(PRODUCT)demo/
77
78MAKEDATE = \
79`date -u +"%Y-%m-%dT%H:%M:%SZ"`
80
81XSLPARAMHTML = \
82--param makedate "'$(MAKEDATE)'" \
83--param html.stylesheet "'../../style.css ../../$(PRODUCT).css'" \
84--param generate.article.toc '0' \
85--param generate.section.toc.level '0' \
86--param link.mailto.url "'mailto:opatlod@locean-ipsl.upmc.fr'" \
87--param citerefentry.link '1'
88
89IMAGES = \
90$(DIRSRC)/images/globalicondl11x10_up.gif
91
92.PHONY : \
93dbkcheck \
94all \
95before \
96clean \
97doc \
98help \
99html \
100htmllinkchecka \
101htmllinkcheckb \
102install \
103pdf
104
105help :
106        @echo "Define in the makefile localisations of :"
107        @echo " - sources (DIRSRC) where you \"svn checkout\" $(PRODUCT)"
108        @echo " - temporary Web pages (DIRWWW), where you can check links before publication"
109        @echo "- published Web pages (DIRPUBLISH/URLPUBLISH)"
110        @echo ""
111        @echo "Prepare output directories :"
112        @echo "\$$ make before"
113        @echo ""
114        @echo "Identify bibliography databank "
115        @echo ""
116        @echo "for example for $(PRODUCT) demo1:"
117        @echo "\$$ ln -sf data/bibdemo1_dbk5.xml biblio.xml"
118        @echo ""
119        @echo "for example for NEMO Survey :"
120        @echo "\$$ ln -sf data/biball.xml biblio.xml"
121        @echo ""
122        @echo "check for duplicate DOI; for example :"
123        @echo "\$$ ./twindoi.sh -i biblio.xml -t xml"
124        @echo ""
125        @echo "Identify user databank; for example :"
126        @echo ""
127        @echo "for example for $(PRODUCT) demo1:"
128        @echo "\$$ ln -sf data/userdemo1.xml user.xml"
129        @echo "\$$ ln -sf data/usernemo.dtd user.dtd"
130        @echo ""
131        @echo "for example for NEMO Survey :"
132        @echo "\$$ ln -sf data/usernemo.xml user.xml"
133        @echo "\$$ ln -sf data/usernemo.dtd user.dtd"
134        @echo ""
135        @echo "Following commands are available to build outputs :"
136        @echo "\$$ make html"
137        @echo " "
138        @echo "Check for DocBook 5 validity : "
139        @echo "\$$ make dbkcheck"
140        @echo " "
141        @echo "Check links before installation : "
142        @echo "\$$ make htmllinkcheckb"
143        @echo " "
144        @echo "Last step = installation"
145        @echo "\$$ make install"
146        @echo " "
147        @echo "Check links after installation : "
148        @echo "\$$ make htmllinkchecka"
149        @echo " "
150        @echo "if you move this product to an other place, "
151        @echo "change parameters in the call sequence of ./before.sh and ./install.sh"
152        @echo "and in the call sequence of in ./install.sh"
153        @echo "in this makefile"
154        @echo " "
155        @echo " "
156        @echo " "
157        @echo "for contributors at LOCEAN:"
158        @echo "\$$ export PATH=\$$PATH:/usr/home/fplod/src/schema_ws/"
159        @echo "\$$ make doc"
160
161before :
162        @./before.sh -p $(PRODUCT) -s $(DIRSRC) -w $(DIRWWW) -multi -l en -m 2
163
164install :
165        ./install.sh -w $(DIRWWW) -p $(DIRPUBLISH)
166        ./install.sh -w $(DIRWWW) -u $(URLPUBLISH)
167clean :
168        -@rm -fr $(DIRWWW)/
169        -@rm -f $(DIRTMP)/$(DIRTMP)/select_id.xml
170        -@rm -f $(DIRTMP)/main_full.xml
171        -@rm -f $(DIRTMP)/$(PRODUCT)01.xml
172        -@rm -f $(DIRTMP)/$(PRODUCT)01_dblatex.log
173        -@rm -f $(DIRTMP)/$(PRODUCT)01_dblatex.err
174        -@rm -f $(DIRTMP)/years_gnuplot.gnu
175        -@rm -f $(DIRTMP)/years.ploticus
176        -@rm -f $(DIRTMP)/$(PRODUCT)02.xml
177        -@rm -f $(DIRTMP)/$(PRODUCT)02_dblatex.err
178        -@rm -f $(DIRTMP)/$(PRODUCT)02_dblatex.log
179        -@rm -f $(DIRTMP)/$(PRODUCT)many01.xml
180        -@rm -f $(DIRTMP)/$(PRODUCT)many02.xml
181        -@rm -f $(DIRTMP)/titlepage.$(PRODUCT).xsl
182        -@rm -f $(DIRTMP)/user_db.xml
183        -@rm -f $(DIRTMP)/template_beforesed.php
184        -@rm -f $(DIRTMP)/template_db.xml
185
186dbkcheck :
187        @-rm $(DIRTMP)/err_xmlstarlet_xsd 2> /dev/null
188        @for file in $(DIRSRC)/biblio.xml $(DIRTMP)/*_full.xml $(DIRTMP)/select_id.xml $(DIRTMP)/superbib01.xml $(DIRTMP)/superbib02.xml $(DIRTMP)/$(PRODUCT)many01.xml $(DIRTMP)/$(PRODUCT)many02.xml $(DIRTMP)/user_db.xml $(DIRTMP)/template_db.xml; do \
189        xml val --err \
190        --xsd http://www.docbook.org/xml/5.0/xsd/docbook.xsd \
191        $${file} 1>> $(DIRTMP)/err_xmlstarlet_xsd 2>&1; done
192        @echo "check for valid diag for each file in $(DIRTMP)/err_xmlstarlet_xsd"
193
194all : \
195html
196
197html : \
198html_en
199
200doc : \
201$(DIRDOC)/images/$(PRODUCT)_fulldependencies.png \
202$(DIRDOC)/images/$(PRODUCT)_fulldependencies.svg
203
204htmllinkcheckb :
205        @linkchecker.sh -d $(DIRWWW)
206
207htmllinkchecka :
208        @linkchecker.sh -d $(DIRPUBLISH)
209        @linkchecker.sh -u $(URLPUBLISH)
210
211html_en : \
212$(DIRWWW)/en/one/main.php \
213$(DIRWWW)/en/one/template.php \
214$(DIRWWW)/en/one/$(PRODUCT)00.html \
215$(DIRWWW)/en/one/$(PRODUCT)01.html \
216$(DIRWWW)/en/one/$(PRODUCT)02.html \
217$(DIRWWW)/en/many/$(PRODUCT)01/ \
218$(DIRWWW)/en/many/$(PRODUCT)02/ \
219$(DIRWWW)/en/one/user.html
220
221pdf_en : \
222$(DIRTMP)/$(PRODUCT)01.pdf \
223$(DIRTMP)/$(PRODUCT)02.pdf
224
225$(DIRWWW)/en/one/$(PRODUCT)00.html : \
226$(DIRSRC)/biblio.xml
227        @xsltproc \
228        --output $@ \
229        http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl \
230        $(DIRSRC)/biblio.xml
231
232$(DIRWWW)/en/one/main.php : \
233$(DIRSRC)/$(PRODUCT).css \
234$(DIRSRC)/style.css \
235$(DIRSRC)/main_html.xsl \
236$(DIRSRC)/message_lang.xsl \
237$(DIRTMP)/titlepage.$(PRODUCT).xsl \
238$(DIRSRC)/form_html.xsl \
239$(DIRTMP)/main_full.xml
240        @xsltproc \
241        $(XSLPARAMHTML) \
242        --output $@ \
243        $(DIRSRC)/main_html.xsl \
244        $(DIRTMP)/main_full.xml
245
246$(DIRWWW)/en/one/$(PRODUCT)01.html : \
247$(DIRWWW)/images/years.png \
248$(DIRSRC)/$(PRODUCT).css \
249$(DIRSRC)/style.css \
250$(DIRSRC)/$(PRODUCT)01_html.xsl \
251$(DIRSRC)/message_lang.xsl \
252$(DIRTMP)/titlepage.$(PRODUCT).xsl \
253$(DIRTMP)/$(PRODUCT)01.xml
254        @xsltproc \
255        $(XSLPARAMHTML) \
256        --output $@ \
257        $(DIRSRC)/$(PRODUCT)01_html.xsl \
258        $(DIRTMP)/$(PRODUCT)01.xml
259
260$(DIRTMP)/$(PRODUCT)01.xml : \
261$(DIRSRC)/$(PRODUCT)01_xml.xsl \
262$(DIRSRC)/message_lang.xsl \
263$(DIRSRC)/biblioentry_xml.xsl \
264$(DIRSRC)/biblio.xml
265        @xsltproc \
266        --output $@ \
267        $(DIRSRC)/$(PRODUCT)01_xml.xsl \
268        $(DIRSRC)/biblio.xml
269
270$(DIRWWW)/en/one/$(PRODUCT)02.html : \
271$(DIRSRC)/$(PRODUCT).css \
272$(DIRSRC)/style.css \
273$(DIRSRC)/$(PRODUCT)01_html.xsl \
274$(DIRSRC)/message_lang.xsl \
275$(DIRTMP)/titlepage.$(PRODUCT).xsl \
276$(DIRTMP)/$(PRODUCT)02.xml
277        @xsltproc \
278        $(XSLPARAMHTML) \
279        --output $@ \
280        $(DIRSRC)/$(PRODUCT)01_html.xsl \
281        $(DIRTMP)/$(PRODUCT)02.xml
282
283$(DIRWWW)/en/many/$(PRODUCT)02/ : \
284$(DIRSRC)/$(PRODUCT).css \
285$(DIRSRC)/style.css \
286$(DIRSRC)/$(PRODUCT)many02_html.xsl \
287$(DIRSRC)/message_lang.xsl \
288$(DIRTMP)/titlepage.$(PRODUCT).xsl \
289$(DIRSRC)/form_html.xsl \
290$(DIRTMP)/$(PRODUCT)many02.xml
291        @xsltproc \
292        $(XSLPARAMHTML) \
293        --param html.ext "'.php'" \
294        --param base.dir "'$@/'" \
295        $(DIRSRC)/$(PRODUCT)many02_html.xsl \
296        $(DIRTMP)/$(PRODUCT)many02.xml
297        # affreux sed
298        for file in $(DIRWWW)/en/many/$(PRODUCT)02/*.php; do \
299         sed -f insertphp_many.sed $${file} > $${file}_sed ; \
300         mv $${file}_sed $${file} ; \
301        done
302        @touch $@/
303
304$(DIRTMP)/$(PRODUCT)many02.xml : \
305$(DIRSRC)/$(PRODUCT)many02_xml.xsl \
306$(DIRSRC)/message_lang.xsl \
307$(DIRSRC)/form_db.xsl \
308$(DIRSRC)/compilers_db.xsl \
309$(DIRSRC)/components_db.xsl \
310$(DIRSRC)/platforms_db.xsl \
311$(DIRSRC)/personal_db.xsl \
312$(DIRSRC)/comments_db.xsl \
313$(DIRSRC)/newreferences_db.xsl \
314$(DIRSRC)/processors_db.xsl \
315$(DIRSRC)/biblioentry_xml.xsl \
316$(DIRSRC)/correction_db.xsl \
317$(DIRSRC)/firstname_id.xsl \
318$(DIRSRC)/surname_id.xsl \
319$(DIRSRC)/biblio.xml
320        @xsltproc \
321        --param html.ext "'.php'" \
322        --param link.mailto.url "'mailto:opatlod@locean-ipsl.upmc.fr'" \
323        --output $@ \
324        $(DIRSRC)/$(PRODUCT)many02_xml.xsl \
325        $(DIRSRC)/biblio.xml
326
327$(DIRWWW)/en/many/$(PRODUCT)01/ : \
328$(DIRSRC)/$(PRODUCT).css \
329$(DIRSRC)/style.css \
330$(DIRSRC)/$(PRODUCT)many01_html.xsl \
331$(DIRSRC)/message_lang.xsl \
332$(DIRTMP)/titlepage.$(PRODUCT).xsl \
333$(DIRTMP)/$(PRODUCT)many01.xml
334        @xsltproc \
335        $(XSLPARAMHTML) \
336        --param base.dir "'$@/'" \
337        $(DIRSRC)/$(PRODUCT)many01_html.xsl \
338        $(DIRTMP)/$(PRODUCT)many01.xml
339        @touch $@/
340
341$(DIRTMP)/$(PRODUCT)many01.xml : \
342$(DIRSRC)/$(PRODUCT)many01_xml.xsl \
343$(DIRSRC)/message_lang.xsl \
344$(DIRSRC)/firstname_id.xsl \
345$(DIRSRC)/surname_id.xsl \
346$(DIRSRC)/table_authors.xsl \
347$(DIRSRC)/biblioentry_xml.xsl \
348$(DIRSRC)/correction_db.xsl \
349$(DIRSRC)/biblio.xml
350        @xsltproc \
351        --param html.ext "'.html'" \
352        --output $@ \
353        $(DIRSRC)/$(PRODUCT)many01_xml.xsl \
354        $(DIRSRC)/biblio.xml
355
356$(DIRTMP)/$(PRODUCT)02.xml : \
357$(DIRSRC)/$(PRODUCT)02_xml.xsl \
358$(DIRSRC)/message_lang.xsl \
359$(DIRSRC)/firstname_id.xsl \
360$(DIRSRC)/surname_id.xsl \
361$(DIRSRC)/table_authors.xsl \
362$(DIRSRC)/biblioentry_xml.xsl \
363$(DIRSRC)/correction_db.xsl \
364$(DIRSRC)/biblio.xml
365        @xsltproc \
366        --param html.ext "'.html'" \
367        --output $@ \
368        $(DIRSRC)/$(PRODUCT)02_xml.xsl \
369        $(DIRSRC)/biblio.xml
370
371$(DIRTMP)/titlepage.$(PRODUCT).xsl : \
372$(DIRSRC)/titlepage.$(PRODUCT).xml
373        @xsltproc \
374        --output $@ \
375        http://docbook.sourceforge.net/release/xsl/current/template/titlepage.xsl \
376        $(DIRSRC)/titlepage.$(PRODUCT).xml
377
378$(DIRWWW)/images/years.png : \
379$(DIRTMP)/years.ploticus
380        @ploticus -o $@ png $(DIRTMP)/years.ploticus
381
382$(DIRTMP)/years.ploticus : \
383$(DIRSRC)/years_ploticus.xsl \
384$(DIRSRC)/biblioentry_xml.xsl \
385$(DIRSRC)/biblio.xml
386        @xsltproc \
387        --param makedate "'$(MAKEDATE)'" \
388        --output $@ \
389        $(DIRSRC)/years_ploticus.xsl \
390        $(DIRSRC)/biblio.xml
391
392$(DIRTMP)/$(PRODUCT)01.pdf : \
393$(DIRSRC)/$(PRODUCT)_pdf.xsl \
394$(DIRTMP)/$(PRODUCT)01.xml
395        @dblatex \
396        -b pdftex \
397        -T simple \
398        -o $@ \
399        -d \
400        -x "--nonet" \
401        -p $(DIRSRC)/$(PRODUCT)_pdf.xsl \
402        $(DIRTMP)/$(PRODUCT)01.xml \
403        1> $(DIRTMP)/$(PRODUCT)01_dblatex.log \
404        2> $(DIRTMP)/$(PRODUCT)01_dblatex.err
405
406$(DIRTMP)/$(PRODUCT)02.pdf : \
407$(DIRSRC)/$(PRODUCT)_pdf.xsl \
408$(DIRSRC)/biblio.xml
409        @dblatex \
410        -b pdftex \
411        -T simple \
412        -o $@ \
413        -d \
414        -x "--nonet" \
415        -p $(DIRSRC)/$(PRODUCT)_pdf.xsl \
416        $(DIRSRC)/biblio.xml
417        1> $(DIRTMP)/$(PRODUCT)02_dblatex.log \
418        2> $(DIRTMP)/$(PRODUCT)02_dblatex.err
419
420$(DIRTMP)/main_full.xml : \
421$(DIRSRC)/main.xml \
422$(DIRSRC)/select_form.php \
423$(DIRTMP)/select_id.xml
424        @xmllint \
425        --xinclude \
426        --nonet \
427        --output $@ \
428        $(DIRSRC)/main.xml
429
430$(DIRTMP)/select_id.xml : \
431$(DIRSRC)/select_id.xsl \
432$(DIRSRC)/firstname_id.xsl \
433$(DIRSRC)/surname_id.xsl \
434$(DIRSRC)/biblio.xml
435        @xsltproc \
436        --output $@ \
437        $(DIRSRC)/select_id.xsl \
438        $(DIRSRC)/biblio.xml
439
440$(DIRWWW)/en/one/user.html : \
441$(DIRSRC)/$(PRODUCT).css \
442$(DIRSRC)/style.css \
443$(DIRSRC)/user_html.xsl \
444$(DIRSRC)/message_lang.xsl \
445$(DIRTMP)/titlepage.$(PRODUCT).xsl \
446$(DIRSRC)/form_html.xsl \
447$(DIRTMP)/user_db.xml
448        @xsltproc \
449        $(XSLPARAMHTML) \
450        --output $@ \
451        $(DIRSRC)/user_html.xsl \
452        $(DIRTMP)/user_db.xml
453
454$(DIRTMP)/user_db.xml : \
455$(DIRSRC)/user_db.xsl \
456$(DIRSRC)/message_lang.xsl \
457$(DIRSRC)/components_db.xsl \
458$(DIRSRC)/compilers_db.xsl \
459$(DIRSRC)/platforms_db.xsl \
460$(DIRSRC)/processors_db.xsl \
461$(DIRSRC)/user.xml
462        @xsltproc \
463        --output $@ \
464        $(DIRSRC)/user_db.xsl \
465        $(DIRSRC)/user.xml
466
467$(DIRSRC)/user.xml : \
468$(DIRSRC)/user.dtd
469        -@xmllint --noout --valid $(DIRSRC)/user.xml
470
471$(DIRWWW)/en/one/template.php : \
472$(DIRTMP)/template_beforesed.php
473        # affreux sed
474        @sed -f insertphp_one.sed $(DIRTMP)/template_beforesed.php > \
475        $@
476
477$(DIRTMP)/template_beforesed.php : \
478$(DIRSRC)/$(PRODUCT).css \
479$(DIRSRC)/style.css \
480$(DIRSRC)/main_html.xsl \
481$(DIRSRC)/message_lang.xsl \
482$(DIRTMP)/titlepage.$(PRODUCT).xsl \
483$(DIRSRC)/form_html.xsl \
484$(DIRTMP)/template_db.xml
485        @xsltproc \
486        $(XSLPARAMHTML) \
487        --param html.ext "'.php'" \
488        --output $@ \
489        $(DIRSRC)/main_html.xsl \
490        $(DIRTMP)/template_db.xml
491
492$(DIRTMP)/template_db.xml : \
493$(DIRSRC)/user.xml \
494$(DIRSRC)/template_db.xsl \
495$(DIRSRC)/message_lang.xsl \
496$(DIRSRC)/form_db.xsl \
497$(DIRSRC)/compilers_db.xsl \
498$(DIRSRC)/components_db.xsl \
499$(DIRSRC)/platforms_db.xsl \
500$(DIRSRC)/personal_db.xsl \
501$(DIRSRC)/comments_db.xsl \
502$(DIRSRC)/newreferences_db.xsl \
503$(DIRSRC)/processors_db.xsl \
504$(DIRSRC)/biblioentry_xml.xsl \
505$(DIRSRC)/correction_db.xsl
506        @xsltproc \
507        --param link.mailto.url "'mailto:opatlod@locean-ipsl.upmc.fr'" \
508        --output $@ \
509        $(DIRSRC)/template_db.xsl \
510        $(DIRSRC)/user.xml
511
512$(DIRDOC)/images/$(PRODUCT)_fulldependencies.png : \
513$(DIRDOC)/$(PRODUCT)_fulldependencies.dot
514        dot -Tpng $(DIRDOC)/$(PRODUCT)_fulldependencies.dot -o $@
515
516$(DIRDOC)/images/$(PRODUCT)_fulldependencies.svg : \
517$(DIRDOC)/$(PRODUCT)_fulldependencies.dot
518        dot -Tsvg $(DIRDOC)/$(PRODUCT)_fulldependencies.dot -o $@
519
520$(DIRDOC)/$(PRODUCT)_fulldependencies.dot : \
521$(DIRDOC)/$(PRODUCT)_fulldependencies.deps
522        @sfood-graph $(DIRDOC)/$(PRODUCT)_fulldependencies.deps > $@
523
524$(DIRDOC)/$(PRODUCT)_fulldependencies.deps : \
525$(DIRSRC)/makefile
526        @make2deps.sh -i $(DIRSRC)/makefile -o $@ -f
Note: See TracBrowser for help on using the repository browser.