source: Makefile@ c41b38f

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.6 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 c41b38f was c41b38f, checked in by Igor Živković <igor@…>, 10 years ago

Update to qemu-2.1.0.

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

  • Property mode set to 100644
File size: 5.0 KB
Line 
1# Makefile for BLFS Book generation.
2# By Tushar Teredesai <tushar@linuxfromscratch.org>
3# 2004-01-31
4
5# Adjust these to suit your installation
6BASEDIR ?= $(HOME)/public_html/blfs-book-xsl
7DUMPDIR ?= $(HOME)/blfs-commands
8RENDERTMP ?= /tmp
9CHUNK_QUIET = 1
10ROOT_ID =
11NOCHUNKS_OUTPUT = BLFS-BOOK.html
12SHELL = /bin/sh
13
14ALLXML := $(filter-out $(RENDERTMP)/%, \
15 $(wildcard *.xml */*.xml */*/*.xml */*/*/*.xml */*/*/*/*.xml))
16ALLXSL := $(filter-out $(RENDERTMP)/%, \
17 $(wildcard *.xsl */*.xsl */*/*.xsl */*/*/*.xsl */*/*/*/*.xsl))
18
19ifdef V
20 Q =
21else
22 Q = @
23endif
24
25blfs: html wget-list
26all: blfs nochunks
27world: all blfs-patch-list dump-commands test-links
28
29html: $(BASEDIR)/index.html
30$(BASEDIR)/index.html: $(RENDERTMP)/blfs-html.xml
31 @echo "Generating chunked XHTML files..."
32 $(Q)xsltproc --nonet -stringparam chunk.quietly $(CHUNK_QUIET) \
33 -stringparam rootid "$(ROOT_ID)" -stringparam base.dir $(BASEDIR)/ \
34 stylesheets/blfs-chunked.xsl $(RENDERTMP)/blfs-html.xml
35
36 @echo "Copying CSS code and images..."
37 $(Q)if [ ! -e $(BASEDIR)/stylesheets ]; then \
38 mkdir -p $(BASEDIR)/stylesheets; \
39 fi;
40 $(Q)cp stylesheets/lfs-xsl/*.css $(BASEDIR)/stylesheets
41 $(Q)if [ ! -e $(BASEDIR)/images ]; then \
42 mkdir -p $(BASEDIR)/images; \
43 fi;
44 $(Q)cp images/*.png $(BASEDIR)/images
45 $(Q)cd $(BASEDIR)/; sed -i -e "s@../stylesheets@stylesheets@g" *.html
46 $(Q)cd $(BASEDIR)/; sed -i -e "s@../images@images@g" *.html
47
48 @echo "Running Tidy and obfuscate.sh on chunked XHTML..."
49 $(Q)for filename in `find $(BASEDIR) -name "*.html"`; do \
50 tidy -config tidy.conf $$filename; \
51 true; \
52 sh obfuscate.sh $$filename; \
53 sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \
54 done;
55
56nochunks: $(BASEDIR)/$(NOCHUNKS_OUTPUT)
57$(BASEDIR)/$(NOCHUNKS_OUTPUT): $(RENDERTMP)/blfs-html.xml
58 @echo "Generating non-chunked XHTML file..."
59 $(Q)xsltproc --nonet -stringparam rootid "$(ROOT_ID)" \
60 --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
61 stylesheets/blfs-nochunks.xsl $(RENDERTMP)/blfs-html.xml
62
63 @echo "Running Tidy and obfuscate.sh on non-chunked XHTML..."
64 $(Q)tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
65 $(Q)bash obfuscate.sh $(BASEDIR)/$(NOCHUNKS_OUTPUT)
66 $(Q)sed -i -e "s@text/html@application/xhtml+xml@g" \
67 $(BASEDIR)/$(NOCHUNKS_OUTPUT)
68
69tmpdir: $(RENDERTMP)
70$(RENDERTMP):
71 @echo "Creating $(RENDERTMP)"
72 $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP)
73
74clean:
75 @echo "Cleaning $(RENDERTMP)"
76 $(Q)rm -f $(RENDERTMP)/blfs-{full,html}.xml
77 $(Q)rm -f $(RENDERTMP)/blfs-{patch-list,patches}
78 $(Q)rmdir $(RENDERTMP) 2>/dev/null || :
79
80validxml: $(RENDERTMP)/blfs-full.xml
81$(RENDERTMP)/blfs-full.xml: general.ent $(ALLXML) $(ALLXSL)
82 @echo "Validating the book..."
83 $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP)
84 $(Q)xmllint --nonet --noent --xinclude --postvalid \
85 -o $(RENDERTMP)/blfs-full.xml index.xml
86
87profile-html: $(RENDERTMP)/blfs-html.xml
88$(RENDERTMP)/blfs-html.xml: $(RENDERTMP)/blfs-full.xml
89 @echo "Generating profiled XML for XHTML..."
90 $(Q)xsltproc --nonet --stringparam profile.condition html \
91 --output $(RENDERTMP)/blfs-html.xml stylesheets/lfs-xsl/profile.xsl \
92 $(RENDERTMP)/blfs-full.xml
93
94blfs-patch-list: blfs-patches.sh
95 @echo "Generating blfs patch list..."
96 $(Q)awk '{if ($$1 == "copy") {sub(/.*\//, "", $$2); print $$2}}' \
97 blfs-patches.sh > blfs-patch-list
98
99blfs-patches.sh: $(RENDERTMP)/blfs-full.xml
100 @echo "Generating blfs patch script..."
101 $(Q)xsltproc --nonet --output blfs-patches.sh \
102 stylesheets/patcheslist.xsl $(RENDERTMP)/blfs-full.xml
103
104wget-list: $(BASEDIR)/wget-list
105$(BASEDIR)/wget-list: $(RENDERTMP)/blfs-full.xml
106 @echo "Generating wget list..."
107 $(Q)mkdir -p $(BASEDIR)
108 $(Q)xsltproc --nonet --output $(BASEDIR)/wget-list \
109 stylesheets/wget-list.xsl $(RENDERTMP)/blfs-full.xml
110
111test-links: $(BASEDIR)/test-links
112$(BASEDIR)/test-links: $(RENDERTMP)/blfs-full.xml
113 @echo "Generating test-links file..."
114 $(Q)mkdir -p $(BASEDIR)
115 $(Q)xsltproc --nonet --stringparam list_mode full \
116 --output $(BASEDIR)/test-links stylesheets/wget-list.xsl \
117 $(RENDERTMP)/blfs-full.xml
118
119 @echo "Checking URLs, first pass..."
120 $(Q)rm -f $(BASEDIR)/{good,bad,true_bad}_urls
121 $(Q)for URL in `cat $(BASEDIR)/test-links`; do \
122 wget --spider --tries=2 --timeout=60 $$URL >>/dev/null 2>&1; \
123 if test $$? -ne 0 ; then echo $$URL >> $(BASEDIR)/bad_urls ; \
124 else echo $$URL >> $(BASEDIR)/good_urls 2>&1; \
125 fi; \
126 done
127
128 @echo "Checking URLs, second pass..."
129 $(Q)for URL2 in `cat $(BASEDIR)/bad_urls`; do \
130 wget --spider --tries=2 --timeout=60 $$URL2 >>/dev/null 2>&1; \
131 if test $$? -ne 0 ; then echo $$URL2 >> $(BASEDIR)/true_bad_urls ; \
132 else echo $$URL2 >> $(BASEDIR)/good_urls 2>&1; \
133 fi; \
134 done
135
136dump-commands: $(DUMPDIR)
137$(DUMPDIR): $(RENDERTMP)/blfs-full.xml
138 @echo "Dumping book commands..."
139 $(Q)xsltproc --output $(DUMPDIR)/ \
140 stylesheets/dump-commands.xsl $(RENDERTMP)/blfs-full.xml
141 $(Q)touch $(DUMPDIR)
142
143validate:
144 @echo "Validating the book..."
145 $(Q)xmllint --noout --nonet --xinclude --postvalid index.xml
146
147.PHONY: blfs all world html nochunks tmpdir clean validxml \
148 profile-html wget-list test-links dump-commands validate
Note: See TracBrowser for help on using the repository browser.