1 | BASEDIR=~/lfs-book
|
---|
2 | CHUNK_QUIET=0
|
---|
3 | PDF_OUTPUT=LFS-BOOK.pdf
|
---|
4 | NOCHUNKS_OUTPUT=LFS-BOOK.html
|
---|
5 | XSLROOTDIR=/usr/share/xml/docbook/xsl-stylesheets-current
|
---|
6 |
|
---|
7 | lfs:
|
---|
8 | xsltproc --xinclude --nonet -stringparam chunk.quietly $(CHUNK_QUIET) \
|
---|
9 | -stringparam base.dir $(BASEDIR)/ stylesheets/lfs-chunked.xsl \
|
---|
10 | index.xml
|
---|
11 |
|
---|
12 | if [ ! -e $(BASEDIR)/stylesheets ]; then \
|
---|
13 | mkdir -p $(BASEDIR)/stylesheets; \
|
---|
14 | fi;
|
---|
15 | cp stylesheets/*.css $(BASEDIR)/stylesheets
|
---|
16 |
|
---|
17 | if [ ! -e $(BASEDIR)/images ]; then \
|
---|
18 | mkdir -p $(BASEDIR)/images; \
|
---|
19 | fi;
|
---|
20 | cp $(XSLROOTDIR)/images/*.png \
|
---|
21 | $(BASEDIR)/images
|
---|
22 | cd $(BASEDIR)/; sed -i -e "s@../stylesheets@stylesheets@g" \
|
---|
23 | *.html
|
---|
24 | cd $(BASEDIR)/; sed -i -e "s@../images@images@g" \
|
---|
25 | *.html
|
---|
26 |
|
---|
27 | sh goTidy $(BASEDIR)/
|
---|
28 |
|
---|
29 | #
|
---|
30 | # This is the old "pdf" target. The old "print" target below has been
|
---|
31 | # renamed to "pdf" and will be used. This commented out previous_pdf
|
---|
32 | # target can be removed eventually. It'll remain here for a bit for
|
---|
33 | # historical reasons
|
---|
34 | #
|
---|
35 | #previous_pdf:
|
---|
36 | # xsltproc --xinclude --nonet --output $(BASEDIR)/lfs.fo stylesheets/lfs-pdf.xsl \
|
---|
37 | # index.xml
|
---|
38 | # sed -i -e "s/inherit/all/" $(BASEDIR)/lfs.fo
|
---|
39 | # fop.sh $(BASEDIR)/lfs.fo $(BASEDIR)/$(PDF_OUTPUT)
|
---|
40 | # rm lfs.fo
|
---|
41 |
|
---|
42 | pdf:
|
---|
43 | xsltproc --xinclude --nonet --stringparam profile.condition print \
|
---|
44 | --output $(BASEDIR)/lfs-pdf.xml stylesheets/lfs-profile.xsl index.xml
|
---|
45 | xsltproc --nonet --output $(BASEDIR)/lfs-pdf.fo stylesheets/lfs-pdf.xsl \
|
---|
46 | $(BASEDIR)/lfs-pdf.xml
|
---|
47 | sed -i -e "s/inherit/all/" $(BASEDIR)/lfs-pdf.fo
|
---|
48 | fop.sh $(BASEDIR)/lfs-pdf.fo $(BASEDIR)/$(PDF_OUTPUT)
|
---|
49 | rm $(BASEDIR)/lfs-pdf.xml $(BASEDIR)/lfs-pdf.fo
|
---|
50 |
|
---|
51 | nochunks:
|
---|
52 | xsltproc --xinclude --nonet --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
|
---|
53 | stylesheets/lfs-nochunks.xsl index.xml
|
---|
54 | tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
|
---|
55 |
|
---|
56 | validate:
|
---|
57 | xmllint --noout --nonet --xinclude --postvalid index.xml
|
---|
58 |
|
---|