source: Makefile@ dd34be2c

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.7 7.8 7.9 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 krejzi/svn 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 dd34be2c was 6d3005f, checked in by Igor Živković <igor@…>, 10 years ago

revert some accidentally pulled changes from my environment

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

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