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
RevLine 
[19599c63]1# Makefile for BLFS Book generation.
2# By Tushar Teredesai <tushar@linuxfromscratch.org>
3# 2004-01-31
[35d9770]4
[19599c63]5# Adjust these to suit your installation
[1d36178d]6BASEDIR ?= $(HOME)/public_html/blfs-book-xsl
7DUMPDIR ?= $(HOME)/blfs-commands
[c41b38f]8RENDERTMP ?= /tmp
[f3e7a94]9CHUNK_QUIET = 1
10ROOT_ID =
11NOCHUNKS_OUTPUT = BLFS-BOOK.html
[c41b38f]12SHELL = /bin/sh
[35d9770]13
[6328b89]14ALLXML := $(filter-out $(RENDERTMP)/%, \
15 $(wildcard *.xml */*.xml */*/*.xml */*/*/*.xml */*/*/*/*.xml))
16ALLXSL := $(filter-out $(RENDERTMP)/%, \
17 $(wildcard *.xsl */*.xsl */*/*.xsl */*/*/*.xsl */*/*/*/*.xsl))
18
[35d9770]19ifdef V
20 Q =
21else
22 Q = @
23endif
24
[575bba80]25blfs: html wget-list
[f5ee8c2]26all: blfs nochunks
[575bba80]27world: all blfs-patch-list dump-commands test-links
28
29html: $(BASEDIR)/index.html
30$(BASEDIR)/index.html: $(RENDERTMP)/blfs-html.xml
[35d9770]31 @echo "Generating chunked XHTML files..."
32 $(Q)xsltproc --nonet -stringparam chunk.quietly $(CHUNK_QUIET) \
[f3e7a94]33 -stringparam rootid "$(ROOT_ID)" -stringparam base.dir $(BASEDIR)/ \
[adf0149]34 stylesheets/blfs-chunked.xsl $(RENDERTMP)/blfs-html.xml
[35d9770]35
36 @echo "Copying CSS code and images..."
37 $(Q)if [ ! -e $(BASEDIR)/stylesheets ]; then \
[527966e]38 mkdir -p $(BASEDIR)/stylesheets; \
[eff3826]39 fi;
[35d9770]40 $(Q)cp stylesheets/lfs-xsl/*.css $(BASEDIR)/stylesheets
41 $(Q)if [ ! -e $(BASEDIR)/images ]; then \
[527966e]42 mkdir -p $(BASEDIR)/images; \
[eff3826]43 fi;
[35d9770]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
[4a02298]47
[5d463a51]48 @echo "Running Tidy and obfuscate.sh on chunked XHTML..."
[35d9770]49 $(Q)for filename in `find $(BASEDIR) -name "*.html"`; do \
[4a02298]50 tidy -config tidy.conf $$filename; \
51 true; \
[c41b38f]52 sh obfuscate.sh $$filename; \
[4a02298]53 sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \
54 done;
[eff3826]55
[575bba80]56nochunks: $(BASEDIR)/$(NOCHUNKS_OUTPUT)
57$(BASEDIR)/$(NOCHUNKS_OUTPUT): $(RENDERTMP)/blfs-html.xml
[5d463a51]58 @echo "Generating non-chunked XHTML file..."
[adf9e23]59 $(Q)xsltproc --nonet -stringparam rootid "$(ROOT_ID)" \
[32797f8]60 --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
[adf0149]61 stylesheets/blfs-nochunks.xsl $(RENDERTMP)/blfs-html.xml
[35d9770]62
[5d463a51]63 @echo "Running Tidy and obfuscate.sh on non-chunked XHTML..."
[35d9770]64 $(Q)tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
[7ba7636]65 $(Q)bash obfuscate.sh $(BASEDIR)/$(NOCHUNKS_OUTPUT)
[5d463a51]66 $(Q)sed -i -e "s@text/html@application/xhtml+xml@g" \
[35d9770]67 $(BASEDIR)/$(NOCHUNKS_OUTPUT)
68
[575bba80]69tmpdir: $(RENDERTMP)
70$(RENDERTMP):
71 @echo "Creating $(RENDERTMP)"
[adf0149]72 $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP)
[575bba80]73
74clean:
75 @echo "Cleaning $(RENDERTMP)"
[f5ee8c2]76 $(Q)rm -f $(RENDERTMP)/blfs-{full,html}.xml
[adf0149]77 $(Q)rm -f $(RENDERTMP)/blfs-{patch-list,patches}
[73fb1e74]78 $(Q)rmdir $(RENDERTMP) 2>/dev/null || :
[8e2f3658]79
[575bba80]80validxml: $(RENDERTMP)/blfs-full.xml
[6328b89]81$(RENDERTMP)/blfs-full.xml: general.ent $(ALLXML) $(ALLXSL)
[35d9770]82 @echo "Validating the book..."
[575bba80]83 $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP)
[35d9770]84 $(Q)xmllint --nonet --noent --xinclude --postvalid \
[2182f2c]85 -o $(RENDERTMP)/blfs-full.xml index.xml
[35d9770]86
[575bba80]87profile-html: $(RENDERTMP)/blfs-html.xml
88$(RENDERTMP)/blfs-html.xml: $(RENDERTMP)/blfs-full.xml
[35d9770]89 @echo "Generating profiled XML for XHTML..."
90 $(Q)xsltproc --nonet --stringparam profile.condition html \
[adf0149]91 --output $(RENDERTMP)/blfs-html.xml stylesheets/lfs-xsl/profile.xsl \
92 $(RENDERTMP)/blfs-full.xml
[35d9770]93
[0238e7e]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 \
[adf0149]102 stylesheets/patcheslist.xsl $(RENDERTMP)/blfs-full.xml
[35d9770]103
[575bba80]104wget-list: $(BASEDIR)/wget-list
105$(BASEDIR)/wget-list: $(RENDERTMP)/blfs-full.xml
[35d9770]106 @echo "Generating wget list..."
107 $(Q)mkdir -p $(BASEDIR)
108 $(Q)xsltproc --nonet --output $(BASEDIR)/wget-list \
[adf0149]109 stylesheets/wget-list.xsl $(RENDERTMP)/blfs-full.xml
[35d9770]110
[cb55412]111test-links: $(BASEDIR)/test-links
[575bba80]112$(BASEDIR)/test-links: $(RENDERTMP)/blfs-full.xml
[35d9770]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 \
[adf0149]117 $(RENDERTMP)/blfs-full.xml
[35d9770]118
[cdd254a]119 @echo "Checking URLs, first pass..."
[35d9770]120 $(Q)rm -f $(BASEDIR)/{good,bad,true_bad}_urls
121 $(Q)for URL in `cat $(BASEDIR)/test-links`; do \
[7818e780]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
[35d9770]127
[cdd254a]128 @echo "Checking URLs, second pass..."
[35d9770]129 $(Q)for URL2 in `cat $(BASEDIR)/bad_urls`; do \
[7818e780]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
[575bba80]136dump-commands: $(DUMPDIR)
137$(DUMPDIR): $(RENDERTMP)/blfs-full.xml
[35d9770]138 @echo "Dumping book commands..."
139 $(Q)xsltproc --output $(DUMPDIR)/ \
[adf0149]140 stylesheets/dump-commands.xsl $(RENDERTMP)/blfs-full.xml
[575bba80]141 $(Q)touch $(DUMPDIR)
[35d9770]142
143validate:
144 @echo "Validating the book..."
145 $(Q)xmllint --noout --nonet --xinclude --postvalid index.xml
146
[f5ee8c2]147.PHONY: blfs all world html nochunks tmpdir clean validxml \
[575bba80]148 profile-html wget-list test-links dump-commands validate
Note: See TracBrowser for help on using the repository browser.