[19599c63] | 1 | # Makefile for BLFS Book generation.
|
---|
| 2 | # By Tushar Teredesai <tushar@linuxfromscratch.org>
|
---|
| 3 | # 2004-01-31
|
---|
| 4 | # Adjust these to suit your installation
|
---|
| 5 | OUTPUTDIR = $(HOME)/public_html/blfs-book
|
---|
| 6 | INSTALL = install
|
---|
| 7 | JADE = openjade
|
---|
| 8 | DOCBOOK = /usr/share/sgml/docbook/dsssl-stylesheets-1.78
|
---|
[e9e9b47a] | 9 | BASEDIR= $(HOME)/public_html/blfs-book-xsl/
|
---|
[9c12e42] | 10 | TEXBASEDIR= $(HOME)/public_html/blfs-book-tex/
|
---|
[19599c63] | 11 |
|
---|
| 12 | SRCDIR = $(PWD)
|
---|
| 13 |
|
---|
[972150e7] | 14 | all: blfs
|
---|
[22c4e1ee] | 15 |
|
---|
| 16 | blfs-old: index.xml
|
---|
[19599c63] | 17 | @if [ -z $(OUTPUTDIR) ]; then \
|
---|
| 18 | echo "Envar OUTPUTDIR is not set!" ; \
|
---|
| 19 | exit 1 ; \
|
---|
| 20 | fi
|
---|
[e9e9b47a] | 21 | @echo "Generating HTML Version of BLFS Book with $(JADE)..."
|
---|
[19599c63] | 22 | @echo " OUTPUTDIR = $(OUTPUTDIR)"
|
---|
| 23 | @$(INSTALL) -d $(OUTPUTDIR)
|
---|
| 24 | @cd $(OUTPUTDIR) && $(INSTALL) -d introduction postlfs general \
|
---|
| 25 | connect basicnet server content x kde gnome xsoft \
|
---|
| 26 | multimedia pst preface appendices other
|
---|
[22c4e1ee] | 27 | @cd $(OUTPUTDIR) && $(JADE) -t sgml -D $(DOCBOOK)/html \
|
---|
| 28 | -d $(SRCDIR)/blfs.dsl $(DOCBOOK)/dtds/decls/xml.dcl \
|
---|
| 29 | $(SRCDIR)/index.xml
|
---|
[eff3826] | 30 |
|
---|
| 31 | blfs:
|
---|
[e9e9b47a] | 32 | @if [ -z $(BASEDIR) ]; then \
|
---|
| 33 | echo "Envar BASEDIR is not set!" ; \
|
---|
| 34 | exit 1 ; \
|
---|
| 35 | fi
|
---|
| 36 | @echo "Generating XHTML Version of BLFS Book with xsltproc..."
|
---|
| 37 | @echo " BASEDIR = $(BASEDIR)"
|
---|
| 38 | @$(INSTALL) -d $(BASEDIR)
|
---|
[eff3826] | 39 | xsltproc --xinclude --nonet -stringparam base.dir $(BASEDIR) \
|
---|
| 40 | stylesheets/blfs-chunked.xsl index.xml
|
---|
| 41 | if [ ! -e $(BASEDIR)stylesheets ]; then \
|
---|
| 42 | mkdir -p $(BASEDIR)stylesheets; \
|
---|
| 43 | fi;
|
---|
[3984104] | 44 | cp stylesheets/*.css $(BASEDIR)stylesheets
|
---|
[eff3826] | 45 | if [ ! -e $(BASEDIR)images ]; then \
|
---|
| 46 | mkdir -p $(BASEDIR)images; \
|
---|
| 47 | fi;
|
---|
[5d4975d] | 48 | cp images/*.png $(BASEDIR)/images
|
---|
[eff3826] | 49 | cd $(BASEDIR); sed -i -e "s@../stylesheets@stylesheets@" \
|
---|
| 50 | index.html
|
---|
| 51 | cd $(BASEDIR); sed -i -e "s@../images@images@g" \
|
---|
| 52 | index.html
|
---|
[3984104] | 53 | sh goTidy $(BASEDIR)/
|
---|
[eff3826] | 54 |
|
---|
| 55 | pdf:
|
---|
[d9712fb] | 56 | xsltproc --xinclude --nonet --output blfs.fo \
|
---|
[eff3826] | 57 | stylesheets/blfs-pdf.xsl \
|
---|
| 58 | index.xml
|
---|
[5d4975d] | 59 | sed -i -e "s/inherit/all/" blfs.fo
|
---|
[9c12e42] | 60 | /opt/fop/fop.sh blfs.fo blfs.pdf
|
---|
| 61 | $(INSTALL) -d $(BASEDIR)pdf
|
---|
| 62 | rm blfs.fo
|
---|
| 63 | mv blfs.pdf $(BASEDIR)pdf
|
---|
[e9e9b47a] | 64 |
|
---|
[5d4975d] | 65 | print:
|
---|
| 66 | xsltproc --xinclude --nonet --output blfs-print.fo \
|
---|
| 67 | stylesheets/blfs-print.xsl index.xml
|
---|
| 68 | sed -i -e "s/inherit/all/" blfs-print.fo
|
---|
[9c12e42] | 69 | /opt/fop/fop.sh blfs-print.fo blfs-print.pdf
|
---|
| 70 | $(INSTALL) -d $(BASEDIR)print
|
---|
| 71 | rm blfs-print.fo
|
---|
| 72 | mv blfs-print.pdf $(BASEDIR)print
|
---|
[5d4975d] | 73 |
|
---|
[e9e9b47a] | 74 | tex:
|
---|
| 75 | @if [ -z $(TEXBASEDIR) ]; then \
|
---|
| 76 | echo "Envar TEXBASEDIR is not set!" ; \
|
---|
| 77 | exit 1 ; \
|
---|
| 78 | fi
|
---|
| 79 | @echo "Generating TeX Version of BLFS Book with xsltproc..."
|
---|
| 80 | @echo " TEXBASEDIR = $(TEXBASEDIR)"
|
---|
| 81 | @$(INSTALL) -d $(TEXBASEDIR)
|
---|
| 82 | # Using profiles in book source to exclude parts of the book from TeX
|
---|
[0990cf7a] | 83 | # i.e., Changelog
|
---|
[9c12e42] | 84 | xsltproc --nonet --output $(TEXBASEDIR)index.xml \
|
---|
[e9e9b47a] | 85 | --stringparam "profile.role" "book" \
|
---|
| 86 | http://docbook.sourceforge.net/release/xsl/current/profiling/profile.xsl \
|
---|
| 87 | index.xml
|
---|
| 88 | @cd $(TEXBASEDIR) && xsltproc --nonet -o blfs-book.tex \
|
---|
[9c12e42] | 89 | $(SRCDIR)/stylesheets/blfs-tex.xsl index.xml
|
---|
[22c4e1ee] | 90 |
|
---|
[7337fcb] | 91 | validate:
|
---|
[714d067] | 92 | xmllint --noout --nonet --xinclude --postvalid index.xml
|
---|