1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
# This is an example Makefile for converting the docbook XML to
# PDF and HTML.
# This is quite a hack, a patch that integrates the call of the
# top level Makefile is welcome.
ifeq ($(CURDIR)x,x)
CURDIR = $(shell pwd)
endif
BOOKTARGET = desktop-course-book.pdf
BOOKSOURCE = desktop-course-book.xml
DIRTARGETS = $(addsuffix stamp,$(wildcard */))
HTMLTARGETS = $(addsuffix .html,$(basename $(wildcard *.xml)))
PDFTARGETS = $(addsuffix .pdf,$(basename $(wildcard *.xml)))
all: $(DIRTARGETS) $(HTMLTARGETS) $(PDFTARGETS)
XSLTPROC = /usr/bin/xsltproc
DBLATEX = /usr/bin/dblatex
DBLATEXOPTS = -P doc.lot.show='' -Ichapter1 -Ichapter2 -Ichapter3 -Ichapter4 -Ichapter5 -Ichapter6 -Ichapter7 -Ichapter8 -Ichapter9 -Ichapter10 -Ichapter11
XSL ?= $(CURDIR)/lib/ubuntu.xsl
%/stamp: %/
@$(MAKE) CURDIR=$(CURDIR) XSL=$(XSL) -f $(CURDIR)/Makefile -C $<
# If you need to specify a custom XSL here, dblatex accepts the -p switch
%.pdf: %.xml
@$(DBLATEX) $(DBLATEXOPTS) -tpdf -o $@ $<
%.html: %.xml $(XSL)
@$(XSLTPROC) -o $@ $(XSL) $<
book:
@$(DBLATEX) $(DBLATEXOPTS) -tpdf -o $(BOOKTARGET) $(BOOKSOURCE)
clean:
@rm -f *.html *.pdf */*.html */*.pdf
#.PHONY: $(DIRTARGETS)
|