source: Makefile@ 420e0cd

Last change on this file since 420e0cd was bf8c11f, checked in by Jim Gifford <clfs@…>, 19 years ago

r627@server (orig r625): jim | 2005-10-31 12:59:34 -0800
Import of Cross-LFS Book

  • Property mode set to 100644
File size: 3.4 KB
Line 
1BASEDIR=~/cross-lfs-book
2DUMPDIR=~/cross-lfs-commands
3DLLISTDIR=~/cross-lfs-dllist
4CHUNK_QUIET=1
5JAVA_HOME=/opt/jdk/jdk-precompiled-1.5.0
6XSLROOTDIR=/usr/share/xml/docbook/xsl-stylesheets-current
7ARCH=x86 x86_64 x86_64-64 sparc sparc64 sparc64-64 mips mips64 mips64-64 ppc alpha
8
9# HTML Rendering Chunked
10define HTML_RENDER
11 echo "Rendering HTML of $$arch..." ; \
12 xsltproc --xinclude --nonet -stringparam profile.condition html \
13 -stringparam chunk.quietly $(CHUNK_QUIET) -stringparam base.dir $(BASEDIR)/$$arch/ \
14 $(PWD)/stylesheets/lfs-chunked.xsl $(PWD)/$$arch-index.xml ; \
15 mkdir -p $(BASEDIR)/$$arch/stylesheets ; \
16 cp $(PWD)/stylesheets/*.css $(BASEDIR)/$$arch/stylesheets ; \
17 cd $(BASEDIR)/$$arch/; sed -i -e "s@../stylesheets@stylesheets@g" *.html ; \
18 mkdir -p $(BASEDIR)/$$arch/images ; \
19 cp $(XSLROOTDIR)/images/*.png $(BASEDIR)/$$arch/images ; \
20 cd $(BASEDIR)/$$arch/; sed -i -e "s@../images@images@g" *.html
21endef
22
23# HTML Rendering No Chunks
24define HTML_RENDER2
25 echo "Rendering Single File HTML of $$arch..." ; \
26 xsltproc --xinclude --nonet -stringparam profile.condition html \
27 --output $(BASEDIR)/LFS-BOOK-$$arch.html \
28 $(PWD)/stylesheets/lfs-nochunks.xsl $$arch-index.xml
29endef
30
31# PDF Rendering
32define PDF_RENDER
33 echo "Rendering PDF of $$arch..." ; \
34 xsltproc --xinclude --nonet --output $(BASEDIR)/lfs-pdf.fo \
35 $(PWD)/stylesheets/lfs-pdf.xsl $$arch-index.xml ; \
36 sed -i -e "s/inherit/all/" $(BASEDIR)/lfs-pdf.fo ; \
37 fop.sh -q $(BASEDIR)/lfs-pdf.fo -pdf $(BASEDIR)/LFS-BOOK-$$arch.pdf ; \
38 rm $(BASEDIR)/lfs-pdf.fo
39endef
40
41# Plain Text Rendering
42define TEXT_RENDER
43 echo "Rendering Text of $$arch..." ; \
44 xsltproc --xinclude --nonet --output $(BASEDIR)/lfs-pdf.fo \
45 $(PWD)/stylesheets/lfs-pdf.xsl $$arch-index.xml ; \
46 sed -i -e "s/inherit/all/" $(BASEDIR)/lfs-pdf.fo ; \
47 fop.sh $(BASEDIR)/lfs-pdf.fo -txt $(BASEDIR)/LFS-BOOK-$$arch.txt ; \
48 rm $(BASEDIR)/lfs-pdf.fo
49endef
50
51# Validation
52define VALIDATE
53 echo "Validating $$arch..." ; \
54 xmllint --xinclude --noout --nonet --postvalid $(PWD)/$$arch-index.xml
55endef
56
57# Dump commands
58define DUMP
59 echo "Extracting commands from $$arch..." ; \
60 xsltproc --xinclude --nonet --output $(DUMPDIR)/$$arch/ \
61 $(PWD)/stylesheets/dump-commands.xsl $$arch-index.xml
62endef
63
64# Get commands
65define DLLIST
66 echo "Creating download list for $$arch..." ; \
67 xsltproc --xinclude --nonet --output $(DLLISTDIR)/$$arch.dl.list \
68 $(PWD)/stylesheets/wget.xsl $$arch-index.xml
69endef
70
71lfs: toplevel render common
72
73toplevel:
74 @xsltproc --nonet --output $(BASEDIR)/index.html $(PWD)/stylesheets/top-index.xsl $(PWD)/index.xml
75
76render:
77 @for arch in $(ARCH) ; do \
78 $(HTML_RENDER) ; \
79 done
80
81common:
82 @for filename in `find $(BASEDIR) -name "*.html"`; do \
83 tidy -config tidy.conf $$filename; \
84 true; \
85 sh obfuscate.sh $$filename; \
86 sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \
87 done;
88
89nochunks: nochunk_render common
90
91nochunk_render:
92
93 @for arch in $(ARCH) ; do \
94 $(HTML_RENDER2) ; \
95 done
96
97pdf:
98 @for arch in $(ARCH) ; do \
99 $(PDF_RENDER) ; \
100 done
101
102text:
103 @for arch in $(ARCH) ; do \
104 $(TEXT_RENDER) ; \
105 done
106
107validate:
108 @for arch in $(ARCH) ; do \
109 $(VALIDATE) ; \
110 done
111
112dump-commands:
113 @for arch in $(ARCH) ; do \
114 $(DUMP) ; \
115 done
116
117download-list:
118 @for arch in $(ARCH) ; do \
119 $(DLLIST) ; \
120 done
121
122.PHONY: lfs toplevel common render nochunk nochunk_render pdf text validate dump-commands download-list
Note: See TracBrowser for help on using the repository browser.