source: Makefile@ 73fb1e74

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 73fb1e74 was 73fb1e74, checked in by Dan Nichilson <dnicholson@…>, 16 years ago

Try to remove $(RENDERTMP) on clean

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@7360 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 5.6 KB
Line 
1# Makefile for BLFS Book generation.
2# By Tushar Teredesai <tushar@linuxfromscratch.org>
3# 2004-01-31
4# $LastChangedBy$
5# $Date$
6
7# Adjust these to suit your installation
8BASEDIR ?= $(HOME)/public_html/blfs-book-xsl
9DUMPDIR ?= $(HOME)/blfs-commands
10RENDERTMP ?= tmp
11CHUNK_QUIET = 1
12ROOT_ID =
13PDF_OUTPUT = BLFS-BOOK.pdf
14NOCHUNKS_OUTPUT = BLFS-BOOK.html
15
16ifdef V
17 Q =
18else
19 Q = @
20endif
21
22blfs: html wget-list
23all: blfs nochunks pdf
24world: all blfs-patch-list dump-commands test-links
25
26html: $(BASEDIR)/index.html
27$(BASEDIR)/index.html: $(RENDERTMP)/blfs-html.xml
28 @echo "Generating chunked XHTML files..."
29 $(Q)xsltproc --nonet -stringparam chunk.quietly $(CHUNK_QUIET) \
30 -stringparam rootid "$(ROOT_ID)" -stringparam base.dir $(BASEDIR)/ \
31 stylesheets/blfs-chunked.xsl $(RENDERTMP)/blfs-html.xml
32
33 @echo "Copying CSS code and images..."
34 $(Q)if [ ! -e $(BASEDIR)/stylesheets ]; then \
35 mkdir -p $(BASEDIR)/stylesheets; \
36 fi;
37 $(Q)cp stylesheets/lfs-xsl/*.css $(BASEDIR)/stylesheets
38 $(Q)if [ ! -e $(BASEDIR)/images ]; then \
39 mkdir -p $(BASEDIR)/images; \
40 fi;
41 $(Q)cp images/*.png $(BASEDIR)/images
42 $(Q)cd $(BASEDIR)/; sed -i -e "s@../stylesheets@stylesheets@g" *.html
43 $(Q)cd $(BASEDIR)/; sed -i -e "s@../images@images@g" *.html
44
45 @echo "Running Tidy and obfuscate.sh..."
46 $(Q)for filename in `find $(BASEDIR) -name "*.html"`; do \
47 tidy -config tidy.conf $$filename; \
48 true; \
49 sh obfuscate.sh $$filename; \
50 sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \
51 done;
52
53pdf: $(BASEDIR)/$(PDF_OUTPUT)
54$(RENDERTMP)/blfs-pdf.xml: $(RENDERTMP)/blfs-full.xml
55 @echo "Generating profiled XML for PDF..."
56 $(Q)xsltproc --nonet --stringparam profile.condition pdf \
57 --output $(RENDERTMP)/blfs-pdf.xml stylesheets/lfs-xsl/profile.xsl \
58 $(RENDERTMP)/blfs-full.xml
59
60$(RENDERTMP)/blfs-pdf.fo: $(RENDERTMP)/blfs-full.xml
61 @echo "Generating FO file..."
62 $(Q)xsltproc --nonet -stringparam rootid "$(ROOT_ID)" \
63 --output $(RENDERTMP)/blfs-pdf.fo stylesheets/blfs-pdf.xsl \
64 $(RENDERTMP)/blfs-pdf.xml
65 $(Q)sed -i -e 's/span="inherit"/span="all"/' $(RENDERTMP)/blfs-pdf.fo
66
67$(BASEDIR)/$(PDF_OUTPUT): $(RENDERTMP)/blfs-pdf.fo
68 @echo "Generating PDF file..."
69 $(Q)if [ ! -e $(BASEDIR) ]; then \
70 mkdir -p $(BASEDIR); \
71 fi;
72 $(Q)fop $(RENDERTMP)/blfs-pdf.fo $(BASEDIR)/$(PDF_OUTPUT)
73
74nochunks: $(BASEDIR)/$(NOCHUNKS_OUTPUT)
75$(BASEDIR)/$(NOCHUNKS_OUTPUT): $(RENDERTMP)/blfs-html.xml
76 @echo "Generating non chunked XHTML file..."
77 $(Q)xsltproc --nonet -stringparam rootid "$(ROOT_ID)" \
78 --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
79 stylesheets/blfs-nochunks.xsl $(RENDERTMP)/blfs-html.xml
80
81 @echo "Running Tidy..."
82 $(Q)tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
83 @echo "Running obfuscate.sh..."
84 $(Q)sh obfuscate.sh $(BASEDIR)/$(NOCHUNKS_OUTPUT)
85 $(Q)sed -i -e "s@text/html@application/xhtml+xml@g" \
86 $(BASEDIR)/$(NOCHUNKS_OUTPUT)
87
88tmpdir: $(RENDERTMP)
89$(RENDERTMP):
90 @echo "Creating $(RENDERTMP)"
91 $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP)
92
93clean:
94 @echo "Cleaning $(RENDERTMP)"
95 $(Q)rm -f $(RENDERTMP)/blfs-{full,html,pdf}.xml
96 $(Q)rm -f $(RENDERTMP)/blfs-pdf.fo
97 $(Q)rm -f $(RENDERTMP)/blfs-{patch-list,patches}
98 $(Q)rmdir $(RENDERTMP) 2>/dev/null || :
99
100validxml: $(RENDERTMP)/blfs-full.xml
101$(RENDERTMP)/blfs-full.xml: index.xml general.ent
102 @echo "Validating the book..."
103 $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP)
104 $(Q)xmllint --nonet --noent --xinclude --postvalid \
105 -o $(RENDERTMP)/blfs-full.xml index.xml
106
107profile-html: $(RENDERTMP)/blfs-html.xml
108$(RENDERTMP)/blfs-html.xml: $(RENDERTMP)/blfs-full.xml
109 @echo "Generating profiled XML for XHTML..."
110 $(Q)xsltproc --nonet --stringparam profile.condition html \
111 --output $(RENDERTMP)/blfs-html.xml stylesheets/lfs-xsl/profile.xsl \
112 $(RENDERTMP)/blfs-full.xml
113
114blfs-patch-list: $(RENDERTMP)/blfs-full.xml
115 @echo "Generating blfs-patch-list..."
116 $(Q)xsltproc --nonet --output $(RENDERTMP)/blfs-patch-list \
117 stylesheets/patcheslist.xsl $(RENDERTMP)/blfs-full.xml
118 $(Q)sed -e "s|^.*/||" $(RENDERTMP)/blfs-patch-list > $(RENDERTMP)/blfs-patches
119 $(Q)sort $(RENDERTMP)/blfs-patches > blfs-patch-list
120
121wget-list: $(BASEDIR)/wget-list
122$(BASEDIR)/wget-list: $(RENDERTMP)/blfs-full.xml
123 @echo "Generating wget list..."
124 $(Q)mkdir -p $(BASEDIR)
125 $(Q)xsltproc --nonet --output $(BASEDIR)/wget-list \
126 stylesheets/wget-list.xsl $(RENDERTMP)/blfs-full.xml
127
128test-links: $(RENDERTMP)/blfs-full.xml
129$(BASEDIR)/test-links: $(RENDERTMP)/blfs-full.xml
130 @echo "Generating test-links file..."
131 $(Q)mkdir -p $(BASEDIR)
132 $(Q)xsltproc --nonet --stringparam list_mode full \
133 --output $(BASEDIR)/test-links stylesheets/wget-list.xsl \
134 $(RENDERTMP)/blfs-full.xml
135
136 @echo "Checking URLs, first pass..."
137 $(Q)rm -f $(BASEDIR)/{good,bad,true_bad}_urls
138 $(Q)for URL in `cat $(BASEDIR)/test-links`; do \
139 wget --spider --tries=2 --timeout=60 $$URL >>/dev/null 2>&1; \
140 if test $$? -ne 0 ; then echo $$URL >> $(BASEDIR)/bad_urls ; \
141 else echo $$URL >> $(BASEDIR)/good_urls 2>&1; \
142 fi; \
143 done
144
145 @echo "Checking URLs, second pass..."
146 $(Q)for URL2 in `cat $(BASEDIR)/bad_urls`; do \
147 wget --spider --tries=2 --timeout=60 $$URL2 >>/dev/null 2>&1; \
148 if test $$? -ne 0 ; then echo $$URL2 >> $(BASEDIR)/true_bad_urls ; \
149 else echo $$URL2 >> $(BASEDIR)/good_urls 2>&1; \
150 fi; \
151 done
152
153dump-commands: $(DUMPDIR)
154$(DUMPDIR): $(RENDERTMP)/blfs-full.xml
155 @echo "Dumping book commands..."
156 $(Q)xsltproc --output $(DUMPDIR)/ \
157 stylesheets/dump-commands.xsl $(RENDERTMP)/blfs-full.xml
158 $(Q)touch $(DUMPDIR)
159
160validate:
161 @echo "Validating the book..."
162 $(Q)xmllint --noout --nonet --xinclude --postvalid index.xml
163
164.PHONY: blfs all world html pdf nochunks tmpdir clean validxml \
165 profile-html wget-list test-links dump-commands validate
Note: See TracBrowser for help on using the repository browser.