source: Makefile@ bb3c618

11.3 12.0 12.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18 xry111/xf86-video-removal
Last change on this file since bb3c618 was e3047fd, checked in by Pierre Labastie <pierre.labastie@…>, 17 months ago

Restore the render system to what it was before pythonhosted changes

  • Property mode set to 100644
File size: 10.4 KB
RevLine 
[a2f7a1c]1# vim:ts=3
[19599c63]2# Makefile for BLFS Book generation.
3# By Tushar Teredesai <tushar@linuxfromscratch.org>
4# 2004-01-31
[35d9770]5
[19599c63]6# Adjust these to suit your installation
[efe19ba]7RENDERTMP ?= $(HOME)/tmp
8CHUNK_QUIET = 1
9ROOT_ID =
10SHELL = /bin/bash
[35d9770]11
[51bec49]12ALLXML := $(filter-out $(RENDERTMP)/%, \
[e3047fd]13 $(wildcard *.xml */*.xml */*/*.xml */*/*/*.xml */*/*/*/*.xml))
[51bec49]14ALLXSL := $(filter-out $(RENDERTMP)/%, \
[e3047fd]15 $(wildcard *.xsl */*.xsl */*/*.xsl */*/*/*.xsl */*/*/*/*.xsl))
[3c265f56]16
[35d9770]17ifdef V
18 Q =
19else
20 Q = @
21endif
22
[efe19ba]23ifndef REV
24 REV = sysv
25endif
26
27ifneq ($(REV), sysv)
28 ifneq ($(REV), systemd)
29 $(error REV must be 'sysv' (default) or 'systemd'.)
30 endif
31endif
32
33ifeq ($(REV), sysv)
34 BASEDIR ?= $(HOME)/public_html/blfs-book
35 NOCHUNKS_OUTPUT ?= blfs-book.html
36 DUMPDIR ?= ~/blfs-commands
[f852e706]37 BLFSHTML ?= blfs-html.xml
38 BLFSHTML2 ?= blfs-html2.xml
39 BLFSFULL ?= blfs-full.xml
[efe19ba]40else
41 BASEDIR ?= $(HOME)/public_html/blfs-systemd
42 NOCHUNKS_OUTPUT ?= blfs-sysd-book.html
43 DUMPDIR ?= ~/blfs-sysd-commands
[f852e706]44 BLFSHTML ?= blfs-systemd-html.xml
45 BLFSHTML2 ?= blfs-systemd-html2.xml
46 BLFSFULL ?= blfs-systemd-full.xml
47
[efe19ba]48endif
49
[e3047fd]50
[575bba80]51blfs: html wget-list
[efe19ba]52
[820b6d7]53help:
54 @echo ""
55 @echo "make <parameters> <targets>"
56 @echo ""
57 @echo "Parameters:"
58 @echo " REV=<rev> Build variation of book"
59 @echo " Valid values for REV are:"
60 @echo " * sysv - Build book for SysV"
61 @echo " * systemd - Build book for systemd"
62 @echo " Defaults to 'sysv'"
63 @echo ""
64 @echo " BASEDIR=<dir> Put the output in directory <dir>."
65 @echo " Defaults to"
66 @echo " 'HOME/public_html/blfs-book' if REV=sysv (or unset)"
67 @echo " or to"
68 @echo " 'HOME/public_html/blfs-book-systemd' if REV=systemd"
69 @echo ""
70 @echo " V=<val> If <val> is a non-empty value, all"
71 @echo " steps to produce the output is shown."
72 @echo " Default is unset."
73 @echo ""
74 @echo "Targets:"
75 @echo " help Show this help text."
76 @echo ""
77 @echo " blfs Builds targets 'html' and 'wget-list'."
78 @echo ""
79 @echo " html Builds the HTML pages of the book."
80 @echo ""
81 @echo " wget-list Produces a list of all packages to download."
82 @echo " Output is BASEDIR/wget-list"
83 @echo ""
84 @echo " nochunks Builds the book as a one-pager. The output"
85 @echo " is a large single HTML page containing the"
86 @echo " whole book."
87 @echo ""
88 @echo " Parameter NOCHUNKS_OUTPUT=<filename> controls"
89 @echo " the name of the HTML file."
90 @echo ""
91 @echo " validate Runs validation checks on the XML files."
92 @echo ""
93 @echo " test-links Runs validation checks on URLs in the book."
94 @echo " Produces a file named BASEDIR/bad_urls containing"
95 @echo " URLS which are invalid and a BASEDIR/good_urls"
96 @echo " containing all valid URLs."
97 @echo ""
98
[f5ee8c2]99all: blfs nochunks
[575bba80]100world: all blfs-patch-list dump-commands test-links
101
102html: $(BASEDIR)/index.html
[e3047fd]103$(BASEDIR)/index.html: $(RENDERTMP)/$(BLFSHTML) version
[35d9770]104 @echo "Generating chunked XHTML files..."
[efe19ba]105 $(Q)xsltproc --nonet \
106 --stringparam chunk.quietly $(CHUNK_QUIET) \
107 --stringparam rootid "$(ROOT_ID)" \
108 --stringparam base.dir $(BASEDIR)/ \
109 stylesheets/blfs-chunked.xsl \
[f852e706]110 $(RENDERTMP)/$(BLFSHTML)
[35d9770]111
112 @echo "Copying CSS code and images..."
113 $(Q)if [ ! -e $(BASEDIR)/stylesheets ]; then \
[efe19ba]114 mkdir -p $(BASEDIR)/stylesheets; \
115 fi;
116
[35d9770]117 $(Q)cp stylesheets/lfs-xsl/*.css $(BASEDIR)/stylesheets
[8ed58ee]118 $(Q)sed -i 's|../stylesheet|stylesheet|' $(BASEDIR)/index.html
[efe19ba]119
[35d9770]120 $(Q)if [ ! -e $(BASEDIR)/images ]; then \
[efe19ba]121 mkdir -p $(BASEDIR)/images; \
122 fi;
[35d9770]123 $(Q)cp images/*.png $(BASEDIR)/images
[efe19ba]124
[869909a]125 $(Q)cd $(BASEDIR)/; sed -e "s@../images@images@g" \
[efe19ba]126 -i *.html
[4a02298]127
[5d463a51]128 @echo "Running Tidy and obfuscate.sh on chunked XHTML..."
[efe19ba]129 $(Q)for filename in `find $(BASEDIR) -name "*.html"`; do \
130 tidy -config tidy.conf $$filename; \
131 true; \
132 bash obfuscate.sh $$filename; \
[28909b72]133 sed -i -e "1,20s@text/html@application/xhtml+xml@g" $$filename; \
[efe19ba]134 done;
[6d3005f]135
[575bba80]136nochunks: $(BASEDIR)/$(NOCHUNKS_OUTPUT)
[e3047fd]137$(BASEDIR)/$(NOCHUNKS_OUTPUT): $(RENDERTMP)/$(BLFSHTML) version
[5d463a51]138 @echo "Generating non-chunked XHTML file..."
[efe19ba]139 $(Q)xsltproc --nonet \
140 --stringparam rootid "$(ROOT_ID)" \
141 --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
142 stylesheets/blfs-nochunks.xsl \
[f852e706]143 $(RENDERTMP)/$(BLFSHTML)
[35d9770]144
[5d463a51]145 @echo "Running Tidy and obfuscate.sh on non-chunked XHTML..."
[35d9770]146 $(Q)tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
[7ba7636]147 $(Q)bash obfuscate.sh $(BASEDIR)/$(NOCHUNKS_OUTPUT)
[28909b72]148 $(Q)sed -i -e "1,20s@text/html@application/xhtml+xml@g" $(BASEDIR)/$(NOCHUNKS_OUTPUT)
[35d9770]149
[575bba80]150tmpdir: $(RENDERTMP)
151$(RENDERTMP):
152 @echo "Creating $(RENDERTMP)"
[adf0149]153 $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP)
[575bba80]154
155clean:
156 @echo "Cleaning $(RENDERTMP)"
[f852e706]157 $(Q)rm -f $(RENDERTMP)/blfs*
[8e2f3658]158
[f852e706]159validate: $(RENDERTMP)/$(BLFSFULL)
[e3047fd]160$(RENDERTMP)/$(BLFSFULL): general.ent packages.ent $(ALLXML) $(ALLXSL) version
[575bba80]161 $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP)
[efe19ba]162
163 @echo "Adjusting for revision $(REV)..."
164 $(Q)xsltproc --nonet \
165 --xinclude \
[a2f7a1c]166 --output $(RENDERTMP)/$(BLFSHTML2) \
[efe19ba]167 --stringparam profile.revision $(REV) \
168 stylesheets/lfs-xsl/profile.xsl \
169 index.xml
170
171 @echo "Validating the book..."
172 $(Q)xmllint --nonet \
173 --noent \
174 --postvalid \
[a2f7a1c]175 --output $(RENDERTMP)/$(BLFSFULL) \
[f852e706]176 $(RENDERTMP)/$(BLFSHTML2)
[35d9770]177
[f852e706]178profile-html: $(RENDERTMP)/$(BLFSHTML)
[e3047fd]179$(RENDERTMP)/$(BLFSHTML): $(RENDERTMP)/$(BLFSFULL) version
[35d9770]180 @echo "Generating profiled XML for XHTML..."
[efe19ba]181 $(Q)xsltproc --nonet \
182 --stringparam profile.condition html \
[a2f7a1c]183 --output $(RENDERTMP)/$(BLFSHTML) \
[efe19ba]184 stylesheets/lfs-xsl/profile.xsl \
[f852e706]185 $(RENDERTMP)/$(BLFSFULL)
[35d9770]186
[0238e7e]187blfs-patch-list: blfs-patches.sh
188 @echo "Generating blfs patch list..."
189 $(Q)awk '{if ($$1 == "copy") {sub(/.*\//, "", $$2); print $$2}}' \
190 blfs-patches.sh > blfs-patch-list
191
[e3047fd]192blfs-patches.sh: $(RENDERTMP)/$(BLFSFULL) version
[0238e7e]193 @echo "Generating blfs patch script..."
[efe19ba]194 $(Q)xsltproc --nonet \
195 --output blfs-patches.sh \
196 stylesheets/patcheslist.xsl \
[f852e706]197 $(RENDERTMP)/$(BLFSFULL)
[35d9770]198
[575bba80]199wget-list: $(BASEDIR)/wget-list
[e3047fd]200$(BASEDIR)/wget-list: $(RENDERTMP)/$(BLFSFULL) version
[efe19ba]201 @echo "Generating wget list for $(REV) at $(BASEDIR)/wget-list ..."
[35d9770]202 $(Q)mkdir -p $(BASEDIR)
[efe19ba]203 $(Q)xsltproc --nonet \
204 --output $(BASEDIR)/wget-list \
205 stylesheets/wget-list.xsl \
[f852e706]206 $(RENDERTMP)/$(BLFSFULL)
[35d9770]207
[cb55412]208test-links: $(BASEDIR)/test-links
[e3047fd]209$(BASEDIR)/test-links: $(RENDERTMP)/$(BLFSFULL) version
[35d9770]210 @echo "Generating test-links file..."
211 $(Q)mkdir -p $(BASEDIR)
[efe19ba]212 $(Q)xsltproc --nonet \
213 --stringparam list_mode full \
214 --output $(BASEDIR)/test-links \
215 stylesheets/wget-list.xsl \
[f852e706]216 $(RENDERTMP)/$(BLFSFULL)
[35d9770]217
[cdd254a]218 @echo "Checking URLs, first pass..."
[35d9770]219 $(Q)rm -f $(BASEDIR)/{good,bad,true_bad}_urls
[efe19ba]220 $(Q)for URL in `cat $(BASEDIR)/test-links`; do \
221 wget --spider --tries=2 --timeout=60 $$URL >>/dev/null 2>&1; \
222 if test $$? -ne 0 ; then \
223 echo $$URL >> $(BASEDIR)/bad_urls ; \
224 else \
225 echo $$URL >> $(BASEDIR)/good_urls 2>&1; \
226 fi; \
227 done
[35d9770]228
[cdd254a]229 @echo "Checking URLs, second pass..."
[efe19ba]230 $(Q)for URL2 in `cat $(BASEDIR)/bad_urls`; do \
231 wget --spider --tries=2 --timeout=60 $$URL2 >>/dev/null 2>&1; \
232 if test $$? -ne 0 ; then \
233 echo $$URL2 >> $(BASEDIR)/true_bad_urls ; \
234 else \
235 echo $$URL2 >> $(BASEDIR)/good_urls 2>&1; \
236 fi; \
237 done
[7818e780]238
[6d3005f]239bootscripts:
240 @VERSION=`grep "bootscripts-version " general.ent | cut -d\" -f2`; \
[efe19ba]241 BOOTSCRIPTS="blfs-bootscripts-$$VERSION"; \
242 if [ ! -e $$BOOTSCRIPTS.tar.xz ]; then \
243 rm -rf $(RENDERTMP)/$$BOOTSCRIPTS; \
244 mkdir $(RENDERTMP)/$$BOOTSCRIPTS; \
245 cp -a ../bootscripts/* $(RENDERTMP)/$$BOOTSCRIPTS; \
246 rm -rf ../bootscripts/archive; \
247 tar -cJhf $$BOOTSCRIPTS.tar.xz -C $(RENDERTMP) $$BOOTSCRIPTS; \
[6d3005f]248 fi
249
[f852e706]250systemd-units:
251 @VERSION=`grep "systemd-units-version " general.ent | cut -d\" -f2`; \
[a2f7a1c]252 UNITS="blfs-systemd-units-$$VERSION"; \
253 if [ ! -e $$UNITS.tar.xz ]; then \
254 rm -rf $(RENDERTMP)/$$UNITS; \
255 mkdir $(RENDERTMP)/$$UNITS; \
256 cp -a ../systemd-units/* $(RENDERTMP)/$$UNITS; \
257 tar -cJhf $$UNITS.tar.xz -C $(RENDERTMP) $$UNITS; \
[f852e706]258 fi
259
[575bba80]260dump-commands: $(DUMPDIR)
[e3047fd]261$(DUMPDIR): $(RENDERTMP)/$(BLFSFULL) version
[35d9770]262 @echo "Dumping book commands..."
[efe19ba]263 $(Q)xsltproc --output $(DUMPDIR)/ \
264 stylesheets/dump-commands.xsl \
[f852e706]265 $(RENDERTMP)/$(BLFSFULL)
[575bba80]266 $(Q)touch $(DUMPDIR)
[35d9770]267
[e3047fd]268.PHONY: blfs all world html nochunks tmpdir clean \
269 validate profile-html blfs-patch-list wget-list test-links \
270 dump-commands bootscripts systemd-units version
[05d5b11]271
[e3047fd]272version:
273 $(Q)./git-version.sh $(REV)
Note: See TracBrowser for help on using the repository browser.