2004-02-01 11:47:51 +08:00
|
|
|
# Makefile for BLFS Book generation.
|
|
|
|
# By Tushar Teredesai <tushar@linuxfromscratch.org>
|
|
|
|
# 2004-01-31
|
2004-08-10 12:25:57 +08:00
|
|
|
# $LastChangedBy$
|
|
|
|
# $Date$
|
2004-02-01 11:47:51 +08:00
|
|
|
# Adjust these to suit your installation
|
|
|
|
OUTPUTDIR = $(HOME)/public_html/blfs-book
|
2005-08-30 05:32:10 +08:00
|
|
|
DUMPDIR= $(HOME)/blfs-commands
|
2004-02-01 11:47:51 +08:00
|
|
|
INSTALL = install
|
|
|
|
JADE = openjade
|
|
|
|
DOCBOOK = /usr/share/sgml/docbook/dsssl-stylesheets-1.78
|
2006-04-05 00:11:49 +08:00
|
|
|
BASEDIR= $(HOME)/public_html/blfs-book-xsl
|
|
|
|
TEXBASEDIR= $(HOME)/public_html/blfs-book-tex
|
2005-01-07 13:52:50 +08:00
|
|
|
NOCHUNKS_OUTPUT=BLFS-BOOK.html
|
2004-02-01 11:47:51 +08:00
|
|
|
SRCDIR = $(PWD)
|
|
|
|
|
2004-05-07 15:33:03 +08:00
|
|
|
all: blfs
|
2004-05-03 06:52:09 +08:00
|
|
|
|
2004-04-13 09:59:18 +08:00
|
|
|
blfs:
|
2004-04-14 00:23:43 +08:00
|
|
|
@if [ -z $(BASEDIR) ]; then \
|
|
|
|
echo "Envar BASEDIR is not set!" ; \
|
|
|
|
exit 1 ; \
|
2005-06-06 02:51:46 +08:00
|
|
|
fi
|
2004-04-14 00:23:43 +08:00
|
|
|
@echo "Generating XHTML Version of BLFS Book with xsltproc..."
|
|
|
|
@echo " BASEDIR = $(BASEDIR)"
|
|
|
|
@$(INSTALL) -d $(BASEDIR)
|
2006-04-05 00:11:49 +08:00
|
|
|
xsltproc --xinclude --nonet -stringparam base.dir $(BASEDIR)/ \
|
2004-04-13 09:59:18 +08:00
|
|
|
stylesheets/blfs-chunked.xsl index.xml
|
2006-04-05 00:11:49 +08:00
|
|
|
if [ ! -e $(BASEDIR)/stylesheets ]; then \
|
|
|
|
mkdir -p $(BASEDIR)/stylesheets; \
|
2004-04-13 09:59:18 +08:00
|
|
|
fi;
|
2006-04-05 00:11:49 +08:00
|
|
|
cp stylesheets/*.css $(BASEDIR)/stylesheets
|
|
|
|
if [ ! -e $(BASEDIR)/images ]; then \
|
|
|
|
mkdir -p $(BASEDIR)/images; \
|
2004-04-13 09:59:18 +08:00
|
|
|
fi;
|
2004-05-08 10:42:12 +08:00
|
|
|
cp images/*.png $(BASEDIR)/images
|
2005-01-07 13:14:15 +08:00
|
|
|
cd $(BASEDIR); sed -i -e "s@../stylesheets@stylesheets@g" *.html
|
|
|
|
cd $(BASEDIR); sed -i -e "s@../images@images@g" *.html
|
2005-08-30 05:32:10 +08:00
|
|
|
|
|
|
|
for filename in `find $(BASEDIR) -name "*.html"`; do \
|
|
|
|
tidy -config tidy.conf $$filename; \
|
|
|
|
true; \
|
|
|
|
sh obfuscate.sh $$filename; \
|
|
|
|
sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \
|
|
|
|
done;
|
2004-04-13 09:59:18 +08:00
|
|
|
|
2005-01-07 13:14:15 +08:00
|
|
|
nochunks:
|
|
|
|
@echo "Generating nochunks version of BLFS..."
|
2005-01-07 13:52:50 +08:00
|
|
|
xsltproc --xinclude --nonet -stringparam profile.condition html \
|
|
|
|
--output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
|
2005-06-06 02:51:46 +08:00
|
|
|
stylesheets/blfs-nochunks.xsl index.xml
|
2005-05-31 01:49:09 +08:00
|
|
|
|
2005-01-07 13:52:50 +08:00
|
|
|
tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
|
2005-05-31 01:49:09 +08:00
|
|
|
|
2005-08-30 05:32:10 +08:00
|
|
|
sh obfuscate.sh $(BASEDIR)/$(NOCHUNKS_OUTPUT)
|
|
|
|
|
2005-01-07 13:52:50 +08:00
|
|
|
sed -i -e "s@text/html@application/xhtml+xml@g" \
|
|
|
|
$(BASEDIR)/$(NOCHUNKS_OUTPUT)
|
2005-01-07 13:14:15 +08:00
|
|
|
|
2004-04-13 09:59:18 +08:00
|
|
|
pdf:
|
2006-01-27 00:14:43 +08:00
|
|
|
xsltproc --xinclude --nonet --stringparam profile.condition pdf \
|
|
|
|
--output blfs-pdf.xml stylesheets/blfs-profile.xsl index.xml
|
2004-05-08 04:58:23 +08:00
|
|
|
xsltproc --xinclude --nonet --output blfs.fo \
|
2006-01-27 00:14:43 +08:00
|
|
|
stylesheets/blfs-pdf.xsl blfs-pdf.xml
|
2004-05-08 10:42:12 +08:00
|
|
|
sed -i -e "s/inherit/all/" blfs.fo
|
2005-01-10 06:26:34 +08:00
|
|
|
fop.sh blfs.fo blfs.pdf
|
2006-04-05 00:11:49 +08:00
|
|
|
$(INSTALL) -d $(BASEDIR)/pdf
|
2004-05-16 21:45:10 +08:00
|
|
|
rm blfs.fo
|
2006-04-05 00:11:49 +08:00
|
|
|
mv blfs.pdf $(BASEDIR)/pdf
|
2004-04-14 00:23:43 +08:00
|
|
|
|
|
|
|
tex:
|
|
|
|
@if [ -z $(TEXBASEDIR) ]; then \
|
2005-06-06 02:51:46 +08:00
|
|
|
echo "Envar TEXBASEDIR is not set!" ; \
|
|
|
|
exit 1 ; \
|
|
|
|
fi
|
2004-04-14 00:23:43 +08:00
|
|
|
@echo "Generating TeX Version of BLFS Book with xsltproc..."
|
|
|
|
@echo " TEXBASEDIR = $(TEXBASEDIR)"
|
|
|
|
@$(INSTALL) -d $(TEXBASEDIR)
|
|
|
|
# Using profiles in book source to exclude parts of the book from TeX
|
2004-05-31 03:08:32 +08:00
|
|
|
# i.e., Changelog
|
2006-04-05 00:11:49 +08:00
|
|
|
xsltproc --nonet --output $(TEXBASEDIR)/index.xml \
|
2005-06-06 02:51:46 +08:00
|
|
|
--stringparam "profile.role" "book" \
|
2004-04-14 00:23:43 +08:00
|
|
|
http://docbook.sourceforge.net/release/xsl/current/profiling/profile.xsl \
|
2005-06-06 02:51:46 +08:00
|
|
|
index.xml
|
2004-04-14 00:23:43 +08:00
|
|
|
@cd $(TEXBASEDIR) && xsltproc --nonet -o blfs-book.tex \
|
2005-06-06 02:51:46 +08:00
|
|
|
$(SRCDIR)/stylesheets/blfs-tex.xsl index.xml
|
2004-05-03 06:52:09 +08:00
|
|
|
|
2005-08-30 05:32:10 +08:00
|
|
|
dump-commands:
|
|
|
|
xsltproc --xinclude --nonet --output $(DUMPDIR)/ \
|
|
|
|
stylesheets/dump-commands.xsl index.xml
|
|
|
|
|
2004-05-07 21:04:10 +08:00
|
|
|
validate:
|
2004-06-17 11:24:33 +08:00
|
|
|
xmllint --noout --nonet --xinclude --postvalid index.xml
|
2004-08-08 05:59:36 +08:00
|
|
|
|
2006-01-27 00:14:43 +08:00
|
|
|
validate-pdf:
|
|
|
|
xsltproc --xinclude --nonet --stringparam profile.condition pdf \
|
|
|
|
--output blfs-pdf.xml stylesheets/blfs-profile.xsl index.xml
|
|
|
|
xmllint --noout --nonet --postvalid blfs-pdf.xml
|
|
|
|
|
2005-05-31 01:49:09 +08:00
|
|
|
blfs-patch-list:
|
2004-08-08 05:59:36 +08:00
|
|
|
@echo "Generating blfs-patch-list..."
|
|
|
|
xsltproc --xinclude --nonet \
|
|
|
|
--output blfs-patch-list stylesheets/patcheslist.xsl index.xml
|
|
|
|
sed -e "s|^.*/||" blfs-patch-list > blfs-patches
|
|
|
|
sort blfs-patches > blfs-patch-list
|
|
|
|
rm blfs-patches
|
|
|
|
|
|
|
|
.PHONY : blfs-patch-list
|