source: Makefile@ 49a84b87

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 49a84b87 was 867ab10, checked in by Pierre Labastie <pieere@…>, 7 years ago

blfs-full should be rebuilt when packages.ent is touched, too

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

  • Property mode set to 100644
File size: 8.3 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
8RENDERTMP ?= $(HOME)/tmp
9CHUNK_QUIET = 1
10ROOT_ID =
11SHELL = /bin/bash
12
13ALLXML := $(filter-out $(RENDERTMP)/%, \
14 $(wildcard *.xml */*.xml */*/*.xml */*/*/*.xml */*/*/*/*.xml))
15ALLXSL := $(filter-out $(RENDERTMP)/%, \
16 $(wildcard *.xsl */*.xsl */*/*.xsl */*/*/*.xsl */*/*/*/*.xsl))
17
18ifdef V
19 Q =
20else
21 Q = @
22endif
23
24ifndef REV
25 REV = sysv
26endif
27
28ifneq ($(REV), sysv)
29 ifneq ($(REV), systemd)
30 $(error REV must be 'sysv' (default) or 'systemd'.)
31 endif
32endif
33
34ifeq ($(REV), sysv)
35 BASEDIR ?= $(HOME)/public_html/blfs-book
36 NOCHUNKS_OUTPUT ?= blfs-book.html
37 DUMPDIR ?= ~/blfs-commands
38 BLFSHTML ?= blfs-html.xml
39 BLFSHTML2 ?= blfs-html2.xml
40 BLFSFULL ?= blfs-full.xml
41else
42 BASEDIR ?= $(HOME)/public_html/blfs-systemd
43 NOCHUNKS_OUTPUT ?= blfs-sysd-book.html
44 DUMPDIR ?= ~/blfs-sysd-commands
45 BLFSHTML ?= blfs-systemd-html.xml
46 BLFSHTML2 ?= blfs-systemd-html2.xml
47 BLFSFULL ?= blfs-systemd-full.xml
48
49endif
50
51
52blfs: html wget-list
53
54all: blfs nochunks
55world: all blfs-patch-list dump-commands test-links
56
57html: $(BASEDIR)/index.html
58$(BASEDIR)/index.html: $(RENDERTMP)/$(BLFSHTML)
59 @echo "Generating chunked XHTML files..."
60 $(Q)xsltproc --nonet \
61 --stringparam chunk.quietly $(CHUNK_QUIET) \
62 --stringparam rootid "$(ROOT_ID)" \
63 --stringparam base.dir $(BASEDIR)/ \
64 stylesheets/blfs-chunked.xsl \
65 $(RENDERTMP)/$(BLFSHTML)
66
67 @echo "Copying CSS code and images..."
68 $(Q)if [ ! -e $(BASEDIR)/stylesheets ]; then \
69 mkdir -p $(BASEDIR)/stylesheets; \
70 fi;
71
72 $(Q)cp stylesheets/lfs-xsl/*.css $(BASEDIR)/stylesheets
73
74 $(Q)if [ ! -e $(BASEDIR)/images ]; then \
75 mkdir -p $(BASEDIR)/images; \
76 fi;
77 $(Q)cp images/*.png $(BASEDIR)/images
78
79 $(Q)cd $(BASEDIR)/; sed -e "s@../stylesheets@stylesheets@g" \
80 -e "s@../images@images@g" \
81 -i *.html
82
83 @echo "Running Tidy and obfuscate.sh on chunked XHTML..."
84 $(Q)for filename in `find $(BASEDIR) -name "*.html"`; do \
85 tidy -config tidy.conf $$filename; \
86 true; \
87 bash obfuscate.sh $$filename; \
88 sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \
89 done;
90
91nochunks: $(BASEDIR)/$(NOCHUNKS_OUTPUT)
92$(BASEDIR)/$(NOCHUNKS_OUTPUT): $(RENDERTMP)/$(BLFSHTML)
93 @echo "Generating non-chunked XHTML file..."
94 $(Q)xsltproc --nonet \
95 --stringparam rootid "$(ROOT_ID)" \
96 --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
97 stylesheets/blfs-nochunks.xsl \
98 $(RENDERTMP)/$(BLFSHTML)
99
100 @echo "Running Tidy and obfuscate.sh on non-chunked XHTML..."
101 $(Q)tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
102 $(Q)bash obfuscate.sh $(BASEDIR)/$(NOCHUNKS_OUTPUT)
103 $(Q)sed -i -e "s@text/html@application/xhtml+xml@g" $(BASEDIR)/$(NOCHUNKS_OUTPUT)
104
105tmpdir: $(RENDERTMP)
106$(RENDERTMP):
107 @echo "Creating $(RENDERTMP)"
108 $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP)
109
110clean:
111 @echo "Cleaning $(RENDERTMP)"
112 $(Q)rm -f $(RENDERTMP)/blfs*
113
114validate: $(RENDERTMP)/$(BLFSFULL)
115$(RENDERTMP)/$(BLFSFULL): general.ent packages.ent $(ALLXML) $(ALLXSL)
116 $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP)
117
118 @echo "Adjusting for revision $(REV)..."
119 $(Q)xsltproc --nonet \
120 --xinclude \
121 --output $(RENDERTMP)/$(BLFSHTML2) \
122 --stringparam profile.revision $(REV) \
123 stylesheets/lfs-xsl/profile.xsl \
124 index.xml
125
126 @echo "Validating the book..."
127 $(Q)xmllint --nonet \
128 --noent \
129 --postvalid \
130 --output $(RENDERTMP)/$(BLFSFULL) \
131 $(RENDERTMP)/$(BLFSHTML2)
132
133profile-html: $(RENDERTMP)/$(BLFSHTML)
134$(RENDERTMP)/$(BLFSHTML): $(RENDERTMP)/$(BLFSFULL)
135 @echo "Generating profiled XML for XHTML..."
136 $(Q)xsltproc --nonet \
137 --stringparam profile.condition html \
138 --output $(RENDERTMP)/$(BLFSHTML) \
139 stylesheets/lfs-xsl/profile.xsl \
140 $(RENDERTMP)/$(BLFSFULL)
141
142blfs-patch-list: blfs-patches.sh
143 @echo "Generating blfs patch list..."
144 $(Q)awk '{if ($$1 == "copy") {sub(/.*\//, "", $$2); print $$2}}' \
145 blfs-patches.sh > blfs-patch-list
146
147blfs-patches.sh: $(RENDERTMP)/$(BLFSFULL)
148 @echo "Generating blfs patch script..."
149 $(Q)xsltproc --nonet \
150 --output blfs-patches.sh \
151 stylesheets/patcheslist.xsl \
152 $(RENDERTMP)/$(BLFSFULL)
153
154wget-list: $(BASEDIR)/wget-list
155$(BASEDIR)/wget-list: $(RENDERTMP)/$(BLFSFULL)
156 @echo "Generating wget list for $(REV) at $(BASEDIR)/wget-list ..."
157 $(Q)mkdir -p $(BASEDIR)
158 $(Q)xsltproc --nonet \
159 --output $(BASEDIR)/wget-list \
160 stylesheets/wget-list.xsl \
161 $(RENDERTMP)/$(BLFSFULL)
162
163test-links: $(BASEDIR)/test-links
164$(BASEDIR)/test-links: $(RENDERTMP)/$(BLFSFULL)
165 @echo "Generating test-links file..."
166 $(Q)mkdir -p $(BASEDIR)
167 $(Q)xsltproc --nonet \
168 --stringparam list_mode full \
169 --output $(BASEDIR)/test-links \
170 stylesheets/wget-list.xsl \
171 $(RENDERTMP)/$(BLFSFULL)
172
173 @echo "Checking URLs, first pass..."
174 $(Q)rm -f $(BASEDIR)/{good,bad,true_bad}_urls
175 $(Q)for URL in `cat $(BASEDIR)/test-links`; do \
176 wget --spider --tries=2 --timeout=60 $$URL >>/dev/null 2>&1; \
177 if test $$? -ne 0 ; then \
178 echo $$URL >> $(BASEDIR)/bad_urls ; \
179 else \
180 echo $$URL >> $(BASEDIR)/good_urls 2>&1; \
181 fi; \
182 done
183
184 @echo "Checking URLs, second pass..."
185 $(Q)for URL2 in `cat $(BASEDIR)/bad_urls`; do \
186 wget --spider --tries=2 --timeout=60 $$URL2 >>/dev/null 2>&1; \
187 if test $$? -ne 0 ; then \
188 echo $$URL2 >> $(BASEDIR)/true_bad_urls ; \
189 else \
190 echo $$URL2 >> $(BASEDIR)/good_urls 2>&1; \
191 fi; \
192 done
193
194bootscripts:
195 @VERSION=`grep "bootscripts-version " general.ent | cut -d\" -f2`; \
196 BOOTSCRIPTS="blfs-bootscripts-$$VERSION"; \
197 if [ ! -e $$BOOTSCRIPTS.tar.xz ]; then \
198 rm -rf $(RENDERTMP)/$$BOOTSCRIPTS; \
199 mkdir $(RENDERTMP)/$$BOOTSCRIPTS; \
200 cp -a ../bootscripts/* $(RENDERTMP)/$$BOOTSCRIPTS; \
201 rm -rf ../bootscripts/archive; \
202 tar -cJhf $$BOOTSCRIPTS.tar.xz -C $(RENDERTMP) $$BOOTSCRIPTS; \
203 fi
204
205systemd-units:
206 @VERSION=`grep "systemd-units-version " general.ent | cut -d\" -f2`; \
207 UNITS="blfs-systemd-units-$$VERSION"; \
208 if [ ! -e $$UNITS.tar.xz ]; then \
209 rm -rf $(RENDERTMP)/$$UNITS; \
210 mkdir $(RENDERTMP)/$$UNITS; \
211 cp -a ../systemd-units/* $(RENDERTMP)/$$UNITS; \
212 tar -cJhf $$UNITS.tar.xz -C $(RENDERTMP) $$UNITS; \
213 fi
214
215dump-commands: $(DUMPDIR)
216$(DUMPDIR): $(RENDERTMP)/$(BLFSFULL)
217 @echo "Dumping book commands..."
218 $(Q)xsltproc --output $(DUMPDIR)/ \
219 stylesheets/dump-commands.xsl \
220 $(RENDERTMP)/$(BLFSFULL)
221 $(Q)touch $(DUMPDIR)
222
223.PHONY: blfs all world html nochunks tmpdir clean \
224 validate profile-html blfs-patch-list wget-list test-links \
225 dump-commands bootscripts systemd-units
226
227
Note: See TracBrowser for help on using the repository browser.