1 | # Makefile for BLFS Book generation.
|
---|
2 | # By Tushar Teredesai <tushar@linuxfromscratch.org>
|
---|
3 | # 2004-01-31
|
---|
4 | # $LastChangedBy$
|
---|
5 | # $Date$
|
---|
6 | # Adjust these to suit your installation
|
---|
7 | OUTPUTDIR = $(HOME)/public_html/blfs-book
|
---|
8 | INSTALL = install
|
---|
9 | JADE = openjade
|
---|
10 | DOCBOOK = /usr/share/sgml/docbook/dsssl-stylesheets-1.78
|
---|
11 | BASEDIR= $(HOME)/public_html/blfs-book-xsl/
|
---|
12 | TEXBASEDIR= $(HOME)/public_html/blfs-book-tex/
|
---|
13 | NOCHUNKS_OUTPUT=BLFS-BOOK.html
|
---|
14 | SRCDIR = $(PWD)
|
---|
15 |
|
---|
16 | all: blfs
|
---|
17 |
|
---|
18 | blfs:
|
---|
19 | @if [ -z $(BASEDIR) ]; then \
|
---|
20 | echo "Envar BASEDIR is not set!" ; \
|
---|
21 | exit 1 ; \
|
---|
22 | fi
|
---|
23 | @echo "Generating XHTML Version of BLFS Book with xsltproc..."
|
---|
24 | @echo " BASEDIR = $(BASEDIR)"
|
---|
25 | @$(INSTALL) -d $(BASEDIR)
|
---|
26 | xsltproc --xinclude --nonet -stringparam base.dir $(BASEDIR) \
|
---|
27 | stylesheets/blfs-chunked.xsl index.xml
|
---|
28 | if [ ! -e $(BASEDIR)stylesheets ]; then \
|
---|
29 | mkdir -p $(BASEDIR)stylesheets; \
|
---|
30 | fi;
|
---|
31 | cp stylesheets/*.css $(BASEDIR)stylesheets
|
---|
32 | if [ ! -e $(BASEDIR)images ]; then \
|
---|
33 | mkdir -p $(BASEDIR)images; \
|
---|
34 | fi;
|
---|
35 | cp images/*.png $(BASEDIR)/images
|
---|
36 | cd $(BASEDIR); sed -i -e "s@../stylesheets@stylesheets@g" *.html
|
---|
37 | cd $(BASEDIR); sed -i -e "s@../images@images@g" *.html
|
---|
38 | sh goTidy $(BASEDIR)/
|
---|
39 |
|
---|
40 | nochunks:
|
---|
41 | @echo "Generating nochunks version of BLFS..."
|
---|
42 | xsltproc --xinclude --nonet -stringparam profile.condition html \
|
---|
43 | --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
|
---|
44 | stylesheets/blfs-nochunks.xsl index.xml
|
---|
45 |
|
---|
46 | tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
|
---|
47 |
|
---|
48 | sed -i -e "s@text/html@application/xhtml+xml@g" \
|
---|
49 | $(BASEDIR)/$(NOCHUNKS_OUTPUT)
|
---|
50 |
|
---|
51 | pdf:
|
---|
52 | xsltproc --xinclude --nonet --output blfs.fo \
|
---|
53 | stylesheets/blfs-pdf.xsl \
|
---|
54 | index.xml
|
---|
55 | sed -i -e "s/inherit/all/" blfs.fo
|
---|
56 | fop.sh blfs.fo blfs.pdf
|
---|
57 | $(INSTALL) -d $(BASEDIR)pdf
|
---|
58 | rm blfs.fo
|
---|
59 | mv blfs.pdf $(BASEDIR)pdf
|
---|
60 |
|
---|
61 | print:
|
---|
62 | xsltproc --xinclude --nonet --output blfs-print.fo \
|
---|
63 | stylesheets/blfs-print.xsl index.xml
|
---|
64 | sed -i -e "s/inherit/all/" blfs-print.fo
|
---|
65 | /opt/fop/fop.sh blfs-print.fo blfs-print.pdf
|
---|
66 | $(INSTALL) -d $(BASEDIR)print
|
---|
67 | rm blfs-print.fo
|
---|
68 | mv blfs-print.pdf $(BASEDIR)print
|
---|
69 |
|
---|
70 | tex:
|
---|
71 | @if [ -z $(TEXBASEDIR) ]; then \
|
---|
72 | echo "Envar TEXBASEDIR is not set!" ; \
|
---|
73 | exit 1 ; \
|
---|
74 | fi
|
---|
75 | @echo "Generating TeX Version of BLFS Book with xsltproc..."
|
---|
76 | @echo " TEXBASEDIR = $(TEXBASEDIR)"
|
---|
77 | @$(INSTALL) -d $(TEXBASEDIR)
|
---|
78 | # Using profiles in book source to exclude parts of the book from TeX
|
---|
79 | # i.e., Changelog
|
---|
80 | xsltproc --nonet --output $(TEXBASEDIR)index.xml \
|
---|
81 | --stringparam "profile.role" "book" \
|
---|
82 | http://docbook.sourceforge.net/release/xsl/current/profiling/profile.xsl \
|
---|
83 | index.xml
|
---|
84 | @cd $(TEXBASEDIR) && xsltproc --nonet -o blfs-book.tex \
|
---|
85 | $(SRCDIR)/stylesheets/blfs-tex.xsl index.xml
|
---|
86 |
|
---|
87 | validate:
|
---|
88 | xmllint --noout --nonet --xinclude --postvalid index.xml
|
---|
89 |
|
---|
90 | blfs-patch-list:
|
---|
91 | @echo "Generating blfs-patch-list..."
|
---|
92 | xsltproc --xinclude --nonet \
|
---|
93 | --output blfs-patch-list stylesheets/patcheslist.xsl index.xml
|
---|
94 | sed -e "s|^.*/||" blfs-patch-list > blfs-patches
|
---|
95 | sort blfs-patches > blfs-patch-list
|
---|
96 | rm blfs-patches
|
---|
97 |
|
---|
98 | .PHONY : blfs-patch-list
|
---|