source: Makefile@ 106dc42

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 6.3 6.4 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 106dc42 was 106dc42, checked in by Manuel Canales Esparcia <manuel@…>, 17 years ago

Using RENDERTMP envar instead of hardcoded /tmp dir.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@8210 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 3.4 KB
RevLine 
[edb9842]1BASEDIR=~/lfs-book
[2c5e4d5]2DUMPDIR=~/lfs-commands
[106dc42]3RENDERTMP= $(HOME)/tmp
[0e6d3c0]4CHUNK_QUIET=1
5ROOT_ID=""
[44758be]6PDF_OUTPUT=LFS-BOOK.pdf
7NOCHUNKS_OUTPUT=LFS-BOOK.html
[3a4594b]8
[05d60ce]9ifdef V
10 Q =
11else
12 Q = @
13endif
14
[0e6d3c0]15lfs: validxml profile-html
16 @echo "Generating chunked XHTML files..."
[05d60ce]17 $(Q)xsltproc --nonet -stringparam chunk.quietly $(CHUNK_QUIET) \
[0e6d3c0]18 -stringparam rootid $(ROOT_ID) -stringparam base.dir $(BASEDIR)/ \
[106dc42]19 stylesheets/lfs-chunked.xsl $(RENDERTMP)/lfs-html.xml
[287ea55]20
[0e6d3c0]21 @echo "Copying CSS code and images..."
[05d60ce]22 $(Q)if [ ! -e $(BASEDIR)/stylesheets ]; then \
[44758be]23 mkdir -p $(BASEDIR)/stylesheets; \
24 fi;
[05d60ce]25 $(Q)cp stylesheets/lfs-xsl/*.css $(BASEDIR)/stylesheets
26 $(Q)if [ ! -e $(BASEDIR)/images ]; then \
[44758be]27 mkdir -p $(BASEDIR)/images; \
28 fi;
[05d60ce]29 $(Q)cp images/*.png $(BASEDIR)/images
30 $(Q)cd $(BASEDIR)/; sed -i -e "s@../stylesheets@stylesheets@g" *.html
31 $(Q)cd $(BASEDIR)/; sed -i -e "s@../images@images@g" *.html
[287ea55]32
[05d60ce]33 @echo "Running Tidy and obfuscate.sh..."
34 $(Q)for filename in `find $(BASEDIR) -name "*.html"`; do \
[132fd16]35 tidy -config tidy.conf $$filename; \
36 true; \
37 sh obfuscate.sh $$filename; \
[3879ebc]38 sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \
39 done;
[5470c67]40
[05d60ce]41 $(Q)$(MAKE) wget-list
[3a4594b]42
[0e6d3c0]43pdf: validxml
44 @echo "Generating profiled XML for PDF..."
[05d60ce]45 $(Q)xsltproc --nonet --stringparam profile.condition pdf \
[106dc42]46 --output $(RENDERTMP)/lfs-pdf.xml stylesheets/lfs-xsl/profile.xsl \
47 $(RENDERTMP)/lfs-full.xml
[0e6d3c0]48
49 @echo "Generating FO file..."
[05d60ce]50 $(Q)xsltproc --nonet -stringparam rootid $(ROOT_ID) \
[106dc42]51 --output $(RENDERTMP)/lfs-pdf.fo stylesheets/lfs-pdf.xsl \
52 $(RENDERTMP)/lfs-pdf.xml
53 $(Q)sed -i -e 's/span="inherit"/span="all"/' $(RENDERTMP)/lfs-pdf.fo
[0e6d3c0]54
55 @echo "Generating PDF file..."
[c948b40]56 $(Q)if [ ! -e $(BASEDIR) ]; then \
57 mkdir -p $(BASEDIR); \
58 fi;
[106dc42]59 $(Q)fop $(RENDERTMP)/lfs-pdf.fo $(BASEDIR)/$(PDF_OUTPUT)
[0e6d3c0]60
61nochunks: validxml profile-html
62 @echo "Generating non chunked XHTML file..."
[0b158f3]63 $(Q)xsltproc --nonet -stringparam rootid $(ROOT_ID) \
64 --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
[106dc42]65 stylesheets/lfs-nochunks.xsl $(RENDERTMP)/lfs-html.xml
[0e6d3c0]66
67 @echo "Running Tidy..."
[05d60ce]68 $(Q)tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
69 @echo "Running obfuscate.sh..."
70 $(Q)sh obfuscate.sh $(BASEDIR)/$(NOCHUNKS_OUTPUT)
71 $(Q)sed -i -e "s@text/html@application/xhtml+xml@g" \
[81fd230]72 $(BASEDIR)/$(NOCHUNKS_OUTPUT)
73
[106dc42]74tmpdir:
75 @echo "Creating and cleaning $(RENDERTMP)"
76 $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP)
77 $(Q)rm -f $(RENDERTMP)/lfs-{full,html,pdf}.xml
78 $(Q)rm -f $(RENDERTMP)/lfs-pdf.fo
79
80validxml: tmpdir
[0e6d3c0]81 @echo "Validating the book..."
[05d60ce]82 $(Q)xmllint --nonet --noent --xinclude --postvalid \
[106dc42]83 -o $(RENDERTMP)/lfs-full.xml index.xml
[0e6d3c0]84
85profile-html: validxml
86 @echo "Generating profiled XML for XHTML..."
[05d60ce]87 $(Q)xsltproc --nonet --stringparam profile.condition html \
[106dc42]88 --output $(RENDERTMP)/lfs-html.xml stylesheets/lfs-xsl/profile.xsl \
89 $(RENDERTMP)/lfs-full.xml
[0e6d3c0]90
91wget-list:
92 @echo "Generating wget list..."
[05d60ce]93 $(Q)mkdir -p $(BASEDIR)
94 $(Q)xsltproc --xinclude --nonet --output $(BASEDIR)/wget-list \
[0e6d3c0]95 stylesheets/wget-list.xsl chapter03/chapter03.xml
96
[05d60ce]97dump-commands: validxml
[0e6d3c0]98 @echo "Dumping book commands..."
[05d60ce]99 $(Q)xsltproc --output $(DUMPDIR)/ \
[106dc42]100 stylesheets/dump-commands.xsl $(RENDERTMP)/lfs-full.xml
[2c5e4d5]101
[287ea55]102validate:
[0e6d3c0]103 @echo "Validating the book..."
[05d60ce]104 $(Q)xmllint --noout --nonet --xinclude --postvalid index.xml
[0e6d3c0]105
106all: lfs nochunks pdf dump-commands
[536b6aa]107
[106dc42]108.PHONY : all dump-commands lfs nochunks pdf profile-html tmpdir validate \
109 validxml wget-list
Note: See TracBrowser for help on using the repository browser.