source: Makefile@ efe19ba

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt nosym 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 efe19ba was efe19ba, checked in by Bruce Dubbs <bdubbs@…>, 8 years ago

UPdate Makefile to support systemd merge

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

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