# DOCURI is the location of the document... DOCURI=http://www.ivoa.net/foo/bar VERSION=0.22 RELEASEDATE=2008 October 28 XSLTPROC=xsltproc BIBTEX=bibtex #XSLTPROC="/opt/local/bin/xsltproc" #BIBTEX="/usr/local/texlive/2007/bin/i386-darwin/bibtex" #RAPPER="/opt/local/bin/rapper" # The following is becoming unwieldy: it would seem better if the vocabularies.xml # and vocabularies-issues.xml files were replaced by foo.xml.in, and substituted # by configure. However that makes the build process that little bit more # opaque, so it's probably best overall to this as it is. edit=sed -e 's/@VERSION\@/$(VERSION)/g' \ -e 's/@RELEASEDATE\@/$(RELEASEDATE)/g' \ -e 's,@DOCURI\@,$(DOCURI),g' \ -e 's,\$$\([A-Z][A-Za-z]*:[^$$]*\)\$$,\1,g' #edit=sed -e 's/@VERSION\@/$(VERSION)/g' \ # -e 's/@RELEASEDATE\@/$(RELEASEDATE)/g' \ # -e 's,@DISTURI\@,$(DISTURI),g' \ # -e 's,@BASEURI\@,$(BASEURI),g' \ # -e 's,@DISTNAME\@,$(DISTNAME),g' \ # -e 's,@ISSUESLIST\@,$(ISSUESLIST),g' \ # -e 's,\$$\([A-Z][A-Za-z]*:[^$$]*\)\$$,\1,g' # Rules for creating note.xhtml from note.xml %.aux: %.xml structure.xslt rm -f $@ $@.tmp $(XSLTPROC) --stringparam document-id $< --stringparam target aux \ structure.xslt $< >$@.tmp && mv $@.tmp $@ # java -jar $(SAXONJAR) $< structure.xslt document-id=$< target=aux >$@.tmp && mv $@.tmp $@ # Use printf rather than echo, since difference echo implementations treat # \b in different ways (some as the pair of characters "\b", others as a backspace). printf '\\bibstyle{plainhtml}\n' >> $@ # Following relies on BIBINPUTS and BSTINPUTS being set OK. %.bbl: %.aux refs.bib rm -f $@ $@.tmp BSTINPUTS=. $(BIBTEX) $* sed -e '1s+
+
+' -f detex.sed $@ >$@.tmp && mv $@.tmp $@ # Convert .xml source to .xhtml output (which includes UTF-8 characters) %.xhtml: %.xml rm -f $@ $@.tmp $(XSLTPROC) --stringparam document-id $< structure.xslt $< | $(edit) >$@.tmp && mv $@.tmp $@ # java -jar $(SAXONJAR) $< structure.xslt document-id=$< | $(edit) >$@.tmp && mv $@.tmp $@ ## Check the RDFa content of vocabularies.xhtml #%.rdf: %.xhtml RDFa2RDFXML.xsl # rm -f $@ $@.tmp # $(XSLTPROC) RDFa2RDFXML.xsl $< >$@.tmp && mv $@.tmp $@ ## java -jar $(SAXONJAR) $< RDFa2RDFXML.xsl >$@.tmp && mv $@.tmp $@ # ## Reformat to Turtle #%.ttl: %.rdf # rm -f $@ $@.tmp # $(RAPPER) --output turtle $< $(BASEURI) >$@.tmp && mv $@.tmp $@ ######################################## # # Default target all: rest.xhtml # Add extra dependency rest.xhtml: rest.bbl ## Convert .xhtml to .html by doing an identity transformation using a ## stylesheet which uses the "html" output method. #rest.html: rest.xhtml # rm -f $@ $@.tmp # $(XSLTPROC) identity-html.xslt $< | sed -f to-entities.sed >$@.tmp && mv $@.tmp $@ ######################################## # # Extras ## This refers to a local copy of the current version of the script ## RDFa2RDFXML.xsl available from #RDFa2RDFXML.xsl: # curl http://ns.inria.fr/grddl/rdfa/2007/09/19/RDFa2RDFXML.xsl >$@ ######################################## # # Maintenance clean: rm -f *~ rest.xhtml rest.html rest.aux rest.bbl rest.blg rest.rdf rest.ttl tmp #realclean: clean # rm -f Makefile