source: Makefile@ a1083b4

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 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 a1083b4 was a1083b4, checked in by Bruce Dubbs <bdubbs@…>, 10 years ago

Update to sendmail-8.14.9.
Add target to Makefile to create bootscripts.
Fix a url in apache.

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

  • Property mode set to 100644
File size: 6.5 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 =
[f5ee8c2]13#PDF_OUTPUT = BLFS-BOOK.pdf
[f3e7a94]14NOCHUNKS_OUTPUT = BLFS-BOOK.html
[ed4ba3e]15SHELL = /bin/bash
[35d9770]16
[6328b89]17ALLXML := $(filter-out $(RENDERTMP)/%, \
18 $(wildcard *.xml */*.xml */*/*.xml */*/*/*.xml */*/*/*/*.xml))
19ALLXSL := $(filter-out $(RENDERTMP)/%, \
20 $(wildcard *.xsl */*.xsl */*/*.xsl */*/*/*.xsl */*/*/*/*.xsl))
21
[35d9770]22ifdef V
23 Q =
24else
25 Q = @
26endif
27
[575bba80]28blfs: html wget-list
[f5ee8c2]29#all: blfs nochunks pdf
30all: blfs nochunks
[575bba80]31world: all blfs-patch-list dump-commands test-links
32
33html: $(BASEDIR)/index.html
34$(BASEDIR)/index.html: $(RENDERTMP)/blfs-html.xml
[35d9770]35 @echo "Generating chunked XHTML files..."
36 $(Q)xsltproc --nonet -stringparam chunk.quietly $(CHUNK_QUIET) \
[f3e7a94]37 -stringparam rootid "$(ROOT_ID)" -stringparam base.dir $(BASEDIR)/ \
[adf0149]38 stylesheets/blfs-chunked.xsl $(RENDERTMP)/blfs-html.xml
[35d9770]39
40 @echo "Copying CSS code and images..."
41 $(Q)if [ ! -e $(BASEDIR)/stylesheets ]; then \
[527966e]42 mkdir -p $(BASEDIR)/stylesheets; \
[eff3826]43 fi;
[35d9770]44 $(Q)cp stylesheets/lfs-xsl/*.css $(BASEDIR)/stylesheets
45 $(Q)if [ ! -e $(BASEDIR)/images ]; then \
[527966e]46 mkdir -p $(BASEDIR)/images; \
[eff3826]47 fi;
[35d9770]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
[4a02298]51
[5d463a51]52 @echo "Running Tidy and obfuscate.sh on chunked XHTML..."
[35d9770]53 $(Q)for filename in `find $(BASEDIR) -name "*.html"`; do \
[4a02298]54 tidy -config tidy.conf $$filename; \
55 true; \
[7ba7636]56 bash obfuscate.sh $$filename; \
[4a02298]57 sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \
58 done;
[eff3826]59
[f5ee8c2]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 \
[adf0149]64 --output $(RENDERTMP)/blfs-pdf.xml stylesheets/lfs-xsl/profile.xsl \
65 $(RENDERTMP)/blfs-full.xml
[8e1efd0]66
[f5ee8c2]67#$(RENDERTMP)/blfs-pdf.fo: $(RENDERTMP)/blfs-pdf.xml
68# @echo "Generating FO file..."
69# $(Q)xsltproc --nonet -stringparam rootid "$(ROOT_ID)" \
[575bba80]70 --output $(RENDERTMP)/blfs-pdf.fo stylesheets/blfs-pdf.xsl \
71 $(RENDERTMP)/blfs-pdf.xml
[f5ee8c2]72# $(Q)sed -i -e 's/span="inherit"/span="all"/' $(RENDERTMP)/blfs-pdf.fo
[d53eb0e]73
[f5ee8c2]74#$(BASEDIR)/$(PDF_OUTPUT): $(RENDERTMP)/blfs-pdf.fo
75# @echo "Generating PDF file..."
76# $(Q)if [ ! -e $(BASEDIR) ]; then \
[35d9770]77 mkdir -p $(BASEDIR); \
78 fi;
[f5ee8c2]79# $(Q)fop $(RENDERTMP)/blfs-pdf.fo $(BASEDIR)/$(PDF_OUTPUT)
[35d9770]80
[575bba80]81nochunks: $(BASEDIR)/$(NOCHUNKS_OUTPUT)
82$(BASEDIR)/$(NOCHUNKS_OUTPUT): $(RENDERTMP)/blfs-html.xml
[5d463a51]83 @echo "Generating non-chunked XHTML file..."
[adf9e23]84 $(Q)xsltproc --nonet -stringparam rootid "$(ROOT_ID)" \
[32797f8]85 --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
[adf0149]86 stylesheets/blfs-nochunks.xsl $(RENDERTMP)/blfs-html.xml
[35d9770]87
[5d463a51]88 @echo "Running Tidy and obfuscate.sh on non-chunked XHTML..."
[35d9770]89 $(Q)tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
[7ba7636]90 $(Q)bash obfuscate.sh $(BASEDIR)/$(NOCHUNKS_OUTPUT)
[5d463a51]91 $(Q)sed -i -e "s@text/html@application/xhtml+xml@g" \
[35d9770]92 $(BASEDIR)/$(NOCHUNKS_OUTPUT)
93
[575bba80]94tmpdir: $(RENDERTMP)
95$(RENDERTMP):
96 @echo "Creating $(RENDERTMP)"
[adf0149]97 $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP)
[575bba80]98
99clean:
100 @echo "Cleaning $(RENDERTMP)"
[f5ee8c2]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
[adf0149]104 $(Q)rm -f $(RENDERTMP)/blfs-{patch-list,patches}
[73fb1e74]105 $(Q)rmdir $(RENDERTMP) 2>/dev/null || :
[8e2f3658]106
[575bba80]107validxml: $(RENDERTMP)/blfs-full.xml
[6328b89]108$(RENDERTMP)/blfs-full.xml: general.ent $(ALLXML) $(ALLXSL)
[35d9770]109 @echo "Validating the book..."
[575bba80]110 $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP)
[35d9770]111 $(Q)xmllint --nonet --noent --xinclude --postvalid \
[2182f2c]112 -o $(RENDERTMP)/blfs-full.xml index.xml
[35d9770]113
[575bba80]114profile-html: $(RENDERTMP)/blfs-html.xml
115$(RENDERTMP)/blfs-html.xml: $(RENDERTMP)/blfs-full.xml
[35d9770]116 @echo "Generating profiled XML for XHTML..."
117 $(Q)xsltproc --nonet --stringparam profile.condition html \
[adf0149]118 --output $(RENDERTMP)/blfs-html.xml stylesheets/lfs-xsl/profile.xsl \
119 $(RENDERTMP)/blfs-full.xml
[35d9770]120
[0238e7e]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 \
[adf0149]129 stylesheets/patcheslist.xsl $(RENDERTMP)/blfs-full.xml
[35d9770]130
[575bba80]131wget-list: $(BASEDIR)/wget-list
132$(BASEDIR)/wget-list: $(RENDERTMP)/blfs-full.xml
[35d9770]133 @echo "Generating wget list..."
134 $(Q)mkdir -p $(BASEDIR)
135 $(Q)xsltproc --nonet --output $(BASEDIR)/wget-list \
[adf0149]136 stylesheets/wget-list.xsl $(RENDERTMP)/blfs-full.xml
[35d9770]137
[cb55412]138test-links: $(BASEDIR)/test-links
[575bba80]139$(BASEDIR)/test-links: $(RENDERTMP)/blfs-full.xml
[35d9770]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 \
[adf0149]144 $(RENDERTMP)/blfs-full.xml
[35d9770]145
[cdd254a]146 @echo "Checking URLs, first pass..."
[35d9770]147 $(Q)rm -f $(BASEDIR)/{good,bad,true_bad}_urls
148 $(Q)for URL in `cat $(BASEDIR)/test-links`; do \
[7818e780]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
[35d9770]154
[cdd254a]155 @echo "Checking URLs, second pass..."
[35d9770]156 $(Q)for URL2 in `cat $(BASEDIR)/bad_urls`; do \
[7818e780]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
[a1083b4]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
[575bba80]174dump-commands: $(DUMPDIR)
175$(DUMPDIR): $(RENDERTMP)/blfs-full.xml
[35d9770]176 @echo "Dumping book commands..."
177 $(Q)xsltproc --output $(DUMPDIR)/ \
[adf0149]178 stylesheets/dump-commands.xsl $(RENDERTMP)/blfs-full.xml
[575bba80]179 $(Q)touch $(DUMPDIR)
[35d9770]180
181validate:
182 @echo "Validating the book..."
183 $(Q)xmllint --noout --nonet --xinclude --postvalid index.xml
184
[f5ee8c2]185.PHONY: blfs all world html nochunks tmpdir clean validxml \
[a1083b4]186 profile-html wget-list test-links dump-commands validate \
187 bootscripts
[f5ee8c2]188
189#.PHONY: blfs all world html pdf nochunks tmpdir clean validxml \
[575bba80]190 profile-html wget-list test-links dump-commands validate
Note: See TracBrowser for help on using the repository browser.