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