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
|
---|
9 | BASEDIR= $(HOME)/public_html/blfs-book-xsl/
|
---|
10 | TEXBASEDIR= $(HOME)/public_html/blfs-book-tex/
|
---|
11 |
|
---|
12 | SRCDIR = $(PWD)
|
---|
13 |
|
---|
14 | all: blfs
|
---|
15 |
|
---|
16 | blfs-old: index.xml
|
---|
17 | @if [ -z $(OUTPUTDIR) ]; then \
|
---|
18 | echo "Envar OUTPUTDIR is not set!" ; \
|
---|
19 | exit 1 ; \
|
---|
20 | fi
|
---|
21 | @echo "Generating HTML Version of BLFS Book with $(JADE)..."
|
---|
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
|
---|
27 | @cd $(OUTPUTDIR) && $(JADE) -t sgml -D $(DOCBOOK)/html \
|
---|
28 | -d $(SRCDIR)/blfs.dsl $(DOCBOOK)/dtds/decls/xml.dcl \
|
---|
29 | $(SRCDIR)/index.xml
|
---|
30 |
|
---|
31 | blfs:
|
---|
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)
|
---|
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;
|
---|
44 | cp stylesheets/*.css $(BASEDIR)stylesheets
|
---|
45 | if [ ! -e $(BASEDIR)images ]; then \
|
---|
46 | mkdir -p $(BASEDIR)images; \
|
---|
47 | fi;
|
---|
48 | cp images/*.png $(BASEDIR)/images
|
---|
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
|
---|
53 | sh goTidy $(BASEDIR)/
|
---|
54 |
|
---|
55 | pdf:
|
---|
56 | xsltproc --xinclude --nonet --output blfs.fo \
|
---|
57 | stylesheets/blfs-pdf.xsl \
|
---|
58 | index.xml
|
---|
59 | sed -i -e "s/inherit/all/" blfs.fo
|
---|
60 | /opt/fop/fop.sh blfs.fo blfs.pdf
|
---|
61 | $(INSTALL) -d $(BASEDIR)pdf
|
---|
62 | rm blfs.fo
|
---|
63 | mv blfs.pdf $(BASEDIR)pdf
|
---|
64 |
|
---|
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
|
---|
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
|
---|
73 |
|
---|
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
|
---|
83 | # i.e., Changelog
|
---|
84 | xsltproc --nonet --output $(TEXBASEDIR)index.xml \
|
---|
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 \
|
---|
89 | $(SRCDIR)/stylesheets/blfs-tex.xsl index.xml
|
---|
90 |
|
---|
91 | validate:
|
---|
92 | xmllint --noout --nonet --xinclude --postvalid index.xml
|
---|