[edb9842] | 1 | BASEDIR=~/lfs-book
|
---|
[2c5e4d5] | 2 | DUMPDIR=~/lfs-commands
|
---|
[44758be] | 3 | CHUNK_QUIET=0
|
---|
| 4 | PDF_OUTPUT=LFS-BOOK.pdf
|
---|
| 5 | NOCHUNKS_OUTPUT=LFS-BOOK.html
|
---|
[7b089c3f] | 6 | XSLROOTDIR=/usr/share/xml/docbook/xsl-stylesheets-1.69.1
|
---|
[287ea55] | 7 |
|
---|
[3a4594b] | 8 |
|
---|
[287ea55] | 9 | lfs:
|
---|
[81fd230] | 10 | xsltproc --xinclude --nonet -stringparam profile.condition html \
|
---|
[2fe5051a] | 11 | -stringparam chunk.quietly $(CHUNK_QUIET) -stringparam base.dir $(BASEDIR)/ \
|
---|
[81fd230] | 12 | stylesheets/lfs-chunked.xsl index.xml
|
---|
[287ea55] | 13 |
|
---|
[44758be] | 14 | if [ ! -e $(BASEDIR)/stylesheets ]; then \
|
---|
| 15 | mkdir -p $(BASEDIR)/stylesheets; \
|
---|
| 16 | fi;
|
---|
| 17 | cp stylesheets/*.css $(BASEDIR)/stylesheets
|
---|
| 18 |
|
---|
| 19 | if [ ! -e $(BASEDIR)/images ]; then \
|
---|
| 20 | mkdir -p $(BASEDIR)/images; \
|
---|
| 21 | fi;
|
---|
| 22 | cp $(XSLROOTDIR)/images/*.png \
|
---|
| 23 | $(BASEDIR)/images
|
---|
| 24 | cd $(BASEDIR)/; sed -i -e "s@../stylesheets@stylesheets@g" \
|
---|
[f7bd105] | 25 | *.html
|
---|
[44758be] | 26 | cd $(BASEDIR)/; sed -i -e "s@../images@images@g" \
|
---|
[f7bd105] | 27 | *.html
|
---|
[287ea55] | 28 |
|
---|
[fbb5e45] | 29 | for filename in `find $(BASEDIR) -name "*.html"`; do \
|
---|
[132fd16] | 30 | tidy -config tidy.conf $$filename; \
|
---|
| 31 | true; \
|
---|
| 32 | sh obfuscate.sh $$filename; \
|
---|
[3879ebc] | 33 | sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \
|
---|
| 34 | done;
|
---|
[5470c67] | 35 |
|
---|
[3a4594b] | 36 | $(MAKE) wget-list
|
---|
| 37 |
|
---|
| 38 | wget-list:
|
---|
[5470c67] | 39 | mkdir -p $(BASEDIR)
|
---|
| 40 | xsltproc --xinclude --nonet stylesheets/wget-list.xsl chapter03/chapter03.xml > $(BASEDIR)/wget-list
|
---|
[81fd230] | 41 |
|
---|
[395f415] | 42 | # Uncomment this for testing and stable versions
|
---|
| 43 | #pdf:
|
---|
| 44 | # xsltproc --xinclude --nonet --stringparam profile.condition pdf \
|
---|
| 45 | # --output $(BASEDIR)/lfs-pdf.xml stylesheets/lfs-profile.xsl index.xml
|
---|
| 46 | # xsltproc --nonet --output $(BASEDIR)/lfs-pdf.fo stylesheets/lfs-pdf.xsl \
|
---|
| 47 | # $(BASEDIR)/lfs-pdf.xml
|
---|
| 48 | # sed -i -e "s/inherit/all/" $(BASEDIR)/lfs-pdf.fo
|
---|
| 49 | # fop.sh $(BASEDIR)/lfs-pdf.fo $(BASEDIR)/$(PDF_OUTPUT)
|
---|
| 50 | # rm $(BASEDIR)/lfs-pdf.xml $(BASEDIR)/lfs-pdf.fo
|
---|
[287ea55] | 51 |
|
---|
[395f415] | 52 | # Remove this for testing and stable versions
|
---|
[536b6aa] | 53 | pdf:
|
---|
[395f415] | 54 | xsltproc --xinclude --nonet --output $(BASEDIR)/lfs-pdf.fo \
|
---|
| 55 | stylesheets/lfs-pdf.xsl index.xml
|
---|
[a03b9453] | 56 | sed -i -e "s/inherit/all/" $(BASEDIR)/lfs-pdf.fo
|
---|
| 57 | fop.sh $(BASEDIR)/lfs-pdf.fo $(BASEDIR)/$(PDF_OUTPUT)
|
---|
[395f415] | 58 | rm $(BASEDIR)/lfs-pdf.fo
|
---|
[91364a5] | 59 |
|
---|
| 60 | nochunks:
|
---|
[81fd230] | 61 | xsltproc --xinclude --nonet -stringparam profile.condition html \
|
---|
| 62 | --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
|
---|
[91364a5] | 63 | stylesheets/lfs-nochunks.xsl index.xml
|
---|
[81fd230] | 64 |
|
---|
[536b6aa] | 65 | tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
|
---|
[91364a5] | 66 |
|
---|
[c9109f2] | 67 | sh obfuscate.sh $(BASEDIR)/$(NOCHUNKS_OUTPUT)
|
---|
| 68 |
|
---|
[81fd230] | 69 | sed -i -e "s@text/html@application/xhtml+xml@g" \
|
---|
| 70 | $(BASEDIR)/$(NOCHUNKS_OUTPUT)
|
---|
| 71 |
|
---|
[2c5e4d5] | 72 | dump-commands:
|
---|
| 73 | xsltproc --xinclude --nonet --output $(DUMPDIR)/ \
|
---|
| 74 | stylesheets/dump-commands.xsl index.xml
|
---|
| 75 |
|
---|
[287ea55] | 76 | validate:
|
---|
| 77 | xmllint --noout --nonet --xinclude --postvalid index.xml
|
---|
[536b6aa] | 78 |
|
---|