source: clfs-sysroot/BOOK/Makefile@ 3a074a4

Last change on this file since 3a074a4 was c78de1a, checked in by Joe Ciccone <jciccone@…>, 18 years ago

Added Alpha to the book.

  • Property mode set to 100644
File size: 5.2 KB
Line 
1BASEDIR := ~/cross-lfs-sysroot-book
2DUMPDIR := ~/cross-lfs-sysroot-commands
3DLLISTDIR := ~/cross-lfs-sysroot-dllist
4CHUNK_QUIET := 1
5XSLROOTDIR := /usr/share/xml/docbook/xsl-stylesheets-1.69.1
6
7S := -
8
9ARCHS := alpha arm hppa x86
10
11ARCHS_HTML := $(ARCHS:%=%$(S)html)
12ARCHS_NOCHUNKS := $(ARCHS:%=%$(S)nochunks)
13ARCHS_PDF := $(ARCHS:%=%$(S)pdf)
14ARCHS_TEXT := $(ARCHS:%=%$(S)text)
15ARCHS_VALIDATE := $(ARCHS:%=%$(S)validate)
16ARCHS_TROUBLE := $(ARCHS:%=%$(S)trouble)
17ARCHS_DUMP := $(ARCHS:%=%$(S)dump)
18ARCHS_DLLIST := $(ARCHS:%=%$(S)dllist)
19
20.PHONY: lfs tidy render titlepage $(ARCHS_HTML) nochunks $(ARCHS_NOCHUNKS) pdf $(ARCHS_PDF) text $(ARCHS_TEXT) validate $(ARCHS_VALIDATE) trouble $(ARCHS_TROUBLE) dump-commands $(ARCHS_DUMP) download-list $(ARCHS_DLLIST)
21
22lfs: render tidy
23
24ifeq ($(shell which tidy >/dev/null 2>&1 && echo yes),yes)
25tidy:
26 @echo Running tidy on the created HTML
27 @for filename in `find $(BASEDIR) -name "*.html"`; do \
28 tidy -config tidy.conf $$filename; \
29 true; \
30 sh obfuscate.sh $$filename; \
31 sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \
32 done;
33else
34tidy:
35 @echo Tidy is not installed on this system
36endif
37
38render: $(ARCHS_HTML) titlepage
39
40titlepage:
41 @echo "Rendering Top Index"
42 @xsltproc --nonet --output $(BASEDIR)/index.html $(PWD)/stylesheets/top-index.xsl $(PWD)/index.xml
43
44$(ARCHS_HTML): override html_arch = $(@:%$(S)html=%)
45$(ARCHS_HTML):
46 @echo "Rendering HTML of $(html_arch)..."
47 @xsltproc --xinclude --nonet -stringparam profile.condition html -stringparam chunk.quietly $(CHUNK_QUIET) -stringparam base.dir $(BASEDIR)/$(html_arch)/ $(PWD)/stylesheets/lfs-chunked.xsl $(PWD)/$(html_arch)-index.xml
48 @mkdir -p $(BASEDIR)/$(html_arch)/stylesheets
49 @cp $(PWD)/stylesheets/*.css $(BASEDIR)/$(html_arch)/stylesheets
50 @sed -i -e "s@../stylesheets@stylesheets@g" $(BASEDIR)/$(html_arch)/*.html
51 @mkdir -p $(BASEDIR)/$(html_arch)/images
52 @cp $(XSLROOTDIR)/images/*.png $(BASEDIR)/$(html_arch)/images
53 @sed -i -e "s@../images@images@g" $(BASEDIR)/$(html_arch)/*.html
54
55nochunks: $(ARCHS_NOCHUNKS) tidy
56
57$(ARCHS_NOCHUNKS): override nochunk_arch = $(@:%$(S)nochunks=%)
58$(ARCHS_NOCHUNKS):
59 @echo "Rendering Single File HTML of $(nochunk_arch)..."
60 @xsltproc --xinclude --nonet -stringparam profile.condition html --output $(BASEDIR)/CLFS-BOOK-$(nochunk_arch).html $(PWD)/stylesheets/lfs-nochunks.xsl $(nochunk_arch)-index.xml
61
62pdf: $(ARCHS_PDF)
63
64$(ARCHS_PDF): override pdf_arch = $(@:%$(S)pdf=%)
65$(ARCHS_PDF):
66 @echo "Rendering PDF of $(pdf_arch)..."
67 @xsltproc --xinclude --nonet --output $(BASEDIR)/clfs-$(pdf_arch)-pdf.fo $(PWD)/stylesheets/lfs-pdf.xsl $(pdf_arch)-index.xml
68 @sed -i -e "s/inherit/all/" $(BASEDIR)/clfs-$(pdf_arch)-pdf.fo
69 @fop.sh -q -fo $(BASEDIR)/clfs-$(pdf_arch)-pdf.fo -pdf $(BASEDIR)/CLFS-BOOK-$(pdf_arch).pdf
70 @rm $(BASEDIR)/clfs-$(pdf_arch)-pdf.fo
71
72text: $(ARCHS_TEXT)
73
74$(ARCHS_TEXT): override text_arch = $(@:%$(S)text=%)
75$(ARCHS_TEXT):
76 @echo "Rendering Text of $(text_arch)..."
77 @xsltproc --xinclude --nonet --output $(BASEDIR)/clfs-$(text_arch)-text.fo $(PWD)/stylesheets/lfs-pdf.xsl $(text_arch)-index.xml
78 @sed -i -e "s/inherit/all/" $(BASEDIR)/clfs-$(text_arch)-text.fo ; \
79 @fop.sh -q -fo $(BASEDIR)/clfs-$(text_arch)-text.fo -txt $(BASEDIR)/CLFS-BOOK-$(text_arch).txt ; \
80 @rm $(BASEDIR)/clfs-$(text_arch)-text.fo
81
82validate: $(ARCHS_VALIDATE)
83
84$(ARCHS_VALIDATE): override validate_arch = $(@:%$(S)validate=%)
85$(ARCHS_VALIDATE):
86 @echo "Validating $(validate_arch)..."
87 @xmllint --xinclude --noout --nonet --postvalid $(PWD)/$(validate_arch)-index.xml
88
89trouble: $(ARCHS_TROUBLE)
90
91$(ARCHS_TROUBLE): override trouble_arch = $(@:%$(S)trouble=%)
92$(ARCHS_TROUBLE):
93 @echo "Troubleshooting $(trouble_arch)..."
94 @xmllint --xinclude --nonet --postvalid $(PWD)/$(trouble_arch)-index.xml > /tmp/dump-$(trouble_arch)
95 @xmllint --xinclude --noout --nonet --valid /tmp/dump-$(trouble_arch)
96 @echo "You can now look at /tmp/dump-$(trouble_arch) to see the errors"
97
98dump-commands: $(ARCHS_DUMP)
99
100$(ARCHS_DUMP): override dump_arch = $(@:%$(S)dump=%)
101$(ARCHS_DUMP):
102 @echo "Extracting commands from $(dump_arch)..."
103 @xsltproc --xinclude --nonet --output $(DUMPDIR)/$(dump_arch)/ $(PWD)/stylesheets/dump-commands.xsl $(dump_arch)-index.xml
104
105download-list: $(ARCHS_DLLIST)
106
107$(ARCHS_DLLIST): override dllist_arch = $(@:%$(S)dllist=%)
108$(ARCHS_DLLIST):
109 @echo "Creating download list for $(dllist_arch)..."
110 @xsltproc --xinclude --nonet --output $(DLLISTDIR)/$(dllist_arch).dl.list $(PWD)/stylesheets/wget.xsl $(dllist_arch)-index.xml
111
112help:
113 @echo "HTML Targets"
114 @echo -e " \e[0;32mlfs tidy render titlepage \e[0;34m$(ARCHS_HTML)\e[0;0m"
115 @echo
116 @echo "NoChunks Targets"
117 @echo -e " \e[0;32mnochunks tidy \e[0;34m$(ARCHS_NOCHUNKS)\e[0;0m"
118 @echo
119 @echo "PDF Targets"
120 @echo -e " \e[0;32mpdf \e[0;34m$(ARCHS_PDF)\e[0;0m"
121 @echo
122 @echo "Text Targets"
123 @echo -e " \e[0;32mtext \e[0;34m$(ARCHS_TEXT)\e[0;0m"
124 @echo
125 @echo "Validate Targets"
126 @echo -e " \e[0;32mvalidate \e[0;34m$(ARCHS_VALIDATE)\e[0;0m"
127 @echo
128 @echo "Trouble Targets"
129 @echo -e " \e[0;32mtrouble \e[0;34m$(ARCHS_TROUBLE)\e[0;0m"
130 @echo
131 @echo "Dump-Commands Targets"
132 @echo -e " \e[0;32mdump-commands \e[0;34m$(ARCHS_DUMP)\e[0;0m"
133 @echo
134 @echo "Download-List Targets"
135 @echo -e " \e[0;32mdownload-list \e[0;34m$(ARCHS_DLLIST)\e[0;0m"
Note: See TracBrowser for help on using the repository browser.