source: Makefile@ 097d2ae

6.5
Last change on this file since 097d2ae was 097d2ae, checked in by Matthew Burgess <matthew@…>, 15 years ago

Upgrade to LFS-Bootscripts-20090812 and prevent Makefile from altering what are now fixed MD5sums and tarball sizes.

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

  • Property mode set to 100644
File size: 3.6 KB
Line 
1BASEDIR = ~/lfs-book
2DUMPDIR = ~/lfs-commands
3RENDERTMP = $(HOME)/tmp
4CHUNK_QUIET = 1
5ROOT_ID =
6PDF_OUTPUT = LFS-BOOK.pdf
7NOCHUNKS_OUTPUT = LFS-BOOK.html
8
9ifdef V
10 Q =
11else
12 Q = @
13endif
14
15lfs: maketar validxml profile-html
16 @echo "Generating chunked XHTML files..."
17 $(Q)xsltproc --nonet -stringparam chunk.quietly $(CHUNK_QUIET) \
18 -stringparam rootid "$(ROOT_ID)" -stringparam base.dir $(BASEDIR)/ \
19 stylesheets/lfs-chunked.xsl $(RENDERTMP)/lfs-html.xml
20
21 @echo "Copying CSS code and images..."
22 $(Q)if [ ! -e $(BASEDIR)/stylesheets ]; then \
23 mkdir -p $(BASEDIR)/stylesheets; \
24 fi;
25 $(Q)cp stylesheets/lfs-xsl/*.css $(BASEDIR)/stylesheets
26 $(Q)if [ ! -e $(BASEDIR)/images ]; then \
27 mkdir -p $(BASEDIR)/images; \
28 fi;
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
32
33 @echo "Running Tidy and obfuscate.sh..."
34 $(Q)for filename in `find $(BASEDIR) -name "*.html"`; do \
35 tidy -config tidy.conf $$filename; \
36 true; \
37 /bin/bash obfuscate.sh $$filename; \
38 sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \
39 done;
40
41 $(Q)$(MAKE) wget-list
42
43pdf: validxml
44 @echo "Generating profiled XML for PDF..."
45 $(Q)xsltproc --nonet --stringparam profile.condition pdf \
46 --output $(RENDERTMP)/lfs-pdf.xml stylesheets/lfs-xsl/profile.xsl \
47 $(RENDERTMP)/lfs-full.xml
48
49 @echo "Generating FO file..."
50 $(Q)xsltproc --nonet -stringparam rootid "$(ROOT_ID)" \
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
54
55 @echo "Generating PDF file..."
56 $(Q)if [ ! -e $(BASEDIR) ]; then \
57 mkdir -p $(BASEDIR); \
58 fi;
59 $(Q)fop $(RENDERTMP)/lfs-pdf.fo $(BASEDIR)/$(PDF_OUTPUT)
60
61nochunks: maketar validxml profile-html
62 @echo "Generating non chunked XHTML file..."
63 $(Q)xsltproc --nonet -stringparam rootid "$(ROOT_ID)" \
64 --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
65 stylesheets/lfs-nochunks.xsl $(RENDERTMP)/lfs-html.xml
66
67 @echo "Running Tidy..."
68 $(Q)tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
69 @echo "Running obfuscate.sh..."
70 $(Q)bash obfuscate.sh $(BASEDIR)/$(NOCHUNKS_OUTPUT)
71 $(Q)sed -i -e "s@text/html@application/xhtml+xml@g" \
72 $(BASEDIR)/$(NOCHUNKS_OUTPUT)
73
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
81 @echo "Processing bootscripts..."
82 $(Q)bash process-scripts.sh
83 @echo "Validating the book..."
84 $(Q)xmllint --nonet --noent --xinclude --postvalid \
85 -o $(RENDERTMP)/lfs-full.xml index.xml
86 $(Q)rm -f appendices/*.script
87# $(Q)./aux-file-data.sh $(RENDERTMP)/lfs-full.xml
88
89maketar:
90 @echo "Making tarballs..."
91 $(Q)sh make-aux-files.sh
92
93profile-html: validxml
94 @echo "Generating profiled XML for XHTML..."
95 $(Q)xsltproc --nonet --stringparam profile.condition html \
96 --output $(RENDERTMP)/lfs-html.xml stylesheets/lfs-xsl/profile.xsl \
97 $(RENDERTMP)/lfs-full.xml
98
99wget-list:
100 @echo "Generating wget list..."
101 $(Q)mkdir -p $(BASEDIR)
102 $(Q)xsltproc --xinclude --nonet --output $(BASEDIR)/wget-list \
103 stylesheets/wget-list.xsl chapter03/chapter03.xml
104
105dump-commands: validxml
106 @echo "Dumping book commands..."
107 $(Q)xsltproc --output $(DUMPDIR)/ \
108 stylesheets/dump-commands.xsl $(RENDERTMP)/lfs-full.xml
109
110validate: maketar validxml
111 @echo "Validation complete."
112
113all: lfs nochunks pdf dump-commands
114
115.PHONY : all dump-commands lfs nochunks pdf profile-html tmpdir validate \
116 validxml wget-list maketar
Note: See TracBrowser for help on using the repository browser.