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