source: Makefile@ cb55412

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 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 systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since cb55412 was cb55412, checked in by Dan Nichilson <dnicholson@…>, 16 years ago

Correct the prerequisite for the "test-links" target

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

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