2 ## This is part of CLFSja package.
4 SUBDIRS=appendices boot bootable chroot cross-tools \
5 final-preps final-system introduction materials network \
6 partitioning prologue schema stylesheets system-config \
7 temp-system testsuite-tools the-end
8 BOOKdir = @abs_bookdir@
30 EXTRA_DIST = $(CHANGE_FILES) $(CHANGE_FILES_ENT) \
31 tidy.ch userconfig.xml.in
33 srcs = $(CHANGE_FILES:.ch=.xml) $(CHANGE_FILES_ENT:.ch=.ent)
34 EXTRACLEANFILES = $(srcs)
36 SUFFIXES = .ch .ent .xml
38 $(top_builddir)/$(CTIE) -m $@ $(BOOKdir)/$@ $(srcdir)/$*.ch >/dev/null
40 $(top_builddir)/$(CTIE) -m $@ $(BOOKdir)/$@ $(srcdir)/$*.ch >/dev/null
42 all: ctie $(srcs) tidy.conf _images _shells html
45 @$(MAKE) -C $(top_builddir)/$@ $@ >/dev/null
47 general_ja.ent: $(srcdir)/general_ja.ch
51 # $(MKDIR_P) stylesheets
52 # cp -R $(BOOKdir)/stylesheets/* stylesheets
55 @$(MAKE) -C stylesheets
59 cp -R $(BOOKdir)/images/* images
62 cp -p $(BOOKdir)/tidy.sh .
63 cp -p $(BOOKdir)/obfuscate.sh .
65 tidy.conf: $(BOOKdir)/tidy.conf $(srcdir)/tidy.ch
66 $(top_builddir)/$(CTIE) -m $@ $^ >/dev/null
69 RENDERDIR = $(TOP)/../render
71 VALIDATEDIR = $(RENDERDIR)/validate
72 PROFILEDIR = $(RENDERDIR)/profile
74 HTMLDIR = $(RENDERDIR)/html
75 NOCHUNKDIR = $(RENDERDIR)/nochunk
77 FODIR = $(RENDERDIR)/fo
78 PDFDIR = $(RENDERDIR)/pdf
80 TROUBLEDIR = $(RENDERDIR)/trouble
81 DUMPDIR = $(RENDERDIR)/commands
82 DLLISTDIR = $(RENDERDIR)/download-list
87 ARCHS = x86 x86_64 x86_64-64 \
88 sparc sparc64 sparc64-64 \
89 mips mips64 mips64-64 \
101 .PHONY: tidy tidy-f tidy-d
102 #ifeq ($(shell which tidy >/dev/null 2>&1 && echo yes),yes)
104 @$(MAKE) --no-print-directory tidy-d TIDY_DIR=$(HTMLDIR)
107 @echo "Running tidy on F:$(shell basename $(TIDY_FILE))"
108 @$(TOP)/tidy.sh "$(TIDY_FILE)"
111 @echo "Running tidy on D:$(shell basename $(TIDY_DIR))"
112 @$(TOP)/tidy.sh "$(TIDY_DIR)"
115 # @echo "Tidy is not installed on this system"
119 titlepage: _stylesheets
120 @echo "Rendering the top-level index..."
121 $(XSLTPROC) --nonet --output $(HTMLDIR)/index.html \
122 $(TOP)/stylesheets/top-index.xsl \
124 @$(MAKE) --no-print-directory tidy-f TIDY_FILE=$(HTMLDIR)/index.html
126 ARCHS_VD_XML = $(ARCHS:%=%-validate_dump-xml)
127 .PHONY: $(ARCHS_VD_XML)
128 $(ARCHS_VD_XML): override arch = $(@:%-validate_dump-xml=%)
130 @echo "Validating $(arch) book..."
131 $(MKDIR_P) $(VALIDATEDIR)
132 $(Q)xmllint --nonet --noent --xinclude \
133 --relaxng $(TOP)/schema/docbook/4.5/rng/docbook.rng \
134 -o $(VALIDATEDIR)/$(arch)-full.xml \
135 $(TOP)/$(arch)-index.xml
137 ARCHS_P_XML = $(ARCHS:%=%-profiled-xml)
138 .PHONY: $(ARCHS_P_XML)
139 $(ARCHS_P_XML): override arch = $(@:%-profiled-xml=%)
141 @$(MAKE) --no-print-directory $(arch)-validate_dump-xml
142 @echo "Generating profiled $(arch) book..."
143 $(MKDIR_P) $(PROFILEDIR)
144 $(XSLTPROC) --nonet --stringparam profile.condition html \
145 --output $(PROFILEDIR)/$(arch)-html.xml \
146 $(TOP)/stylesheets/lfs-xsl/profile.xsl \
147 $(VALIDATEDIR)/$(arch)-full.xml
149 ARCHS_HTML = $(ARCHS:%=%-html)
150 .PHONY: html render $(ARCHS_HTML)
151 html render: $(ARCHS_HTML) titlepage
152 $(ARCHS_HTML): override arch = $(@:%-html=%)
154 @$(MAKE) --no-print-directory $(arch)-profiled-xml
156 @echo "Rendering chunked XHTML of $(arch)..."
157 $(MKDIR_P) $(HTMLDIR)/$(arch)
158 $(XSLTPROC) --nonet -stringparam chunk.quietly $(CHUNK_QUIET) \
159 -stringparam rootid "$(ROOT_ID)" \
160 -stringparam base.dir $(HTMLDIR)/$(arch)/ \
161 $(TOP)/stylesheets/clfs-chunked.xsl \
162 $(PROFILEDIR)/$(arch)-html.xml
164 @echo "Copying CSS code and images for $(arch)..."
165 $(MKDIR_P) $(HTMLDIR)/$(arch)/stylesheets
166 $(Q)cp $(TOP)/stylesheets/lfs-xsl/*.css $(HTMLDIR)/$(arch)/stylesheets
167 $(Q)sed -i -e "s@../stylesheets@stylesheets@g" $(HTMLDIR)/$(arch)/*.html
168 $(MKDIR_P) -p $(HTMLDIR)/$(arch)/images
169 $(Q)cp $(TOP)/images/*.png $(HTMLDIR)/$(arch)/images
170 $(Q)sed -i -e "s@../images@images@g" $(HTMLDIR)/$(arch)/*.html
172 @$(MAKE) --no-print-directory tidy-d TIDY_DIR=$(HTMLDIR)/$(arch)
174 ARCHS_NOCHUNKS = $(ARCHS:%=%-nochunks)
175 .PHONY: nochunks $(ARCHS_NOCHUNKS)
176 nochunks: $(ARCHS_NOCHUNKS)
177 $(ARCHS_NOCHUNKS): override arch = $(@:%-nochunks=%)
179 @$(MAKE) --no-print-directory $(arch)-profiled-xml
181 @echo "Rendering Single File HTML of $(arch)..."
182 $(MKDIR_P) $(NOCHUNKDIR)
183 $(XSLTPROC) --nonet -stringparam rootid "$(ROOT_ID)" \
184 --output $(NOCHUNKDIR)/CLFS-$(arch).html \
185 $(TOP)/stylesheets/clfs-nochunks.xsl \
186 $(PROFILEDIR)/$(arch)-html.xml
188 @$(MAKE) --no-print-directory tidy-f TIDY_FILE=$(NOCHUNKDIR)/CLFS-$(arch).html
190 ARCHS_FO = $(ARCHS:%=%-fo)
191 .PHONY: fo $(ARCHS_FO)
193 $(ARCHS_FO): override arch = $(@:%-fo=%)
195 @$(MAKE) --no-print-directory $(arch)-profiled-xml
197 @echo "Generating FO file of $(arch)..."
199 $(XSLTPROC) --nonet -stringparam rootid "$(ROOT_ID)" \
200 --output $(FODIR)/$(arch).fo \
201 $(TOP)/stylesheets/clfs-pdf.xsl \
202 $(PROFILEDIR)/$(arch)-html.xml
203 $(Q)sed -i -e 's/span="inherit"/span="all"/' $(FODIR)/$(arch).fo
205 ARCHS_PDF = $(ARCHS:%=%-pdf)
206 .PHONY: pdf $(ARCHS_PDF)
208 $(ARCHS_PDF): override arch = $(@:%-pdf=%)
210 @$(MAKE) --no-print-directory $(arch)-fo
212 @echo "Rendering PDF of $(arch)..."
214 $(Q)fop -c userconfig.xml $(FODIR)/$(arch).fo $(PDFDIR)/CLFS-$(arch).pdf
216 ARCHS_VALIDATE = $(ARCHS:%=%-validate)
217 .PHONY: validate $(ARCHS_VALIDATE)
218 validate: $(ARCHS_VALIDATE)
219 $(ARCHS_VALIDATE): override arch = $(@:%-validate=%)
221 @echo "Validating $(arch)..."
222 $(Q)xmllint --xinclude --noout --nonet \
223 --relaxng $(TOP)/schema/docbook/4.5/rng/docbook.rng \
224 $(TOP)/$(arch)-index.xml
226 ARCHS_TROUBLE = $(ARCHS:%=%-trouble)
227 .PHONY: trouble $(ARCHS_TROUBLE)
228 trouble: $(ARCHS_TROUBLE)
229 $(ARCHS_TROUBLE): override arch = $(@:%-trouble=%)
231 @echo "Troubleshooting $(arch)..."
232 $(MKDIR_P) $(TROUBLEDIR)
233 $(Q)xmllint --xinclude --nonet \
234 --relaxng $(TOP)/schema/docbook/4.5/rng/docbook.rng \
235 -o $(TROUBLEDIR)/dump-$(arch) \
236 $(TOP)/$(arch)-index.xml
237 $(Q)xmllint --xinclude --noout --nonet \
238 --relaxng $(TOP)/schema/docbook/4.5/rng/docbook.rng \
239 $(TROUBLEDIR)/dump-$(arch)
240 @echo "You can now look at $(TROUBLEDIR)/dump-$(arch) to see the errors"
242 ARCHS_DUMP = $(ARCHS:%=%-dump)
243 .PHONY: dump-commands $(ARCHS_DUMP)
244 dump-commands: $(ARCHS_DUMP)
245 $(ARCHS_DUMP): override arch = $(@:%-dump=%)
247 @echo "Extracting commands from $(arch)..."
248 $(MKDIR_P) $(DUMPDIR)/$(arch)
249 $(XSLTPROC) --xinclude --nonet \
250 --output $(DUMPDIR)/$(arch)/ \
251 $(TOP)/stylesheets/dump-commands.xsl \
252 $(TOP)/$(arch)-index.xml
254 ARCHS_DLLIST = $(ARCHS:%=%-dllist)
255 .PHONY: download-list $(ARCHS_DLLIST)
256 download-list: $(ARCHS_DLLIST)
257 $(ARCHS_DLLIST): override arch = $(@:%-dllist=%)
259 @echo "Creating download list for $(arch)..."
260 $(MKDIR_P) $(DLLISTDIR)
261 $(XSLTPROC) --xinclude --nonet \
262 --output $(DLLISTDIR)/$(arch).list \
263 $(TOP)/stylesheets/wget.xsl \
264 $(TOP)/$(arch)-index.xml
266 FG_GREEN = $(shell echo -e '\e[0;32m')
267 FG_BLUE = $(shell echo -e '\e[0;34m')
268 FG_DEFAULT = $(shell echo -e '\e[0;0m')
270 @echo "Output: $(RENDERDIR)"
273 @echo " $(FG_GREEN)clfs lfs tidy html render titlepage $(FG_BLUE)$(ARCHS_HTML)$(FG_DEFAULT)"
275 @echo "NoChunks Targets"
276 @echo " $(FG_GREEN)nochunks tidy $(FG_BLUE)$(ARCHS_NOCHUNKS)$(FG_DEFAULT)"
279 @echo " $(FG_GREEN)fo $(FG_BLUE)$(ARCHS_FO)$(FG_DEFAULT)"
282 @echo " $(FG_GREEN)pdf $(FG_BLUE)$(ARCHS_PDF)$(FG_DEFAULT)"
284 @echo "Validate Targets"
285 @echo " $(FG_GREEN)validate $(FG_BLUE)$(ARCHS_VALIDATE)$(FG_DEFAULT)"
287 @echo "Trouble Targets"
288 @echo " $(FG_GREEN)trouble $(FG_BLUE)$(ARCHS_TROUBLE)$(FG_DEFAULT)"
290 @echo "Dump-Commands Targets"
291 @echo " $(FG_GREEN)dump-commands $(FG_BLUE)$(ARCHS_DUMP)$(FG_DEFAULT)"
293 @echo "Download-List Targets"
294 @echo " $(FG_GREEN)download-list $(FG_BLUE)$(ARCHS_DLLIST)$(FG_DEFAULT)"