/[volute]/trunk/projects/edu/edumatters/Makefile
ViewVC logotype

Contents of /trunk/projects/edu/edumatters/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2303 - (show annotations)
Wed Oct 2 04:39:41 2013 UTC (8 years ago) by volute@g-vo.org
File size: 4025 byte(s)
title, adding ivoadoc externals.

1 # Makefile to drive ivoadoc.
2 #
3 # To use this, you must have checked out ivoadoc as svn:externals into
4 # your document directory. Copy this Makefile into that directory and
5 # edit it as necessary.
6 #
7 # To make this work, you need xalan and fop; on Debian systems, the following
8 # should do the trick:
9 #
10 # sudo aptitude install xalan fop w3c-dtd-xhtml
11 #
12 # You most likely want the hyphenation patterns for fop (the PDF
13 # formatter), too. Presumably for licensing reasons, you have to
14 # get them manually from http://offo.sourceforge.net. Drop them
15 # into /usr/share/fop/fop-hyph.jar (that's FOPHYPH below)
16 #
17 # Edit your source as $(STDNAME).html; available targets then are:
18 #
19 # * default: format the html, expanding the magic things explained in
20 # ivoadoc/README
21 # * $(STDNAME).pdf: same, but make a pdf
22 # * package: package the docs, css, all pngs and whatever is in
23 # PACKAGE_EXTRAS into an aptly-named zip that expands into a
24 # nicely-named subdirectory.
25 # * biblio: remake the bibliography (this is never done automatically).
26 # Unless you try the experimental includebibliography PI, you have
27 # to manually insert the result into your HTML.
28 #
29 # Contact for this Makefile: Markus Demleitner (gavo@ari.uni-heidelberg.de)
30 #
31 # Fix (and maintain, as you go on) the following set of variables:
32 #
33 # The base name of the files (a sensible abbreviation of your standard's
34 # title; this is case sensitive)
35 STDNAME=edumatters
36 # The current version
37 DOCVERSION=1.0
38 # YYYYMMDD of the current release
39 DOCDATE=20130909
40 # One of NOTE, WD, PR, REC
41 PUBSTATUS=NOTE
42 # Extra files that need to end up in the final package
43 # (pngs are included automatically)
44 PACKAGE_EXTRAS=
45
46
47 # You probably want to configure your system so the following works
48 # Basically, RESOLVERJAR must eventally point to a jar of apache
49 # xml commons resolver, and SAXONJAR to a jar containing saxon-b
50 #
51 # For Debian Squeeze, you need to install the backported fop to make
52 # this work.
53
54 CATALOG=ivoadoc/xmlcatalog/catalog.xml
55 FOPHYPH=/usr/share/fop/fop-hyph.jar
56
57 JARROOT=/usr/share/java
58 RESOLVERJAR=$(JARROOT)/xml-resolver.jar
59 SAXONJAR=$(JARROOT)/saxonb.jar
60 SAXON=java -cp $(RESOLVERJAR):$(SAXONJAR) \
61 -Dxml.catalog.files=$(CATALOG) -Dxml.catalog.verbosity=1\
62 net.sf.saxon.Transform\
63 -novw -r org.apache.xml.resolver.tools.CatalogResolver\
64 -x org.apache.xml.resolver.tools.ResolvingXMLReader\
65 -y org.apache.xml.resolver.tools.ResolvingXMLReader
66 BIBTEX=bibtex
67 SED=sed
68
69 # TODO: make fop use our custom catalog
70 FOP=FOP_HYPHENATION_PATH=$(FOPHYPH) fop -catalog
71
72 HTMLSTYLE=ivoadoc/ivoarestructure.xslt
73 FOSTYLE=ivoadoc/ivoa-fo.xsl
74 CITEEXSTYLE=ivoadoc/extractcite.xslt
75
76 # You should not need to edit anything below this line
77
78 versionedName:=$(PUBSTATUS)-$(STDNAME)-$(DOCVERSION)
79 ifneq "$(PUBSTATUS)" "REC"
80 versionedName:=$(versionedName)-$(subst -,,$(DOCDATE))
81 endif
82
83 .PHONY: package
84
85 %-fmt.html: %.html $(HTMLSTYLE)
86 $(SAXON) -o $@ $< $(HTMLSTYLE) docdate=$(DOCDATE)\
87 docversion=$(DOCVERSION) pubstatus=$(PUBSTATUS) ivoname=$(STDNAME)
88
89 %.fo: %-fmt.html
90 $(SAXON) -o $@ $< $(FOSTYLE) docdate=$(DOCDATE)\
91 docversion=$(DOCVERSION) pubstatus=$(PUBSTATUS) ivoname=$(STDNAME)
92
93 %.pdf: %.fo
94 $(FOP) -pdf $@ -fo $<
95
96 # this is for BibTex
97 %.aux: %.html
98 $(SAXON) -o:$@ -xsl:$(CITEEXSTYLE) -s:$<
99
100 %.bbl: %.aux
101 $(BIBTEX) $<
102 $(SED) -f ivoadoc/detex.sed $@ > $@.tmp
103 mv $@.tmp $@
104
105 default: $(STDNAME)-fmt.html
106
107 cleanbbl:
108 rm -f $(STDNAME).bbl
109
110 biblio: cleanbbl $(STDNAME).bbl
111
112 package: $(STDNAME)-fmt.html $(STDNAME).pdf
113 rm -rf -- $(versionedName)
114 mkdir $(versionedName)
115 cp $(STDNAME)-fmt.html $(versionedName)/$(versionedName).html
116 cp $(STDNAME).pdf $(versionedName)/$(versionedName).pdf
117 mkdir $(versionedName)/ivoadoc
118 cp ivoadoc/*.css $(versionedName)/ivoadoc
119 cp *.png $(SCHEMA_FILE) $(PACKAGE_EXTRAS) $(versionedName)
120 zip -r $(versionedName).zip $(versionedName)
121 rm -rf -- $(versionedName)
122
123 clean:
124 rm -f $(PUBSTATUS)-$(STDNAME)-*.html
125 rm -f $(PUBSTATUS)-$(STDNAME)-*.pdf
126 rm -f $(STDNAME).pdf
127 rm -fr $(PUBSTATUS)-$(STDNAME)*.zip
128
129 -include make.local

msdemlei@ari.uni-heidelberg.de
ViewVC Help
Powered by ViewVC 1.1.26