source: Makefile@ 8e2f3658

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.3 6.3-rc1 6.3-rc2 6.3-rc3 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 8e2f3658 was 8e2f3658, checked in by Manuel Canales Esparcia <manuel@…>, 17 years ago

Added a TMPDIR envar and a tmpdir target.

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

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