Changeset b7f86eb in clfs-sysroot for BOOK/Makefile
- Timestamp:
- Jul 21, 2007, 8:34:23 AM (17 years ago)
- Branches:
- master
- Children:
- 68ed089
- Parents:
- 7c1c987
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BOOK/Makefile
r7c1c987 rb7f86eb 2 2 DUMPDIR := ~/cross-lfs-sysroot-commands 3 3 DLLISTDIR := ~/cross-lfs-sysroot-dllist 4 RENDERTMP := $(HOME)/tmp 4 5 CHUNK_QUIET := 1 5 XSLROOTDIR := /usr/share/xml/docbook/xsl-stylesheets-1.69.1 6 ROOT_ID := 6 7 7 8 S := - … … 12 13 ARCHS_NOCHUNKS := $(ARCHS:%=%$(S)nochunks) 13 14 ARCHS_PDF := $(ARCHS:%=%$(S)pdf) 14 ARCHS_TEXT := $(ARCHS:%=%$(S)text)15 15 ARCHS_VALIDATE := $(ARCHS:%=%$(S)validate) 16 16 ARCHS_TROUBLE := $(ARCHS:%=%$(S)trouble) … … 18 18 ARCHS_DLLIST := $(ARCHS:%=%$(S)dllist) 19 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) 20 ifdef V 21 Q = 22 else 23 Q = @ 24 endif 21 25 22 lfs: render tidy 26 .PHONY: lfs tidy render titlepage $(ARCHS_HTML) nochunks $(ARCHS_NOCHUNKS) pdf \ 27 $(ARCHS_PDF) validate $(ARCHS_VALIDATE) trouble $(ARCHS_TROUBLE) \ 28 dump-commands $(ARCHS_DUMP) download-list $(ARCHS_DLLIST) tmpdir 29 30 lfs: tmpdir render tidy 31 32 tmpdir: 33 @echo "Creating and cleaning $(RENDERTMP)" 34 $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP) 35 $(Q)rm -f $(RENDERTMP)/*-{full,html,pdf}.xml 36 $(Q)rm -f $(RENDERTMP)/*.fo 23 37 24 38 ifeq ($(shell which tidy >/dev/null 2>&1 && echo yes),yes) 25 39 tidy: 26 @echo Running tidy on the created HTML27 @for filename in `find $(BASEDIR) -name "*.html"`; do \28 tidy -config tidy.conf $$filename; \40 @echo "Running tidy on the created HTML" 41 $(Q)for filename in `find $(BASEDIR) -name "*.html"`; do \ 42 tidy -config $(PWD)/tidy.conf $$filename; \ 29 43 true; \ 30 sh obfuscate.sh $$filename; \44 sh $(PWD)/obfuscate.sh $$filename; \ 31 45 sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \ 32 46 done; 33 47 else 34 48 tidy: 35 @echo Tidy is not installed on this system49 @echo "Tidy is not installed on this system" 36 50 endif 37 51 … … 40 54 titlepage: 41 55 @echo "Rendering Top Index" 42 @xsltproc --nonet --output $(BASEDIR)/index.html $(PWD)/stylesheets/top-index.xsl $(PWD)/index.xml 56 $(Q)xsltproc --nonet --output $(BASEDIR)/index.html \ 57 $(PWD)/stylesheets/top-index.xsl $(PWD)/index.xml 43 58 44 59 $(ARCHS_HTML): override html_arch = $(@:%$(S)html=%) 45 60 $(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 61 @echo "Validating $(html_arch) book..." 62 $(Q)xmllint --nonet --noent --xinclude --postvalid \ 63 -o $(RENDERTMP)/$(html_arch)-full.xml $(PWD)/$(html_arch)-index.xml 54 64 55 nochunks: $(ARCHS_NOCHUNKS) tidy 65 @echo "Generating profiled $(html_arch) book for XHTML..." 66 $(Q)xsltproc --nonet --stringparam profile.condition html \ 67 --output $(RENDERTMP)/$(html_arch)-html.xml \ 68 $(PWD)/stylesheets/lfs-xsl/profile.xsl $(RENDERTMP)/$(html_arch)-full.xml 69 70 @echo "Rendering chunked XHTML of $(html_arch)..." 71 $(Q)xsltproc --nonet -stringparam chunk.quietly $(CHUNK_QUIET) \ 72 -stringparam rootid "$(ROOT_ID)" \ 73 -stringparam base.dir $(BASEDIR)/$(html_arch)/ \ 74 $(PWD)/stylesheets/clfs-chunked.xsl $(RENDERTMP)/$(html_arch)-html.xml 75 76 @echo "Copying CSS code and images..." 77 $(Q)mkdir -p $(BASEDIR)/$(html_arch)/stylesheets 78 $(Q)cp $(PWD)/stylesheets/lfs-xsl/*.css $(BASEDIR)/$(html_arch)/stylesheets 79 $(Q)sed -i -e "s@../stylesheets@stylesheets@g" $(BASEDIR)/$(html_arch)/*.html 80 $(Q)mkdir -p $(BASEDIR)/$(html_arch)/images 81 $(Q)cp $(PWD)/images/*.png $(BASEDIR)/$(html_arch)/images 82 $(Q)sed -i -e "s@../images@images@g" $(BASEDIR)/$(html_arch)/*.html 83 84 nochunks: tmpdir $(ARCHS_NOCHUNKS) tidy 56 85 57 86 $(ARCHS_NOCHUNKS): override nochunk_arch = $(@:%$(S)nochunks=%) 58 87 $(ARCHS_NOCHUNKS): 88 @echo "Validating $(nochunk_arch) book..." 89 $(Q)xmllint --nonet --noent --xinclude --postvalid \ 90 -o $(RENDERTMP)/$(nochunk_arch)-full.xml $(PWD)/$(nochunk_arch)-index.xml 91 92 @echo "Generating profiled $(nochunk_arch) book for XHTML..." 93 $(Q)xsltproc --nonet --stringparam profile.condition html \ 94 --output $(RENDERTMP)/$(nochunk_arch)-html.xml \ 95 $(PWD)/stylesheets/lfs-xsl/profile.xsl \ 96 $(RENDERTMP)/$(nochunk_arch)-full.xml 97 59 98 @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 99 $(Q)xsltproc --nonet -stringparam rootid "$(ROOT_ID)" \ 100 --output $(BASEDIR)/CLFS-EMBEDDED-$(nochunk_arch).html \ 101 $(PWD)/stylesheets/clfs-nochunks.xsl $(RENDERTMP)/$(nochunk_arch)-html.xml 61 102 62 pdf: $(ARCHS_PDF) 103 @echo "Running Tidy..." 104 $(Q)tidy -config $(PWD)/tidy.conf $(BASEDIR)/CLFS-EMBEDDED-$(nochunk_arch).html || true 105 @echo "Running obfuscate.sh..." 106 $(Q)sh $(PWD)/obfuscate.sh $(BASEDIR)/CLFS-EMBEDDED-$(nochunk_arch).html 107 $(Q)sed -i -e "s@text/html@application/xhtml+xml@g" \ 108 $(BASEDIR)/CLFS-EMBEDDED-$(nochunk_arch).html 109 110 pdf: tmpdir $(ARCHS_PDF) 63 111 64 112 $(ARCHS_PDF): override pdf_arch = $(@:%$(S)pdf=%) 65 113 $(ARCHS_PDF): 114 @echo "Validating $(pdf_arch) book..." 115 $(Q)xmllint --nonet --noent --xinclude --postvalid \ 116 -o $(RENDERTMP)/$(pdf_arch)-full.xml $(PWD)/$(pdf_arch)-index.xml 117 118 @echo "Generating profiled $(pdf_arch) book for PDF..." 119 $(Q)xsltproc --nonet --stringparam profile.condition pdf \ 120 --output $(RENDERTMP)/$(pdf_arch)-pdf.xml \ 121 $(PWD)/stylesheets/lfs-xsl/profile.xsl \ 122 $(RENDERTMP)/$(pdf_arch)-full.xml 123 124 @echo "Generating FO file of $(pdf_arch)..." 125 $(Q)xsltproc --nonet -stringparam rootid "$(ROOT_ID)" \ 126 --output $(RENDERTMP)/$(pdf_arch).fo $(PWD)/stylesheets/clfs-pdf.xsl \ 127 $(RENDERTMP)/$(pdf_arch)-pdf.xml 128 $(Q)sed -i -e 's/span="inherit"/span="all"/' $(RENDERTMP)/$(pdf_arch).fo 129 66 130 @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 72 text: $(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 131 $(Q)fop $(RENDERTMP)/$(pdf_arch).fo $(BASEDIR)/CLFS-EMBEDDED-$(pdf_arch).pdf 81 132 82 133 validate: $(ARCHS_VALIDATE) … … 85 136 $(ARCHS_VALIDATE): 86 137 @echo "Validating $(validate_arch)..." 87 @xmllint --xinclude --noout --nonet --postvalid $(PWD)/$(validate_arch)-index.xml138 $(Q)xmllint --xinclude --noout --nonet --postvalid $(PWD)/$(validate_arch)-index.xml 88 139 89 140 trouble: $(ARCHS_TROUBLE) … … 92 143 $(ARCHS_TROUBLE): 93 144 @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" 145 $(Q)xmllint --xinclude --nonet --postvalid \ 146 -o $(RENDERTMP)/dump-$(trouble_arch) $(PWD)/$(trouble_arch)-index.xml 147 $(Q)xmllint --xinclude --noout --nonet --valid $(RENDERTMP)/dump-$(trouble_arch) 148 @echo "You can now look at $(RENDERTMP)/dump-$(trouble_arch) to see the errors" 97 149 98 150 dump-commands: $(ARCHS_DUMP) … … 101 153 $(ARCHS_DUMP): 102 154 @echo "Extracting commands from $(dump_arch)..." 103 @xsltproc --xinclude --nonet --output $(DUMPDIR)/$(dump_arch)/ $(PWD)/stylesheets/dump-commands.xsl $(dump_arch)-index.xml 155 $(Q)xsltproc --xinclude --nonet --output $(DUMPDIR)/$(dump_arch)/ \ 156 $(PWD)/stylesheets/dump-commands.xsl $(PWD)/$(dump_arch)-index.xml 104 157 105 158 download-list: $(ARCHS_DLLIST) … … 108 161 $(ARCHS_DLLIST): 109 162 @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 163 $(Q)xsltproc --xinclude --nonet --output $(DLLISTDIR)/$(dllist_arch).dl.list \ 164 $(PWD)/stylesheets/wget.xsl $(PWD)/$(dllist_arch)-index.xml 111 165 112 166 help: … … 119 173 @echo "PDF Targets" 120 174 @echo -e " \e[0;32mpdf \e[0;34m$(ARCHS_PDF)\e[0;0m" 121 @echo122 @echo "Text Targets"123 @echo -e " \e[0;32mtext \e[0;34m$(ARCHS_TEXT)\e[0;0m"124 175 @echo 125 176 @echo "Validate Targets"
Note:
See TracChangeset
for help on using the changeset viewer.