Changes in / [1f9faab:4317f44]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BOOK/Makefile
r1f9faab r4317f44 10 10 ROOT_ID := 11 11 12 FG_GREEN := $(shell echo -e '\e[0;32m') 13 FG_BLUE := $(shell echo -e '\e[0;34m') 14 FG_DEFAULT := $(shell echo -e '\e[0;0m') 12 S := - 15 13 16 ARCHS := x86 x86_64 x86_64-64 \ 17 sparc sparc64 sparc64-64 \ 18 mips mips64 mips64-64 \ 19 ppc ppc64 \ 20 alpha 14 ARCHS := x86 x86_64 x86_64-64 sparc sparc64 sparc64-64 mips mips64 mips64-64 \ 15 ppc ppc64 alpha 21 16 22 17 ARCHS_VD_XML := $(ARCHS:%=%-validate_dump-xml) 23 18 ARCHS_P_XML := $(ARCHS:%=%-profiled-xml) 24 19 25 ARCHS_HTML := $(ARCHS:%=% -html)26 ARCHS_NOCHUNKS := $(ARCHS:%=% -nochunks)27 ARCHS_PDF := $(ARCHS:%=% -pdf)28 ARCHS_VALIDATE := $(ARCHS:%=% -validate)29 ARCHS_TROUBLE := $(ARCHS:%=% -trouble)30 ARCHS_DUMP := $(ARCHS:%=% -dump)31 ARCHS_DLLIST := $(ARCHS:%=% -dllist)20 ARCHS_HTML := $(ARCHS:%=%$(S)html) 21 ARCHS_NOCHUNKS := $(ARCHS:%=%$(S)nochunks) 22 ARCHS_PDF := $(ARCHS:%=%$(S)pdf) 23 ARCHS_VALIDATE := $(ARCHS:%=%$(S)validate) 24 ARCHS_TROUBLE := $(ARCHS:%=%$(S)trouble) 25 ARCHS_DUMP := $(ARCHS:%=%$(S)dump) 26 ARCHS_DLLIST := $(ARCHS:%=%$(S)dllist) 32 27 33 28 ifdef V … … 37 32 endif 38 33 39 .PHONY: clfs lfs render nochunks pdf validate trouble dump-commands download-list 34 .PHONY: clfs lfs tidy render titlepage nochunks pdf validate trouble dump-commands \ 35 download-list tmpdir $(ARCHS_HTML) $(ARCHS_NOCHUNKS) $(ARCHS_PDF) \ 36 $(ARCHS_VALIDATE) $(ARCHS_TROUBLE) $(ARCHS_DUMP) $(ARCHS_DLLIST) tmpdir 37 40 38 clfs lfs: tmpdir render 41 39 render: $(ARCHS_HTML) titlepage … … 47 45 download-list: $(ARCHS_DLLIST) 48 46 49 .PHONY: tmpdir50 47 tmpdir: 51 $(Q) mkdir -p $(RENDERTMP)48 $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP) 52 49 53 .PHONY: tidy tidy-f tidy-d54 50 ifeq ($(shell which tidy >/dev/null 2>&1 && echo yes),yes) 55 51 tidy: … … 68 64 endif 69 65 70 .PHONY: titlepage71 66 titlepage: 72 67 @echo "Rendering the top-level index..." … … 75 70 @$(MAKE) --no-print-directory tidy-f TIDY_FILE=$(BASEDIR)/index.html 76 71 72 $(ARCHS_VD_XML): override validate_dump_xml_arch = $(@:%-validate_dump-xml=%) 73 $(ARCHS_VD_XML): tmpdir 74 @echo "Validating $(validate_dump_xml_arch) book..." 75 $(Q)xmllint --nonet --noent --xinclude --postvalid \ 76 -o $(RENDERTMP)/$(validate_dump_xml_arch)-full.xml $(PWD)/$(validate_dump_xml_arch)-index.xml 77 77 78 .PHONY: $(ARCHS_VD_XML) 79 $(ARCHS_VD_XML): override arch = $(@:%-validate_dump-xml=%) 80 $(ARCHS_VD_XML): tmpdir 81 @echo "Validating $(arch) book..." 82 $(Q)xmllint --nonet --noent --xinclude --postvalid \ 83 -o $(RENDERTMP)/$(arch)-full.xml $(PWD)/$(arch)-index.xml 78 $(ARCHS_P_XML): override profiled_xml_arch = $(@:%-profiled-xml=%) 79 $(ARCHS_P_XML): tmpdir 80 @$(MAKE) --no-print-directory $(profiled_xml_arch)-validate_dump-xml 84 81 85 .PHONY: $(ARCHS_P_XML) 86 $(ARCHS_P_XML): override arch = $(@:%-profiled-xml=%) 87 $(ARCHS_P_XML): tmpdir 88 @$(MAKE) --no-print-directory $(arch)-validate_dump-xml82 @echo "Generating profiled $(profiled_xml_arch) book for XHTML..." 83 $(Q)xsltproc --nonet --stringparam profile.condition html \ 84 --output $(RENDERTMP)/$(profiled_xml_arch)-html.xml \ 85 $(PWD)/stylesheets/lfs-xsl/profile.xsl $(RENDERTMP)/$(profiled_xml_arch)-full.xml 89 86 90 @echo "Generating profiled $(arch) book for XHTML..." 91 $(Q)xsltproc --nonet --stringparam profile.condition html \ 92 --output $(RENDERTMP)/$(arch)-html.xml \ 93 $(PWD)/stylesheets/lfs-xsl/profile.xsl $(RENDERTMP)/$(arch)-full.xml 87 $(ARCHS_HTML): override html_arch = $(@:%$(S)html=%) 88 $(ARCHS_HTML): tmpdir 89 @$(MAKE) --no-print-directory $(html_arch)-profiled-xml 94 90 95 .PHONY: $(ARCHS_HTML) 96 $(ARCHS_HTML): override arch = $(@:%-html=%) 97 $(ARCHS_HTML): tmpdir 98 @$(MAKE) --no-print-directory $(arch)-profiled-xml 99 100 @echo "Rendering chunked XHTML of $(arch)..." 101 $(Q)mkdir -p $(BASEDIR)/$(arch) 91 @echo "Rendering chunked XHTML of $(html_arch)..." 92 $(Q)mkdir -p $(BASEDIR)/$(html_arch) 102 93 $(Q)xsltproc --nonet -stringparam chunk.quietly $(CHUNK_QUIET) \ 103 94 -stringparam rootid "$(ROOT_ID)" \ 104 -stringparam base.dir $(BASEDIR)/$( arch)/ \105 $(PWD)/stylesheets/clfs-chunked.xsl $(RENDERTMP)/$( arch)-html.xml95 -stringparam base.dir $(BASEDIR)/$(html_arch)/ \ 96 $(PWD)/stylesheets/clfs-chunked.xsl $(RENDERTMP)/$(html_arch)-html.xml 106 97 107 @echo "Copying CSS code and images for $( arch)..."108 $(Q)mkdir -p $(BASEDIR)/$( arch)/stylesheets109 $(Q)cp $(PWD)/stylesheets/lfs-xsl/*.css $(BASEDIR)/$( arch)/stylesheets110 $(Q)sed -i -e "s@../stylesheets@stylesheets@g" $(BASEDIR)/$( arch)/*.html111 $(Q)mkdir -p $(BASEDIR)/$( arch)/images112 $(Q)cp $(PWD)/images/*.png $(BASEDIR)/$( arch)/images113 $(Q)sed -i -e "s@../images@images@g" $(BASEDIR)/$( arch)/*.html98 @echo "Copying CSS code and images for $(html_arch)..." 99 $(Q)mkdir -p $(BASEDIR)/$(html_arch)/stylesheets 100 $(Q)cp $(PWD)/stylesheets/lfs-xsl/*.css $(BASEDIR)/$(html_arch)/stylesheets 101 $(Q)sed -i -e "s@../stylesheets@stylesheets@g" $(BASEDIR)/$(html_arch)/*.html 102 $(Q)mkdir -p $(BASEDIR)/$(html_arch)/images 103 $(Q)cp $(PWD)/images/*.png $(BASEDIR)/$(html_arch)/images 104 $(Q)sed -i -e "s@../images@images@g" $(BASEDIR)/$(html_arch)/*.html 114 105 115 @$(MAKE) --no-print-directory tidy-d TIDY_DIR=$(BASEDIR)/$( arch)106 @$(MAKE) --no-print-directory tidy-d TIDY_DIR=$(BASEDIR)/$(html_arch) 116 107 117 .PHONY: $(ARCHS_NOCHUNKS) 118 $(ARCHS_NOCHUNKS): override arch = $(@:%-nochunks=%) 108 $(ARCHS_NOCHUNKS): override nochunk_arch = $(@:%$(S)nochunks=%) 119 109 $(ARCHS_NOCHUNKS): tmpdir 120 @$(MAKE) --no-print-directory $( arch)-profiled-xml110 @$(MAKE) --no-print-directory $(nochunk_arch)-profiled-xml 121 111 122 @echo "Rendering Single File HTML of $( arch)..."112 @echo "Rendering Single File HTML of $(nochunk_arch)..." 123 113 $(Q)mkdir -p $(BASEDIR) 124 114 $(Q)xsltproc --nonet -stringparam rootid "$(ROOT_ID)" \ 125 --output $(BASEDIR)/CLFS-$( arch).html \126 $(PWD)/stylesheets/clfs-nochunks.xsl $(RENDERTMP)/$( arch)-html.xml115 --output $(BASEDIR)/CLFS-$(nochunk_arch).html \ 116 $(PWD)/stylesheets/clfs-nochunks.xsl $(RENDERTMP)/$(nochunk_arch)-html.xml 127 117 128 @$(MAKE) --no-print-directory tidy-f TIDY_FILE=$(BASEDIR)/CLFS-$( arch).html118 @$(MAKE) --no-print-directory tidy-f TIDY_FILE=$(BASEDIR)/CLFS-$(nochunk_arch).html 129 119 130 .PHONY: $(ARCHS_PDF) 131 $(ARCHS_PDF): override arch = $(@:%-pdf=%) 120 $(ARCHS_PDF): override pdf_arch = $(@:%$(S)pdf=%) 132 121 $(ARCHS_PDF): tmpdir 133 @$(MAKE) --no-print-directory $( arch)-profiled-xml122 @$(MAKE) --no-print-directory $(pdf_arch)-profiled-xml 134 123 135 @echo "Generating FO file of $( arch)..."124 @echo "Generating FO file of $(pdf_arch)..." 136 125 $(Q)xsltproc --nonet -stringparam rootid "$(ROOT_ID)" \ 137 --output $(RENDERTMP)/$( arch).fo $(PWD)/stylesheets/clfs-pdf.xsl \138 $(RENDERTMP)/$( arch)-html.xml139 $(Q)sed -i -e 's/span="inherit"/span="all"/' $(RENDERTMP)/$( arch).fo126 --output $(RENDERTMP)/$(pdf_arch).fo $(PWD)/stylesheets/clfs-pdf.xsl \ 127 $(RENDERTMP)/$(pdf_arch)-html.xml 128 $(Q)sed -i -e 's/span="inherit"/span="all"/' $(RENDERTMP)/$(pdf_arch).fo 140 129 141 @echo "Rendering PDF of $( arch)..."130 @echo "Rendering PDF of $(pdf_arch)..." 142 131 $(Q)mkdir -p $(BASEDIR) 143 $(Q)fop $(RENDERTMP)/$( arch).fo $(BASEDIR)/CLFS-$(arch).pdf132 $(Q)fop $(RENDERTMP)/$(pdf_arch).fo $(BASEDIR)/CLFS-$(pdf_arch).pdf 144 133 145 .PHONY: $(ARCHS_VALIDATE) 146 $(ARCHS_VALIDATE): override arch = $(@:%-validate=%) 134 $(ARCHS_VALIDATE): override validate_arch = $(@:%$(S)validate=%) 147 135 $(ARCHS_VALIDATE): 148 @echo "Validating $( arch)..."149 $(Q)xmllint --xinclude --noout --nonet --postvalid $(PWD)/$( arch)-index.xml136 @echo "Validating $(validate_arch)..." 137 $(Q)xmllint --xinclude --noout --nonet --postvalid $(PWD)/$(validate_arch)-index.xml 150 138 151 .PHONY: $(ARCHS_TROUBLE) 152 $(ARCHS_TROUBLE): override trouble_arch = $(@:%-trouble=%) 139 $(ARCHS_TROUBLE): override trouble_arch = $(@:%$(S)trouble=%) 153 140 $(ARCHS_TROUBLE): tmpdir 154 141 @echo "Troubleshooting $(trouble_arch)..." 155 142 $(Q)xmllint --xinclude --nonet --postvalid \ 156 -o $(RENDERTMP)/dump-$( arch) $(PWD)/$(arch)-index.xml157 $(Q)xmllint --xinclude --noout --nonet --valid $(RENDERTMP)/dump-$( arch)158 @echo "You can now look at $(RENDERTMP)/dump-$( arch) to see the errors"143 -o $(RENDERTMP)/dump-$(trouble_arch) $(PWD)/$(trouble_arch)-index.xml 144 $(Q)xmllint --xinclude --noout --nonet --valid $(RENDERTMP)/dump-$(trouble_arch) 145 @echo "You can now look at $(RENDERTMP)/dump-$(trouble_arch) to see the errors" 159 146 160 .PHONY: $(ARCHS_DUMP) 161 $(ARCHS_DUMP): override arch = $(@:%-dump=%) 147 $(ARCHS_DUMP): override dump_arch = $(@:%$(S)dump=%) 162 148 $(ARCHS_DUMP): 163 @echo "Extracting commands from $( arch)..."164 $(Q)mkdir -p $(DUMPDIR)/$( arch)165 $(Q)xsltproc --xinclude --nonet --output $(DUMPDIR)/$( arch)/ \166 $(PWD)/stylesheets/dump-commands.xsl $(PWD)/$( arch)-index.xml149 @echo "Extracting commands from $(dump_arch)..." 150 $(Q)mkdir -p $(DUMPDIR)/$(dump_arch) 151 $(Q)xsltproc --xinclude --nonet --output $(DUMPDIR)/$(dump_arch)/ \ 152 $(PWD)/stylesheets/dump-commands.xsl $(PWD)/$(dump_arch)-index.xml 167 153 168 .PHONY: $(ARCHS_DLLIST) 169 $(ARCHS_DLLIST): override arch = $(@:%-dllist=%) 154 $(ARCHS_DLLIST): override dllist_arch = $(@:%$(S)dllist=%) 170 155 $(ARCHS_DLLIST): 171 @echo "Creating download list for $( arch)..."156 @echo "Creating download list for $(dllist_arch)..." 172 157 $(Q)mkdir -p $(DLLISTDIR) 173 $(Q)xsltproc --xinclude --nonet --output $(DLLISTDIR)/$( arch)/dl.list \174 $(PWD)/stylesheets/wget.xsl $(PWD)/$( arch)-index.xml158 $(Q)xsltproc --xinclude --nonet --output $(DLLISTDIR)/$(dllist_arch)/dl.list \ 159 $(PWD)/stylesheets/wget.xsl $(PWD)/$(dllist_arch)-index.xml 175 160 176 161 help: … … 178 163 @echo 179 164 @echo "HTML Targets" 180 @echo " $(FG_GREEN)clfs lfs tidy render titlepage $(FG_BLUE)$(ARCHS_HTML)$(FG_DEFAULT)"165 @echo -e " \e[0;32mclfs lfs tidy render titlepage \e[0;34m$(ARCHS_HTML)\e[0;0m" 181 166 @echo 182 167 @echo "NoChunks Targets" 183 @echo " $(FG_GREEN)nochunks tidy $(FG_BLUE)$(ARCHS_NOCHUNKS)$(FG_DEFAULT)"168 @echo -e " \e[0;32mnochunks tidy \e[0;34m$(ARCHS_NOCHUNKS)\e[0;0m" 184 169 @echo 185 170 @echo "PDF Targets" 186 @echo " $(FG_GREEN)pdf $(FG_BLUE)$(ARCHS_PDF)$(FG_DEFAULT)"171 @echo -e " \e[0;32mpdf \e[0;34m$(ARCHS_PDF)\e[0;0m" 187 172 @echo 188 173 @echo "Validate Targets" 189 @echo " $(FG_GREEN)validate $(FG_BLUE)$(ARCHS_VALIDATE)$(FG_DEFAULT)"174 @echo -e " \e[0;32mvalidate \e[0;34m$(ARCHS_VALIDATE)\e[0;0m" 190 175 @echo 191 176 @echo "Trouble Targets" 192 @echo " $(FG_GREEN)trouble $(FG_BLUE)$(ARCHS_TROUBLE)$(FG_DEFAULT)"177 @echo -e " \e[0;32mtrouble \e[0;34m$(ARCHS_TROUBLE)\e[0;0m" 193 178 @echo 194 179 @echo "Dump-Commands Targets" 195 @echo " $(FG_GREEN)dump-commands $(FG_BLUE)$(ARCHS_DUMP)$(FG_DEFAULT)"180 @echo -e " \e[0;32mdump-commands \e[0;34m$(ARCHS_DUMP)\e[0;0m" 196 181 @echo 197 182 @echo "Download-List Targets" 198 @echo " $(FG_GREEN)download-list $(FG_BLUE)$(ARCHS_DLLIST)$(FG_DEFAULT)"183 @echo -e " \e[0;32mdownload-list \e[0;34m$(ARCHS_DLLIST)\e[0;0m"
Note:
See TracChangeset
for help on using the changeset viewer.