source: trunk/makefile @ 56

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

migration to docbook5 for biblio.xml; bug fix in bibopa.sh; xmlto is not anymore needed; xml(starlet) must be available

  • Property svn:keywords set to Id
File size: 13.2 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_en \
100htmllinkchecka \
101htmllinkcheckb \
102install \
103pdf_en
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_en"
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_en
196
197doc : \
198$(DIRDOC)/images/$(PRODUCT)_fulldependencies.png \
199$(DIRDOC)/images/$(PRODUCT)_fulldependencies.svg
200
201htmllinkcheckb :
202        @linkchecker.sh -d $(DIRWWW)
203
204htmllinkchecka :
205        @linkchecker.sh -d $(DIRPUBLISH)
206        @linkchecker.sh -u $(URLPUBLISH)
207
208html_en : \
209$(DIRWWW)/en/one/main.php \
210$(DIRWWW)/en/one/template.php \
211$(DIRWWW)/en/one/$(PRODUCT)00.html \
212$(DIRWWW)/en/one/$(PRODUCT)01.html \
213$(DIRWWW)/en/one/$(PRODUCT)02.html \
214$(DIRWWW)/en/many/$(PRODUCT)01/ \
215$(DIRWWW)/en/many/$(PRODUCT)02/ \
216$(DIRWWW)/en/one/user.html
217
218pdf_en : \
219$(DIRTMP)/$(PRODUCT)01.pdf \
220$(DIRTMP)/$(PRODUCT)02.pdf
221
222$(DIRWWW)/en/one/$(PRODUCT)00.html : \
223$(DIRSRC)/biblio.xml
224        @xsltproc \
225        --output $@ \
226        http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl \
227        $(DIRSRC)/biblio.xml
228
229$(DIRWWW)/en/one/main.php : \
230$(DIRSRC)/$(PRODUCT).css \
231$(DIRSRC)/style.css \
232$(DIRSRC)/main_html.xsl \
233$(DIRTMP)/titlepage.$(PRODUCT).xsl \
234$(DIRSRC)/form_html.xsl \
235$(DIRTMP)/main_full.xml
236        @xsltproc \
237        $(XSLPARAMHTML) \
238        --output $@ \
239        $(DIRSRC)/main_html.xsl \
240        $(DIRTMP)/main_full.xml
241
242$(DIRWWW)/en/one/$(PRODUCT)01.html : \
243$(DIRWWW)/images/years.png \
244$(DIRSRC)/$(PRODUCT).css \
245$(DIRSRC)/style.css \
246$(DIRSRC)/$(PRODUCT)01_html.xsl \
247$(DIRTMP)/titlepage.$(PRODUCT).xsl \
248$(DIRTMP)/$(PRODUCT)01.xml
249        @xsltproc \
250        $(XSLPARAMHTML) \
251        --output $@ \
252        $(DIRSRC)/$(PRODUCT)01_html.xsl \
253        $(DIRTMP)/$(PRODUCT)01.xml
254
255$(DIRTMP)/$(PRODUCT)01.xml : \
256$(DIRSRC)/$(PRODUCT)01_xml.xsl \
257$(DIRSRC)/biblioentry_xml.xsl \
258$(DIRSRC)/biblio.xml
259        @xsltproc \
260        --output $@ \
261        $(DIRSRC)/$(PRODUCT)01_xml.xsl \
262        $(DIRSRC)/biblio.xml
263
264$(DIRWWW)/en/one/$(PRODUCT)02.html : \
265$(DIRSRC)/$(PRODUCT).css \
266$(DIRSRC)/style.css \
267$(DIRSRC)/$(PRODUCT)01_html.xsl \
268$(DIRTMP)/titlepage.$(PRODUCT).xsl \
269$(DIRTMP)/$(PRODUCT)02.xml
270        @xsltproc \
271        $(XSLPARAMHTML) \
272        --output $@ \
273        $(DIRSRC)/$(PRODUCT)01_html.xsl \
274        $(DIRTMP)/$(PRODUCT)02.xml
275
276$(DIRWWW)/en/many/$(PRODUCT)02/ : \
277$(DIRSRC)/$(PRODUCT).css \
278$(DIRSRC)/style.css \
279$(DIRSRC)/$(PRODUCT)many02_html.xsl \
280$(DIRTMP)/titlepage.$(PRODUCT).xsl \
281$(DIRSRC)/form_html.xsl \
282$(DIRTMP)/$(PRODUCT)many02.xml
283        @xsltproc \
284        $(XSLPARAMHTML) \
285        --param html.ext "'.php'" \
286        --param base.dir "'$@/'" \
287        $(DIRSRC)/$(PRODUCT)many02_html.xsl \
288        $(DIRTMP)/$(PRODUCT)many02.xml
289        # affreux sed
290        for file in $(DIRWWW)/en/many/$(PRODUCT)02/*.php; do \
291         sed -f insertphp_many.sed $${file} > $${file}_sed ; \
292         mv $${file}_sed $${file} ; \
293        done
294        @touch $@/
295
296$(DIRTMP)/$(PRODUCT)many02.xml : \
297$(DIRSRC)/$(PRODUCT)many02_xml.xsl \
298$(DIRSRC)/form_db.xsl \
299$(DIRSRC)/compilers_db.xsl \
300$(DIRSRC)/components_db.xsl \
301$(DIRSRC)/platforms_db.xsl \
302$(DIRSRC)/personal_db.xsl \
303$(DIRSRC)/comments_db.xsl \
304$(DIRSRC)/newreferences_db.xsl \
305$(DIRSRC)/processors_db.xsl \
306$(DIRSRC)/biblioentry_xml.xsl \
307$(DIRSRC)/correction_db.xsl \
308$(DIRSRC)/firstname_id.xsl \
309$(DIRSRC)/surname_id.xsl \
310$(DIRSRC)/biblio.xml
311        @xsltproc \
312        --param html.ext "'.php'" \
313        --param link.mailto.url "'mailto:opatlod@locean-ipsl.upmc.fr'" \
314        --output $@ \
315        $(DIRSRC)/$(PRODUCT)many02_xml.xsl \
316        $(DIRSRC)/biblio.xml
317
318$(DIRWWW)/en/many/$(PRODUCT)01/ : \
319$(DIRSRC)/$(PRODUCT).css \
320$(DIRSRC)/style.css \
321$(DIRSRC)/$(PRODUCT)many01_html.xsl \
322$(DIRTMP)/titlepage.$(PRODUCT).xsl \
323$(DIRTMP)/$(PRODUCT)many01.xml
324        @xsltproc \
325        $(XSLPARAMHTML) \
326        --param base.dir "'$@/'" \
327        $(DIRSRC)/$(PRODUCT)many01_html.xsl \
328        $(DIRTMP)/$(PRODUCT)many01.xml
329        @touch $@/
330
331$(DIRTMP)/$(PRODUCT)many01.xml : \
332$(DIRSRC)/$(PRODUCT)many01_xml.xsl \
333$(DIRSRC)/firstname_id.xsl \
334$(DIRSRC)/surname_id.xsl \
335$(DIRSRC)/table_authors.xsl \
336$(DIRSRC)/biblioentry_xml.xsl \
337$(DIRSRC)/correction_db.xsl \
338$(DIRSRC)/biblio.xml
339        @xsltproc \
340        --param html.ext "'.html'" \
341        --output $@ \
342        $(DIRSRC)/$(PRODUCT)many01_xml.xsl \
343        $(DIRSRC)/biblio.xml
344
345$(DIRTMP)/$(PRODUCT)02.xml : \
346$(DIRSRC)/$(PRODUCT)02_xml.xsl \
347$(DIRSRC)/firstname_id.xsl \
348$(DIRSRC)/surname_id.xsl \
349$(DIRSRC)/table_authors.xsl \
350$(DIRSRC)/biblioentry_xml.xsl \
351$(DIRSRC)/correction_db.xsl \
352$(DIRSRC)/biblio.xml
353        @xsltproc \
354        --param html.ext "'.html'" \
355        --output $@ \
356        $(DIRSRC)/$(PRODUCT)02_xml.xsl \
357        $(DIRSRC)/biblio.xml
358
359$(DIRTMP)/titlepage.$(PRODUCT).xsl : \
360$(DIRSRC)/titlepage.$(PRODUCT).xml
361        @xsltproc \
362        --output $@ \
363        http://docbook.sourceforge.net/release/xsl/current/template/titlepage.xsl \
364        $(DIRSRC)/titlepage.$(PRODUCT).xml
365
366$(DIRWWW)/images/years.png : \
367$(DIRTMP)/years.ploticus
368        @ploticus -o $@ png $(DIRTMP)/years.ploticus
369
370$(DIRTMP)/years.ploticus : \
371$(DIRSRC)/years_ploticus.xsl \
372$(DIRSRC)/biblioentry_xml.xsl \
373$(DIRSRC)/biblio.xml
374        @xsltproc \
375        --param makedate "'$(MAKEDATE)'" \
376        --output $@ \
377        $(DIRSRC)/years_ploticus.xsl \
378        $(DIRSRC)/biblio.xml
379
380$(DIRTMP)/$(PRODUCT)01.pdf : \
381$(DIRSRC)/$(PRODUCT)_pdf.xsl \
382$(DIRTMP)/$(PRODUCT)01.xml
383        @dblatex \
384        -b pdftex \
385        -T simple \
386        -o $@ \
387        -d \
388        -x "--nonet" \
389        -p $(DIRSRC)/$(PRODUCT)_pdf.xsl \
390        $(DIRTMP)/$(PRODUCT)01.xml \
391        1> $(DIRTMP)/$(PRODUCT)01_dblatex.log \
392        2> $(DIRTMP)/$(PRODUCT)01_dblatex.err
393
394$(DIRTMP)/$(PRODUCT)02.pdf : \
395$(DIRSRC)/$(PRODUCT)_pdf.xsl \
396$(DIRSRC)/biblio.xml
397        @dblatex \
398        -b pdftex \
399        -T simple \
400        -o $@ \
401        -d \
402        -x "--nonet" \
403        -p $(DIRSRC)/$(PRODUCT)_pdf.xsl \
404        $(DIRSRC)/biblio.xml
405        1> $(DIRTMP)/$(PRODUCT)02_dblatex.log \
406        2> $(DIRTMP)/$(PRODUCT)02_dblatex.err
407
408$(DIRTMP)/main_full.xml : \
409$(DIRSRC)/main.xml \
410$(DIRSRC)/select_form.php \
411$(DIRTMP)/select_id.xml
412        @xmllint \
413        --xinclude \
414        --nonet \
415        --output $@ \
416        $(DIRSRC)/main.xml
417
418$(DIRTMP)/select_id.xml : \
419$(DIRSRC)/select_id.xsl \
420$(DIRSRC)/firstname_id.xsl \
421$(DIRSRC)/surname_id.xsl \
422$(DIRSRC)/biblio.xml
423        @xsltproc \
424        --output $@ \
425        $(DIRSRC)/select_id.xsl \
426        $(DIRSRC)/biblio.xml
427
428$(DIRWWW)/en/one/user.html : \
429$(DIRSRC)/$(PRODUCT).css \
430$(DIRSRC)/style.css \
431$(DIRSRC)/user_html.xsl \
432$(DIRTMP)/titlepage.$(PRODUCT).xsl \
433$(DIRSRC)/form_html.xsl \
434$(DIRTMP)/user_db.xml
435        @xsltproc \
436        $(XSLPARAMHTML) \
437        --output $@ \
438        $(DIRSRC)/user_html.xsl \
439        $(DIRTMP)/user_db.xml
440
441$(DIRTMP)/user_db.xml : \
442$(DIRSRC)/user_db.xsl \
443$(DIRSRC)/components_db.xsl \
444$(DIRSRC)/compilers_db.xsl \
445$(DIRSRC)/platforms_db.xsl \
446$(DIRSRC)/processors_db.xsl \
447$(DIRSRC)/user.xml
448        @xsltproc \
449        --output $@ \
450        $(DIRSRC)/user_db.xsl \
451        $(DIRSRC)/user.xml
452
453$(DIRSRC)/user.xml : \
454$(DIRSRC)/user.dtd
455        -@xmllint --noout --valid $(DIRSRC)/user.xml
456
457$(DIRWWW)/en/one/template.php : \
458$(DIRTMP)/template_beforesed.php
459        # affreux sed
460        @sed -f insertphp_one.sed $(DIRTMP)/template_beforesed.php > \
461        $@
462
463$(DIRTMP)/template_beforesed.php : \
464$(DIRSRC)/$(PRODUCT).css \
465$(DIRSRC)/style.css \
466$(DIRSRC)/main_html.xsl \
467$(DIRTMP)/titlepage.$(PRODUCT).xsl \
468$(DIRSRC)/form_html.xsl \
469$(DIRTMP)/template_db.xml
470        @xsltproc \
471        $(XSLPARAMHTML) \
472        --param html.ext "'.php'" \
473        --output $@ \
474        $(DIRSRC)/main_html.xsl \
475        $(DIRTMP)/template_db.xml
476
477$(DIRTMP)/template_db.xml : \
478$(DIRSRC)/user.xml \
479$(DIRSRC)/template_db.xsl \
480$(DIRSRC)/form_db.xsl \
481$(DIRSRC)/compilers_db.xsl \
482$(DIRSRC)/components_db.xsl \
483$(DIRSRC)/platforms_db.xsl \
484$(DIRSRC)/personal_db.xsl \
485$(DIRSRC)/comments_db.xsl \
486$(DIRSRC)/newreferences_db.xsl \
487$(DIRSRC)/processors_db.xsl \
488$(DIRSRC)/biblioentry_xml.xsl \
489$(DIRSRC)/correction_db.xsl
490        @xsltproc \
491        --param link.mailto.url "'mailto:opatlod@locean-ipsl.upmc.fr'" \
492        --output $@ \
493        $(DIRSRC)/template_db.xsl \
494        $(DIRSRC)/user.xml
495
496$(DIRDOC)/images/$(PRODUCT)_fulldependencies.png : \
497$(DIRDOC)/$(PRODUCT)_fulldependencies.dot
498        dot -Tpng $(DIRDOC)/$(PRODUCT)_fulldependencies.dot -o $@
499
500$(DIRDOC)/images/$(PRODUCT)_fulldependencies.svg : \
501$(DIRDOC)/$(PRODUCT)_fulldependencies.dot
502        dot -Tsvg $(DIRDOC)/$(PRODUCT)_fulldependencies.dot -o $@
503
504$(DIRDOC)/$(PRODUCT)_fulldependencies.dot : \
505$(DIRDOC)/$(PRODUCT)_fulldependencies.deps
506        @sfood-graph $(DIRDOC)/$(PRODUCT)_fulldependencies.deps > $@
507
508$(DIRDOC)/$(PRODUCT)_fulldependencies.deps : \
509$(DIRSRC)/makefile
510        @make2deps.sh -i $(DIRSRC)/makefile -o $@ -f
Note: See TracBrowser for help on using the repository browser.