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