source: Makefile@ 8f65da99

11.3 12.0 12.1 12.2 gimp3 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/for-12.3 xry111/llvm18 xry111/spidermonkey128 xry111/xf86-video-removal
Last change on this file since 8f65da99 was 6837c68, checked in by Bruce Dubbs <bdubbs@…>, 21 months ago

Remove pythonhosted for now.

We will change pythonhosted.xml to incorporate all python modules
(perhaps excepting PyXDG) at https://files.pythonhosted.org
and move it to the top of the Python Modules page.

We will need to place the md5sums for the module sources in packages.ent
so they can be referenced in two places.

For now, remove the page from the build. Later we will need to clean up
Makefile and archive stylesheets/{pyhosted-inc,pythonhosted}.xsl.

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