[8557] | 1 | # -*- coding: unix -*- |
---|
| 2 | # Use xsltproc and an XSL stylesheet to translate DocBook XML to HTML |
---|
| 3 | # This require GNU "make", GNU "tar", Posix "find", Posix "date", and |
---|
| 4 | # "bzip2". All those external dependencies are, of course, less than |
---|
| 5 | # ideal. |
---|
| 6 | |
---|
| 7 | # for Linux (Fedora; other distros may require some tweaking.) |
---|
| 8 | |
---|
| 9 | # The pathname to the xsltproc executable. Since most alternate |
---|
| 10 | # translators use Java, this makefile would need to be rewritten to use |
---|
| 11 | # anything but xsltproc. |
---|
| 12 | |
---|
| 13 | XSLTPROC = /usr/bin/xsltproc |
---|
| 14 | |
---|
| 15 | |
---|
| 16 | # On a new system or when using a new version of xsltproc or of the |
---|
| 17 | # stylesheet packages, it's a good idea to run with --load-trace and |
---|
| 18 | # peruse the output to make sure that none of the stylesheets are being |
---|
| 19 | # pulled over the network. It's a significant expense, compounded by |
---|
| 20 | # the fact that they aren't cached across invocations of xsltproc. If they |
---|
| 21 | # are, you should make sure that the correct catalog file is being used |
---|
| 22 | # (see below), and, if so, that its contents are correct. |
---|
| 23 | #EXTRAPARAMS= --load-trace |
---|
[8568] | 24 | EXTRAPARAMS= --xinclude --nonet |
---|
[8557] | 25 | |
---|
| 26 | # The catalog file tells the translator where to find XSL stylesheets on the |
---|
| 27 | # local system. The first choice here is what should be used for builds |
---|
| 28 | # which are going to take place on the clozure.com server. The second is |
---|
| 29 | # for when you have installed docbook on OS X using the fink package manager. |
---|
| 30 | # If neither applies, comment both out, and the translator will automagically |
---|
| 31 | # look on the web for the stylesheets, instead. |
---|
| 32 | |
---|
| 33 | |
---|
| 34 | export XML_CATALOG_FILES = xsl/catalog-fedora |
---|
| 35 | |
---|
| 36 | # The local stylesheet imports the generic stylesheets and |
---|
| 37 | # sets some custom parameters. |
---|
| 38 | |
---|
| 39 | STYLESHEET = xsl/openmcl.xsl |
---|
| 40 | |
---|
| 41 | # Obtain a temporary ID to be used as the identifier of this invocation of |
---|
| 42 | # make. |
---|
| 43 | |
---|
| 44 | TEMP := build-$(shell date +%s) |
---|
| 45 | |
---|
| 46 | # Save the current directory for use in the tarfile target. |
---|
| 47 | |
---|
| 48 | CWD := $(shell pwd) |
---|
| 49 | |
---|
| 50 | # There's datestamps on the page; let's make sure they're in |
---|
| 51 | # UTC instead of local time. |
---|
| 52 | |
---|
| 53 | export TZ = UTC |
---|
| 54 | |
---|
| 55 | # Compute some targets. |
---|
| 56 | |
---|
[9219] | 57 | XMLFILES = $(wildcard *.xml) |
---|
[8557] | 58 | XSLFILES = $(shell find xsl -name "*.xsl") |
---|
[8568] | 59 | HTMLFILES = ccl-documentation.html |
---|
[8557] | 60 | |
---|
| 61 | # Save the xsltproc version string for use in debugging. |
---|
| 62 | |
---|
| 63 | XSLTPROCVERSION = $(shell $(XSLTPROC) --version | head -n 1) |
---|
| 64 | |
---|
[9219] | 65 | # Try to determine the svn revishion |
---|
| 66 | SVNREV = $(shell /usr/bin/svnversion) |
---|
| 67 | |
---|
| 68 | |
---|
[8557] | 69 | .PHONY: all clean distclean |
---|
| 70 | |
---|
| 71 | all: $(TEMP) $(HTMLFILES) distclean |
---|
| 72 | |
---|
[8558] | 73 | include makehtml |
---|
[8557] | 74 | |
---|
[8570] | 75 | install: $(HTMLFILES) distclean |
---|
[9219] | 76 | cp $(HTMLFILES) ../ |
---|
[8558] | 77 | |
---|
[8557] | 78 | $(TEMP): |
---|
| 79 | mkdir $(TEMP) |
---|
| 80 | |
---|
| 81 | clean: |
---|
| 82 | rm -rf build-* |
---|
| 83 | |
---|
| 84 | distclean: clean |
---|
[8570] | 85 | rm -f *~ |
---|
[8557] | 86 | |
---|
| 87 | # All this rigamarole is to make the pathnames stored in the tarfile |
---|
| 88 | # have a uniform prefix regardless of where the build directory actually |
---|
| 89 | # is. Somebody, please tell me I have overlooked something obvious. |
---|
| 90 | |
---|