[19599c63] | 1 | # Makefile for BLFS Book generation.
|
---|
| 2 | # By Tushar Teredesai <tushar@linuxfromscratch.org>
|
---|
| 3 | # 2004-01-31
|
---|
[5cd0959d] | 4 | # $LastChangedBy$
|
---|
| 5 | # $Date$
|
---|
[19599c63] | 6 | # Adjust these to suit your installation
|
---|
| 7 | OUTPUTDIR = $(HOME)/public_html/blfs-book
|
---|
[4a02298] | 8 | DUMPDIR= $(HOME)/blfs-commands
|
---|
[19599c63] | 9 | INSTALL = install
|
---|
| 10 | JADE = openjade
|
---|
| 11 | DOCBOOK = /usr/share/sgml/docbook/dsssl-stylesheets-1.78
|
---|
[e9e9b47a] | 12 | BASEDIR= $(HOME)/public_html/blfs-book-xsl/
|
---|
[9c12e42] | 13 | TEXBASEDIR= $(HOME)/public_html/blfs-book-tex/
|
---|
[d8dc77a] | 14 | NOCHUNKS_OUTPUT=BLFS-BOOK.html
|
---|
[19599c63] | 15 | SRCDIR = $(PWD)
|
---|
| 16 |
|
---|
[972150e7] | 17 | all: blfs
|
---|
[22c4e1ee] | 18 |
|
---|
[eff3826] | 19 | blfs:
|
---|
[e9e9b47a] | 20 | @if [ -z $(BASEDIR) ]; then \
|
---|
| 21 | echo "Envar BASEDIR is not set!" ; \
|
---|
| 22 | exit 1 ; \
|
---|
[1881a5b] | 23 | fi
|
---|
[e9e9b47a] | 24 | @echo "Generating XHTML Version of BLFS Book with xsltproc..."
|
---|
| 25 | @echo " BASEDIR = $(BASEDIR)"
|
---|
| 26 | @$(INSTALL) -d $(BASEDIR)
|
---|
[eff3826] | 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;
|
---|
[3984104] | 32 | cp stylesheets/*.css $(BASEDIR)stylesheets
|
---|
[eff3826] | 33 | if [ ! -e $(BASEDIR)images ]; then \
|
---|
| 34 | mkdir -p $(BASEDIR)images; \
|
---|
| 35 | fi;
|
---|
[5d4975d] | 36 | cp images/*.png $(BASEDIR)/images
|
---|
[3fe8b511] | 37 | cd $(BASEDIR); sed -i -e "s@../stylesheets@stylesheets@g" *.html
|
---|
| 38 | cd $(BASEDIR); sed -i -e "s@../images@images@g" *.html
|
---|
[4a02298] | 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;
|
---|
[eff3826] | 46 |
|
---|
[3fe8b511] | 47 | nochunks:
|
---|
| 48 | @echo "Generating nochunks version of BLFS..."
|
---|
[d8dc77a] | 49 | xsltproc --xinclude --nonet -stringparam profile.condition html \
|
---|
| 50 | --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
|
---|
[1881a5b] | 51 | stylesheets/blfs-nochunks.xsl index.xml
|
---|
[4ff86b9] | 52 |
|
---|
[d8dc77a] | 53 | tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
|
---|
[4ff86b9] | 54 |
|
---|
[4a02298] | 55 | sh obfuscate.sh $(BASEDIR)/$(NOCHUNKS_OUTPUT)
|
---|
| 56 |
|
---|
[d8dc77a] | 57 | sed -i -e "s@text/html@application/xhtml+xml@g" \
|
---|
| 58 | $(BASEDIR)/$(NOCHUNKS_OUTPUT)
|
---|
[3fe8b511] | 59 |
|
---|
[eff3826] | 60 | pdf:
|
---|
[d53eb0e] | 61 | xsltproc --xinclude --nonet --stringparam profile.condition pdf \
|
---|
| 62 | --output blfs-pdf.xml stylesheets/blfs-profile.xsl index.xml
|
---|
[d9712fb] | 63 | xsltproc --xinclude --nonet --output blfs.fo \
|
---|
[d53eb0e] | 64 | stylesheets/blfs-pdf.xsl blfs-pdf.xml
|
---|
[5d4975d] | 65 | sed -i -e "s/inherit/all/" blfs.fo
|
---|
[634c636c] | 66 | fop.sh blfs.fo blfs.pdf
|
---|
[9c12e42] | 67 | $(INSTALL) -d $(BASEDIR)pdf
|
---|
| 68 | rm blfs.fo
|
---|
| 69 | mv blfs.pdf $(BASEDIR)pdf
|
---|
[e9e9b47a] | 70 |
|
---|
| 71 | tex:
|
---|
| 72 | @if [ -z $(TEXBASEDIR) ]; then \
|
---|
[1881a5b] | 73 | echo "Envar TEXBASEDIR is not set!" ; \
|
---|
| 74 | exit 1 ; \
|
---|
| 75 | fi
|
---|
[e9e9b47a] | 76 | @echo "Generating TeX Version of BLFS Book with xsltproc..."
|
---|
| 77 | @echo " TEXBASEDIR = $(TEXBASEDIR)"
|
---|
| 78 | @$(INSTALL) -d $(TEXBASEDIR)
|
---|
| 79 | # Using profiles in book source to exclude parts of the book from TeX
|
---|
[0990cf7a] | 80 | # i.e., Changelog
|
---|
[9c12e42] | 81 | xsltproc --nonet --output $(TEXBASEDIR)index.xml \
|
---|
[1881a5b] | 82 | --stringparam "profile.role" "book" \
|
---|
[e9e9b47a] | 83 | http://docbook.sourceforge.net/release/xsl/current/profiling/profile.xsl \
|
---|
[1881a5b] | 84 | index.xml
|
---|
[e9e9b47a] | 85 | @cd $(TEXBASEDIR) && xsltproc --nonet -o blfs-book.tex \
|
---|
[1881a5b] | 86 | $(SRCDIR)/stylesheets/blfs-tex.xsl index.xml
|
---|
[22c4e1ee] | 87 |
|
---|
[4a02298] | 88 | dump-commands:
|
---|
| 89 | xsltproc --xinclude --nonet --output $(DUMPDIR)/ \
|
---|
| 90 | stylesheets/dump-commands.xsl index.xml
|
---|
| 91 |
|
---|
[7337fcb] | 92 | validate:
|
---|
[714d067] | 93 | xmllint --noout --nonet --xinclude --postvalid index.xml
|
---|
[47d87939] | 94 |
|
---|
[d53eb0e] | 95 | validate-pdf:
|
---|
| 96 | xsltproc --xinclude --nonet --stringparam profile.condition pdf \
|
---|
| 97 | --output blfs-pdf.xml stylesheets/blfs-profile.xsl index.xml
|
---|
| 98 | xmllint --noout --nonet --postvalid blfs-pdf.xml
|
---|
| 99 |
|
---|
[4ff86b9] | 100 | blfs-patch-list:
|
---|
[47d87939] | 101 | @echo "Generating blfs-patch-list..."
|
---|
| 102 | xsltproc --xinclude --nonet \
|
---|
| 103 | --output blfs-patch-list stylesheets/patcheslist.xsl index.xml
|
---|
| 104 | sed -e "s|^.*/||" blfs-patch-list > blfs-patches
|
---|
| 105 | sort blfs-patches > blfs-patch-list
|
---|
| 106 | rm blfs-patches
|
---|
| 107 |
|
---|
| 108 | .PHONY : blfs-patch-list
|
---|