Changeset fd5c672 for BOOK/Makefile
- Timestamp:
- Jul 28, 2007, 3:50:39 AM (17 years ago)
- Branches:
- clfs-1.2, clfs-2.1, clfs-3.0.0-systemd, clfs-3.0.0-sysvinit, master, systemd, sysvinit
- Children:
- c304f4c
- Parents:
- de64fc88
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BOOK/Makefile
rde64fc88 rfd5c672 2 2 DUMPDIR := ~/cross-lfs-commands 3 3 DLLISTDIR := ~/cross-lfs-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 … … 39 53 40 54 titlepage: 41 @xsltproc --nonet --output $(BASEDIR)/index.html $(PWD)/stylesheets/top-index.xsl $(PWD)/index.xml 55 $(Q)xsltproc --nonet --output $(BASEDIR)/index.html \ 56 $(PWD)/stylesheets/top-index.xsl $(PWD)/index.xml 42 57 43 58 $(ARCHS_HTML): override html_arch = $(@:%$(S)html=%) 44 59 $(ARCHS_HTML): 45 @echo "Rendering HTML of $(html_arch)..." 46 @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 47 @mkdir -p $(BASEDIR)/$(html_arch)/stylesheets 48 @cp $(PWD)/stylesheets/*.css $(BASEDIR)/$(html_arch)/stylesheets 49 @sed -i -e "s@../stylesheets@stylesheets@g" $(BASEDIR)/$(html_arch)/*.html 50 @mkdir -p $(BASEDIR)/$(html_arch)/images 51 @cp $(XSLROOTDIR)/images/*.png $(BASEDIR)/$(html_arch)/images 52 @sed -i -e "s@../images@images@g" $(BASEDIR)/$(html_arch)/*.html 60 @echo "Validating $(html_arch) book..." 61 $(Q)xmllint --nonet --noent --xinclude --postvalid \ 62 -o $(RENDERTMP)/$(html_arch)-full.xml $(PWD)/$(html_arch)-index.xml 53 63 54 nochunks: $(ARCHS_NOCHUNKS) tidy 64 @echo "Generating profiled $(html_arch) book for XHTML..." 65 $(Q)xsltproc --nonet --stringparam profile.condition html \ 66 --output $(RENDERTMP)/$(html_arch)-html.xml \ 67 $(PWD)/stylesheets/lfs-xsl/profile.xsl $(RENDERTMP)/$(html_arch)-full.xml 68 69 @echo "Rendering chunked XHTML of $(html_arch)..." 70 $(Q)mkdir -p $(BASEDIR)/$(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 55 85 56 86 $(ARCHS_NOCHUNKS): override nochunk_arch = $(@:%$(S)nochunks=%) 57 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 58 98 @echo "Rendering Single File HTML of $(nochunk_arch)..." 59 @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)mkdir -p $(BASEDIR) 100 $(Q)xsltproc --nonet -stringparam rootid "$(ROOT_ID)" \ 101 --output $(BASEDIR)/CLFS-$(nochunk_arch).html \ 102 $(PWD)/stylesheets/clfs-nochunks.xsl $(RENDERTMP)/$(nochunk_arch)-html.xml 60 103 61 pdf: $(ARCHS_PDF) 104 @echo "Running Tidy..." 105 $(Q)tidy -config $(PWD)/tidy.conf $(BASEDIR)/CLFS-$(nochunk_arch).html || true 106 @echo "Running obfuscate.sh..." 107 $(Q)sh $(PWD)/obfuscate.sh $(BASEDIR)/CLFS-$(nochunk_arch).html 108 $(Q)sed -i -e "s@text/html@application/xhtml+xml@g" \ 109 $(BASEDIR)/CLFS-$(nochunk_arch).html 110 111 pdf: tmpdir $(ARCHS_PDF) 62 112 63 113 $(ARCHS_PDF): override pdf_arch = $(@:%$(S)pdf=%) 64 114 $(ARCHS_PDF): 115 @echo "Validating $(pdf_arch) book..." 116 $(Q)xmllint --nonet --noent --xinclude --postvalid \ 117 -o $(RENDERTMP)/$(pdf_arch)-full.xml $(PWD)/$(pdf_arch)-index.xml 118 119 @echo "Generating profiled $(pdf_arch) book for PDF..." 120 $(Q)xsltproc --nonet --stringparam profile.condition pdf \ 121 --output $(RENDERTMP)/$(pdf_arch)-pdf.xml \ 122 $(PWD)/stylesheets/lfs-xsl/profile.xsl \ 123 $(RENDERTMP)/$(pdf_arch)-full.xml 124 125 @echo "Generating FO file of $(pdf_arch)..." 126 $(Q)xsltproc --nonet -stringparam rootid "$(ROOT_ID)" \ 127 --output $(RENDERTMP)/$(pdf_arch).fo $(PWD)/stylesheets/clfs-pdf.xsl \ 128 $(RENDERTMP)/$(pdf_arch)-pdf.xml 129 $(Q)sed -i -e 's/span="inherit"/span="all"/' $(RENDERTMP)/$(pdf_arch).fo 130 65 131 @echo "Rendering PDF of $(pdf_arch)..." 66 @xsltproc --xinclude --nonet --output $(BASEDIR)/clfs-$(pdf_arch)-pdf.fo $(PWD)/stylesheets/lfs-pdf.xsl $(pdf_arch)-index.xml 67 @sed -i -e "s/inherit/all/" $(BASEDIR)/clfs-$(pdf_arch)-pdf.fo 68 @fop.sh -q -fo $(BASEDIR)/clfs-$(pdf_arch)-pdf.fo -pdf $(BASEDIR)/CLFS-BOOK-$(pdf_arch).pdf 69 @rm $(BASEDIR)/clfs-$(pdf_arch)-pdf.fo 70 71 text: $(ARCHS_TEXT) 72 73 $(ARCHS_TEXT): override text_arch = $(@:%$(S)text=%) 74 $(ARCHS_TEXT): 75 @echo "Rendering Text of $(text_arch)..." 76 @xsltproc --xinclude --nonet --output $(BASEDIR)/clfs-$(text_arch)-text.fo $(PWD)/stylesheets/lfs-pdf.xsl $(text_arch)-index.xml 77 @sed -i -e "s/inherit/all/" $(BASEDIR)/clfs-$(text_arch)-text.fo ; \ 78 @fop.sh -q -fo $(BASEDIR)/clfs-$(text_arch)-text.fo -txt $(BASEDIR)/CLFS-BOOK-$(text_arch).txt ; \ 79 @rm $(BASEDIR)/clfs-$(text_arch)-text.fo 132 $(Q)mkdir -p $(BASEDIR) 133 $(Q)fop $(RENDERTMP)/$(pdf_arch).fo $(BASEDIR)/CLFS-$(pdf_arch).pdf 80 134 81 135 validate: $(ARCHS_VALIDATE) … … 84 138 $(ARCHS_VALIDATE): 85 139 @echo "Validating $(validate_arch)..." 86 @xmllint --xinclude --noout --nonet --postvalid $(PWD)/$(validate_arch)-index.xml140 $(Q)xmllint --xinclude --noout --nonet --postvalid $(PWD)/$(validate_arch)-index.xml 87 141 88 trouble: $(ARCHS_TROUBLE)142 trouble: tmpdir $(ARCHS_TROUBLE) 89 143 90 144 $(ARCHS_TROUBLE): override trouble_arch = $(@:%$(S)trouble=%) 91 145 $(ARCHS_TROUBLE): 92 146 @echo "Troubleshooting $(trouble_arch)..." 93 @xmllint --xinclude --nonet --postvalid $(PWD)/$(trouble_arch)-index.xml > /tmp/dump-$(trouble_arch) 94 @xmllint --xinclude --noout --nonet --valid /tmp/dump-$(trouble_arch) 95 @echo "You can now look at /tmp/dump-$(trouble_arch) to see the errors" 147 $(Q)xmllint --xinclude --nonet --postvalid \ 148 -o $(RENDERTMP)/dump-$(trouble_arch) $(PWD)/$(trouble_arch)-index.xml 149 $(Q)xmllint --xinclude --noout --nonet --valid $(RENDERTMP)/dump-$(trouble_arch) 150 @echo "You can now look at $(RENDERTMP)/dump-$(trouble_arch) to see the errors" 96 151 97 152 dump-commands: $(ARCHS_DUMP) … … 100 155 $(ARCHS_DUMP): 101 156 @echo "Extracting commands from $(dump_arch)..." 102 @xsltproc --xinclude --nonet --output $(DUMPDIR)/$(dump_arch)/ $(PWD)/stylesheets/dump-commands.xsl $(dump_arch)-index.xml 157 $(Q)mkdir -p $(DUMPDIR)/$(dump_arch) 158 $(Q)xsltproc --xinclude --nonet --output $(DUMPDIR)/$(dump_arch)/ \ 159 $(PWD)/stylesheets/dump-commands.xsl $(PWD)/$(dump_arch)-index.xml 103 160 104 161 download-list: $(ARCHS_DLLIST) … … 107 164 $(ARCHS_DLLIST): 108 165 @echo "Creating download list for $(dllist_arch)..." 109 @xsltproc --xinclude --nonet --output $(DLLISTDIR)/$(dllist_arch).dl.list $(PWD)/stylesheets/wget.xsl $(dllist_arch)-index.xml 166 $(Q)mkdir -p $(DLLISTDIR) 167 $(Q)xsltproc --xinclude --nonet --output $(DLLISTDIR)/$(dllist_arch).dl.list \ 168 $(PWD)/stylesheets/wget.xsl $(PWD)/$(dllist_arch)-index.xml 110 169 111 170 help: … … 118 177 @echo "PDF Targets" 119 178 @echo -e " \e[0;32mpdf \e[0;34m$(ARCHS_PDF)\e[0;0m" 120 @echo121 @echo "Text Targets"122 @echo -e " \e[0;32mtext \e[0;34m$(ARCHS_TEXT)\e[0;0m"123 179 @echo 124 180 @echo "Validate Targets"
Note:
See TracChangeset
for help on using the changeset viewer.