source: BOOK/Makefile@ 5c8e74d

Last change on this file since 5c8e74d was 03e6a40, checked in by Chris Staub <chris@…>, 11 years ago

Merge branch 'systemd' into simp

Conflicts:

BOOK/final-system/common/bash.xml
BOOK/final-system/mips64-chapter.xml
BOOK/final-system/multilib/bash.xml
BOOK/final-system/ppc64-chapter.xml
BOOK/final-system/sparc64-chapter.xml
BOOK/final-system/x86_64-chapter.xml
BOOK/general.ent
BOOK/packages.ent
BOOK/temp-system/common/bash.xml
BOOK/temp-system/mips64-64-chapter.xml
BOOK/temp-system/mips64-chapter.xml
BOOK/temp-system/multilib/bash.xml
BOOK/temp-system/ppc64-64-chapter.xml
BOOK/temp-system/ppc64-chapter.xml
BOOK/temp-system/sparc64-64-chapter.xml
BOOK/temp-system/sparc64-chapter.xml
BOOK/temp-system/x86_64-64-chapter.xml
BOOK/temp-system/x86_64-chapter.xml

  • Property mode set to 100644
File size: 9.1 KB
RevLine 
[d63b7ee]1TOP := $(shell pwd)
[879785b]2RENDERDIR := $(TOP)/../render
[2b77c9d4]3
[879785b]4VALIDATEDIR := $(RENDERDIR)/validate
[4fe47e3]5DBXMLDIR := $(RENDERDIR)/docbook
[879785b]6PROFILEDIR := $(RENDERDIR)/profile
[2b77c9d4]7
[879785b]8HTMLDIR := $(RENDERDIR)/html
9NOCHUNKDIR := $(RENDERDIR)/nochunk
10
11FODIR := $(RENDERDIR)/fo
12PDFDIR := $(RENDERDIR)/pdf
13
14TROUBLEDIR := $(RENDERDIR)/trouble
15DUMPDIR := $(RENDERDIR)/commands
16DLLISTDIR := $(RENDERDIR)/download-list
[157ab39]17
[879785b]18CHUNK_QUIET := 1
19ROOT_ID :=
[157ab39]20
[b47a4a1]21ARCHS := x86 x86_64 x86_64-64 \
22 sparc sparc64 sparc64-64 \
23 mips mips64 mips64-64 \
[7b3a40d]24 ppc ppc64 ppc64-64
25# alpha Not tested anymore
[157ab39]26
[4fe47e3]27x86_ML := 32
28x86_64_ML := 32,64
29x86_64-64_ML := 64
30sparc_ML := 32
31sparc64_ML := 32,64
32sparc64-64_ML := 64
33mips_ML := 32
34mips64_ML := 32,n32,64
35mips64-64_ML := 64
36ppc_ML := 32
37ppc64_ML := 32,64
38alpha_ML := 64
39
[fd5c672]40ifdef V
41 Q =
42else
43 Q = @
44endif
45
[879785b]46.PHONY: clfs lfs
47clfs lfs: html
[157ab39]48
[b47a4a1]49.PHONY: tidy tidy-f tidy-d
[157ab39]50ifeq ($(shell which tidy >/dev/null 2>&1 && echo yes),yes)
51tidy:
[879785b]52 @$(MAKE) --no-print-directory tidy-d TIDY_DIR=$(HTMLDIR)
[c695188]53
54tidy-f:
55 @echo "Running tidy on F:$(shell basename $(TIDY_FILE))"
56 @$(TOP)/tidy.sh "$(TIDY_FILE)"
57
58tidy-d:
59 @echo "Running tidy on D:$(shell basename $(TIDY_DIR))"
60 @$(TOP)/tidy.sh "$(TIDY_DIR)"
[157ab39]61else
[c695188]62tidy tidy-f tidy-d:
[fd5c672]63 @echo "Tidy is not installed on this system"
[157ab39]64endif
65
[b47a4a1]66.PHONY: titlepage
[157ab39]67titlepage:
[c695188]68 @echo "Rendering the top-level index..."
[879785b]69 $(Q)xsltproc --nonet --output $(HTMLDIR)/index.html \
[d63b7ee]70 $(TOP)/stylesheets/top-index.xsl \
71 $(TOP)/index.xml
[879785b]72 @$(MAKE) --no-print-directory tidy-f TIDY_FILE=$(HTMLDIR)/index.html
[b47a4a1]73
[879785b]74ARCHS_VD_XML := $(ARCHS:%=%-validate_dump-xml)
[b47a4a1]75.PHONY: $(ARCHS_VD_XML)
76$(ARCHS_VD_XML): override arch = $(@:%-validate_dump-xml=%)
[879785b]77$(ARCHS_VD_XML):
[eef46e9]78 @echo "Validating $(arch) against the CLFS Schema..."
[879785b]79 $(Q)mkdir -p $(VALIDATEDIR)
[da28cc3]80 $(Q)xmllint --nonet --noent --xinclude \
[eef46e9]81 --relaxng $(TOP)/schema/clfs/0.1/rng/clfs.rng \
[879785b]82 -o $(VALIDATEDIR)/$(arch)-full.xml \
[271d1f96]83 $(TOP)/$(arch)-index.xml \
[eef46e9]84 2>&1 | grep -v " validates$$"; \
85 if test $${?} -ne 0; then true; else false; fi
[ff39de2]86
[4fe47e3]87ARCHS_DB_XML := $(ARCHS:%=%-db-xml)
88.PHONY: $(ARCHS_DB_XML)
89$(ARCHS_DB_XML): override arch = $(@:%-db-xml=%)
90$(ARCHS_DB_XML):
91 @$(MAKE) --no-print-directory $(arch)-validate_dump-xml
92 @echo "Generating DocBook XML for $(arch)..."
93 $(Q)mkdir -p $(DBXMLDIR)
94 $(Q)xsltproc --nonet \
95 --stringparam clfs.arch "$(arch)" \
96 --stringparam clfs.multilib "$($(arch)_ML)" \
97 --output $(DBXMLDIR)/$(arch)-db.xml \
[271d1f96]98 $(TOP)/stylesheets/clfs-profile.xsl \
[4fe47e3]99 $(VALIDATEDIR)/$(arch)-full.xml
100
[879785b]101ARCHS_P_XML := $(ARCHS:%=%-profiled-xml)
[b47a4a1]102.PHONY: $(ARCHS_P_XML)
103$(ARCHS_P_XML): override arch = $(@:%-profiled-xml=%)
[879785b]104$(ARCHS_P_XML):
[4fe47e3]105 @$(MAKE) --no-print-directory $(arch)-db-xml
[eef46e9]106 @echo "Profiling $(arch) for rendering..."
[879785b]107 $(Q)mkdir -p $(PROFILEDIR)
[4fe47e3]108 $(Q)xsltproc --nonet \
109 --stringparam profile.condition html \
[879785b]110 --output $(PROFILEDIR)/$(arch)-html.xml \
[d63b7ee]111 $(TOP)/stylesheets/lfs-xsl/profile.xsl \
[4fe47e3]112 $(DBXMLDIR)/$(arch)-db.xml
[bc7834d]113
[eef46e9]114ARCHS_VDB_XML := $(ARCHS:%=%-validate_db-xml)
115.PHONY: $(ARCHS_VDB_XML)
116$(ARCHS_VDB_XML): override arch = $(@:%-validate_db-xml=%)
117$(ARCHS_VDB_XML):
118 @echo "Validating $(arch) against the DocBook Schema..."
119 $(Q)xmllint --noout --nonet \
120 --relaxng $(TOP)/schema/docbook/4.5/rng/docbook.rng \
[4fe47e3]121 $(PROFILEDIR)/$(arch)-html.xml \
[eef46e9]122 2>&1 | grep -v " validates$$"; \
123 if test $${?} -ne 0; then true; else false; fi
124
[879785b]125ARCHS_HTML := $(ARCHS:%=%-html)
126.PHONY: html render $(ARCHS_HTML)
127html render: $(ARCHS_HTML) titlepage
[b47a4a1]128$(ARCHS_HTML): override arch = $(@:%-html=%)
[879785b]129$(ARCHS_HTML):
[b47a4a1]130 @$(MAKE) --no-print-directory $(arch)-profiled-xml
[eef46e9]131 @$(MAKE) --no-print-directory $(arch)-validate_db-xml
[fd5c672]132
[b47a4a1]133 @echo "Rendering chunked XHTML of $(arch)..."
[879785b]134 $(Q)mkdir -p $(HTMLDIR)/$(arch)
[fd5c672]135 $(Q)xsltproc --nonet -stringparam chunk.quietly $(CHUNK_QUIET) \
136 -stringparam rootid "$(ROOT_ID)" \
[879785b]137 -stringparam base.dir $(HTMLDIR)/$(arch)/ \
[d63b7ee]138 $(TOP)/stylesheets/clfs-chunked.xsl \
[879785b]139 $(PROFILEDIR)/$(arch)-html.xml
[fd5c672]140
[b47a4a1]141 @echo "Copying CSS code and images for $(arch)..."
[879785b]142 $(Q)mkdir -p $(HTMLDIR)/$(arch)/stylesheets
[d63b7ee]143 $(Q)cp $(TOP)/stylesheets/lfs-xsl/*.css $(HTMLDIR)/$(arch)/stylesheets
[879785b]144 $(Q)sed -i -e "s@../stylesheets@stylesheets@g" $(HTMLDIR)/$(arch)/*.html
145 $(Q)mkdir -p $(HTMLDIR)/$(arch)/images
[d63b7ee]146 $(Q)cp $(TOP)/images/*.png $(HTMLDIR)/$(arch)/images
[879785b]147 $(Q)sed -i -e "s@../images@images@g" $(HTMLDIR)/$(arch)/*.html
148
149 @$(MAKE) --no-print-directory tidy-d TIDY_DIR=$(HTMLDIR)/$(arch)
150
151ARCHS_NOCHUNKS := $(ARCHS:%=%-nochunks)
152.PHONY: nochunks $(ARCHS_NOCHUNKS)
153nochunks: $(ARCHS_NOCHUNKS)
[b47a4a1]154$(ARCHS_NOCHUNKS): override arch = $(@:%-nochunks=%)
[879785b]155$(ARCHS_NOCHUNKS):
[b47a4a1]156 @$(MAKE) --no-print-directory $(arch)-profiled-xml
[eef46e9]157 @$(MAKE) --no-print-directory $(arch)-validate_db-xml
[fd5c672]158
[b47a4a1]159 @echo "Rendering Single File HTML of $(arch)..."
[879785b]160 $(Q)mkdir -p $(NOCHUNKDIR)
[fd5c672]161 $(Q)xsltproc --nonet -stringparam rootid "$(ROOT_ID)" \
[879785b]162 --output $(NOCHUNKDIR)/CLFS-$(arch).html \
[d63b7ee]163 $(TOP)/stylesheets/clfs-nochunks.xsl \
[879785b]164 $(PROFILEDIR)/$(arch)-html.xml
[fd5c672]165
[879785b]166 @$(MAKE) --no-print-directory tidy-f TIDY_FILE=$(NOCHUNKDIR)/CLFS-$(arch).html
[157ab39]167
[879785b]168ARCHS_FO := $(ARCHS:%=%-fo)
169.PHONY: fo $(ARCHS_FO)
170fo: $(ARCHS_FO)
171$(ARCHS_FO): override arch = $(@:%-fo=%)
172$(ARCHS_FO):
[b47a4a1]173 @$(MAKE) --no-print-directory $(arch)-profiled-xml
[eef46e9]174 @$(MAKE) --no-print-directory $(arch)-validate_db-xml
[fd5c672]175
[b47a4a1]176 @echo "Generating FO file of $(arch)..."
[879785b]177 @mkdir -p $(FODIR)
[fd5c672]178 $(Q)xsltproc --nonet -stringparam rootid "$(ROOT_ID)" \
[879785b]179 --output $(FODIR)/$(arch).fo \
[d63b7ee]180 $(TOP)/stylesheets/clfs-pdf.xsl \
[879785b]181 $(PROFILEDIR)/$(arch)-html.xml
182 $(Q)sed -i -e 's/span="inherit"/span="all"/' $(FODIR)/$(arch).fo
183
184ARCHS_PDF := $(ARCHS:%=%-pdf)
185.PHONY: pdf $(ARCHS_PDF)
186pdf: $(ARCHS_PDF)
187$(ARCHS_PDF): override arch = $(@:%-pdf=%)
188$(ARCHS_PDF):
189 @$(MAKE) --no-print-directory $(arch)-fo
[157ab39]190
[b47a4a1]191 @echo "Rendering PDF of $(arch)..."
[879785b]192 $(Q)mkdir -p $(PDFDIR)
193 $(Q)fop $(FODIR)/$(arch).fo $(PDFDIR)/CLFS-$(arch).pdf
[157ab39]194
[879785b]195ARCHS_VALIDATE := $(ARCHS:%=%-validate)
196.PHONY: validate $(ARCHS_VALIDATE)
197validate: $(ARCHS_VALIDATE)
[b47a4a1]198$(ARCHS_VALIDATE): override arch = $(@:%-validate=%)
[157ab39]199$(ARCHS_VALIDATE):
[eef46e9]200 @echo "Validating $(arch) against the CLFS Schema..."
[da28cc3]201 $(Q)xmllint --xinclude --noout --nonet \
[eef46e9]202 --relaxng $(TOP)/schema/clfs/0.1/rng/clfs.rng \
[271d1f96]203 $(TOP)/$(arch)-index.xml \
[eef46e9]204 2>&1 | grep -v " validates$$"; \
205 if test $${?} -ne 0; then true; else false; fi
[879785b]206
207ARCHS_TROUBLE := $(ARCHS:%=%-trouble)
208.PHONY: trouble $(ARCHS_TROUBLE)
209trouble: $(ARCHS_TROUBLE)
210$(ARCHS_TROUBLE): override arch = $(@:%-trouble=%)
211$(ARCHS_TROUBLE):
212 @echo "Troubleshooting $(arch)..."
213 @mkdir -p $(TROUBLEDIR)
[da28cc3]214 $(Q)xmllint --xinclude --nonet \
[eef46e9]215 --relaxng $(TOP)/schema/clfs/0.1/rng/clfs.rng \
[879785b]216 -o $(TROUBLEDIR)/dump-$(arch) \
[271d1f96]217 $(TOP)/$(arch)-index.xml \
[eef46e9]218 2>&1 | grep -v " validates$$"; \
219 if test $${?} -ne 0; then true; else false; fi
[da28cc3]220 $(Q)xmllint --xinclude --noout --nonet \
[eef46e9]221 --relaxng $(TOP)/schema/clfs/0.1/rng/clfs.rng \
222 $(TROUBLEDIR)/dump-$(arch) \
223 2>&1 | grep -v " validates$$"; \
224 if test $${?} -ne 0; then true; else false; fi
[879785b]225 @echo "You can now look at $(TROUBLEDIR)/dump-$(arch) to see the errors"
226
227ARCHS_DUMP := $(ARCHS:%=%-dump)
228.PHONY: dump-commands $(ARCHS_DUMP)
229dump-commands: $(ARCHS_DUMP)
230$(ARCHS_DUMP): override arch = $(@:%-dump=%)
[157ab39]231$(ARCHS_DUMP):
[b47a4a1]232 @echo "Extracting commands from $(arch)..."
233 $(Q)mkdir -p $(DUMPDIR)/$(arch)
[879785b]234 $(Q)xsltproc --xinclude --nonet \
235 --output $(DUMPDIR)/$(arch)/ \
[d63b7ee]236 $(TOP)/stylesheets/dump-commands.xsl \
237 $(TOP)/$(arch)-index.xml
[157ab39]238
[879785b]239ARCHS_DLLIST := $(ARCHS:%=%-dllist)
240.PHONY: download-list $(ARCHS_DLLIST)
241download-list: $(ARCHS_DLLIST)
[b47a4a1]242$(ARCHS_DLLIST): override arch = $(@:%-dllist=%)
[157ab39]243$(ARCHS_DLLIST):
[b47a4a1]244 @echo "Creating download list for $(arch)..."
[fd5c672]245 $(Q)mkdir -p $(DLLISTDIR)
[879785b]246 $(Q)xsltproc --xinclude --nonet \
247 --output $(DLLISTDIR)/$(arch).list \
[d63b7ee]248 $(TOP)/stylesheets/wget.xsl \
249 $(TOP)/$(arch)-index.xml
[879785b]250
[48bfbe9]251ARCHS_MD5LIST := $(ARCHS:%=%-md5list)
252.PHONY: md5-list $(ARCHS_MD5LIST)
253md5-list: $(ARCHS_MD5LIST)
254$(ARCHS_MD5LIST): override arch = $(@:%-md5list=%)
255$(ARCHS_MD5LIST):
256 @echo "Creating md5 hash list for $(arch)..."
257 $(Q)mkdir -p $(DLLISTDIR)
258 $(Q)xsltproc --xinclude --nonet \
[b1a30db]259 --output $(DLLISTDIR)/$(arch).md5sum \
260 $(TOP)/stylesheets/md5sum.xsl \
261 $(TOP)/$(arch)-index.xml
262
[879785b]263FG_GREEN := $(shell echo -e '\e[0;32m')
264FG_BLUE := $(shell echo -e '\e[0;34m')
265FG_DEFAULT := $(shell echo -e '\e[0;0m')
[07114c98]266help:
[879785b]267 @echo "Output: $(RENDERDIR)"
[2b77c9d4]268 @echo
[157ab39]269 @echo "HTML Targets"
[879785b]270 @echo " $(FG_GREEN)clfs lfs tidy html render titlepage $(FG_BLUE)$(ARCHS_HTML)$(FG_DEFAULT)"
[157ab39]271 @echo
272 @echo "NoChunks Targets"
[b47a4a1]273 @echo " $(FG_GREEN)nochunks tidy $(FG_BLUE)$(ARCHS_NOCHUNKS)$(FG_DEFAULT)"
[157ab39]274 @echo
[879785b]275 @echo "FO Targets"
276 @echo " $(FG_GREEN)fo $(FG_BLUE)$(ARCHS_FO)$(FG_DEFAULT)"
277 @echo
[157ab39]278 @echo "PDF Targets"
[b47a4a1]279 @echo " $(FG_GREEN)pdf $(FG_BLUE)$(ARCHS_PDF)$(FG_DEFAULT)"
[157ab39]280 @echo
281 @echo "Validate Targets"
[b47a4a1]282 @echo " $(FG_GREEN)validate $(FG_BLUE)$(ARCHS_VALIDATE)$(FG_DEFAULT)"
[157ab39]283 @echo
284 @echo "Trouble Targets"
[b47a4a1]285 @echo " $(FG_GREEN)trouble $(FG_BLUE)$(ARCHS_TROUBLE)$(FG_DEFAULT)"
[157ab39]286 @echo
287 @echo "Dump-Commands Targets"
[b47a4a1]288 @echo " $(FG_GREEN)dump-commands $(FG_BLUE)$(ARCHS_DUMP)$(FG_DEFAULT)"
[157ab39]289 @echo
290 @echo "Download-List Targets"
[b47a4a1]291 @echo " $(FG_GREEN)download-list $(FG_BLUE)$(ARCHS_DLLIST)$(FG_DEFAULT)"
[2e0b90a]292 @echo
[48bfbe9]293 @echo "md5-List Targets"
294 @echo " $(FG_GREEN)md5-list $(FG_BLUE)$(ARCHS_MD5LIST)$(FG_DEFAULT)"
Note: See TracBrowser for help on using the repository browser.