source: Makefile@ 9288c84

Last change on this file since 9288c84 was 9288c84, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

One-step profiling for HTML output in multi-arch branch.

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/multi-arch/BOOK@4502 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 4.4 KB
Line 
1BASEDIR=~/lfs-book
2CHUNK_QUIET=0
3PDF_OUTPUT=LFS-BOOK.pdf
4NOCHUNKS_OUTPUT=LFS-BOOK.html
5XSLROOTDIR=/usr/share/xml/docbook/xsl-stylesheets-current
6ARCH=x86
7
8lfs:
9# top-level index.html
10 xsltproc --nonet --output $(BASEDIR)/index.html stylesheets/top-index.xsl prologue/bookinfo.xml
11
12# x86
13 xsltproc --xinclude --nonet -stringparam profile.condition html -stringparam profile.arch x86 \
14 -stringparam base.dir $(BASEDIR)/x86/ stylesheets/lfs-chunked.xsl index.xml
15
16 if [ ! -e $(BASEDIR)/x86/stylesheets ]; then \
17 mkdir -p $(BASEDIR)/x86/stylesheets; \
18 fi;
19 cp stylesheets/*.css $(BASEDIR)/x86/stylesheets
20
21 if [ ! -e $(BASEDIR)/x86/images ]; then \
22 mkdir -p $(BASEDIR)/x86/images; \
23 fi;
24 cp $(XSLROOTDIR)/images/*.png \
25 $(BASEDIR)/x86/images
26 cd $(BASEDIR)/x86/; sed -i -e "s@../stylesheets@stylesheets@g" \
27 *.html
28 cd $(BASEDIR)/x86/; sed -i -e "s@../images@images@g" \
29 *.html
30
31# raq2
32 xsltproc --xinclude --nonet -stringparam profile.condition html -stringparam profile.arch raq2 \
33 -stringparam base.dir $(BASEDIR)/raq2/ stylesheets/lfs-chunked.xsl index.xml
34
35 if [ ! -e $(BASEDIR)/raq2/stylesheets ]; then \
36 mkdir -p $(BASEDIR)/raq2/stylesheets; \
37 fi;
38 cp stylesheets/*.css $(BASEDIR)/raq2/stylesheets
39
40 if [ ! -e $(BASEDIR)/raq2/images ]; then \
41 mkdir -p $(BASEDIR)/raq2/images; \
42 fi;
43 cp $(XSLROOTDIR)/images/*.png \
44 $(BASEDIR)/raq2/images
45 cd $(BASEDIR)/raq2/; sed -i -e "s@../stylesheets@stylesheets@g" \
46 *.html
47 cd $(BASEDIR)/raq2/; sed -i -e "s@../images@images@g" \
48 *.html
49
50# ppc
51 xsltproc --xinclude --nonet -stringparam profile.condition html -stringparam profile.arch ppc \
52 -stringparam base.dir $(BASEDIR)/ppc/ stylesheets/lfs-chunked.xsl index.xml
53
54 if [ ! -e $(BASEDIR)/ppc/stylesheets ]; then \
55 mkdir -p $(BASEDIR)/ppc/stylesheets; \
56 fi;
57 cp stylesheets/*.css $(BASEDIR)/ppc/stylesheets
58
59 if [ ! -e $(BASEDIR)/ppc/images ]; then \
60 mkdir -p $(BASEDIR)/ppc/images; \
61 fi;
62 cp $(XSLROOTDIR)/images/*.png \
63 $(BASEDIR)/ppc/images
64 cd $(BASEDIR)/ppc/; sed -i -e "s@../stylesheets@stylesheets@g" \
65 *.html
66 cd $(BASEDIR)/ppc/; sed -i -e "s@../images@images@g" \
67 *.html
68
69
70# common stuff
71 for filename in `find $(BASEDIR) -name "*.html"`; do \
72 tidy -config tidy.conf $$filename; \
73 true; \
74 done;
75
76 for filename in `find $(BASEDIR) -name "*.html"`; do \
77 sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \
78 done;
79
80html:
81 xsltproc --xinclude --nonet -stringparam profile.condition html -stringparam profile.arch $(ARCH) \
82 -stringparam base.dir $(BASEDIR)/ stylesheets/lfs-chunked.xsl index.xml
83
84 if [ ! -e $(BASEDIR)/stylesheets ]; then \
85 mkdir -p $(BASEDIR)/stylesheets; \
86 fi;
87 cp stylesheets/*.css $(BASEDIR)/stylesheets
88
89 if [ ! -e $(BASEDIR)/images ]; then \
90 mkdir -p $(BASEDIR)/images; \
91 fi;
92 cp $(XSLROOTDIR)/images/*.png \
93 $(BASEDIR)/images
94 cd $(BASEDIR)/; sed -i -e "s@../stylesheets@stylesheets@g" \
95 *.html
96 cd $(BASEDIR)/; sed -i -e "s@../images@images@g" \
97 *.html
98
99 for filename in `find $(BASEDIR) -name "*.html"`; do \
100 tidy -config tidy.conf $$filename; \
101 true; \
102 done;
103
104 for filename in `find $(BASEDIR) -name "*.html"`; do \
105 sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \
106 done;
107
108#
109# This is the old "pdf" target. The old "print" target below has been
110# renamed to "pdf" and will be used. This commented out previous_pdf
111# target can be removed eventually. It'll remain here for a bit for
112# historical reasons
113#
114#previous_pdf:
115# xsltproc --xinclude --nonet --output $(BASEDIR)/lfs.fo stylesheets/lfs-pdf.xsl \
116# index.xml
117# sed -i -e "s/inherit/all/" $(BASEDIR)/lfs.fo
118# fop.sh $(BASEDIR)/lfs.fo $(BASEDIR)/$(PDF_OUTPUT)
119# rm lfs.fo
120
121pdf:
122 xsltproc --xinclude --nonet --stringparam profile.condition pdf -stringparam profile.arch $(ARCH) \
123 --output $(BASEDIR)/lfs-pdf.xml stylesheets/lfs-profile.xsl index.xml
124
125 xsltproc --nonet --output $(BASEDIR)/lfs-pdf.fo stylesheets/lfs-pdf.xsl \
126 $(BASEDIR)/lfs-pdf.xml
127
128 sed -i -e "s/inherit/all/" $(BASEDIR)/lfs-pdf.fo
129
130 fop.sh $(BASEDIR)/lfs-pdf.fo $(BASEDIR)/$(PDF_OUTPUT)
131
132 rm $(BASEDIR)/lfs-pdf.xml $(BASEDIR)/lfs-pdf.fo
133
134nochunks:
135 xsltproc --xinclude --nonet -stringparam profile.condition html -stringparam profile.arch $(ARCH) \
136 --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) stylesheets/lfs-nochunks.xsl index.xml
137
138 tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
139
140 sed -i -e "s@text/html@application/xhtml+xml@g" \
141 $(BASEDIR)/$(NOCHUNKS_OUTPUT)
142
143validate:
144 xmllint --noout --nonet --xinclude --postvalid index.xml
145
Note: See TracBrowser for help on using the repository browser.