Changeset b7f86eb in clfs-sysroot


Ignore:
Timestamp:
Jul 21, 2007, 8:34:23 AM (15 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
master
Children:
68ed089
Parents:
7c1c987
Message:

Updated Makefile to use the new stylesheets.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BOOK/Makefile

    r7c1c987 rb7f86eb  
    22DUMPDIR         := ~/cross-lfs-sysroot-commands
    33DLLISTDIR       := ~/cross-lfs-sysroot-dllist
     4RENDERTMP       := $(HOME)/tmp
    45CHUNK_QUIET     := 1
    5 XSLROOTDIR      := /usr/share/xml/docbook/xsl-stylesheets-1.69.1
     6ROOT_ID         :=
    67
    78S               := -
     
    1213ARCHS_NOCHUNKS  := $(ARCHS:%=%$(S)nochunks)
    1314ARCHS_PDF       := $(ARCHS:%=%$(S)pdf)
    14 ARCHS_TEXT      := $(ARCHS:%=%$(S)text)
    1515ARCHS_VALIDATE  := $(ARCHS:%=%$(S)validate)
    1616ARCHS_TROUBLE   := $(ARCHS:%=%$(S)trouble)
     
    1818ARCHS_DLLIST    := $(ARCHS:%=%$(S)dllist)
    1919
    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)
     20ifdef V
     21  Q =
     22else
     23  Q = @
     24endif
    2125
    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
     30lfs: tmpdir render tidy
     31
     32tmpdir:
     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
    2337
    2438ifeq ($(shell which tidy >/dev/null 2>&1 && echo yes),yes)
    2539tidy:
    26         @echo Running tidy on the created HTML
    27         @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; \
    2943          true; \
    30           sh obfuscate.sh $$filename; \
     44          sh $(PWD)/obfuscate.sh $$filename; \
    3145          sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \
    3246        done;
    3347else
    3448tidy:
    35         @echo Tidy is not installed on this system
     49        @echo "Tidy is not installed on this system"
    3650endif
    3751
     
    4054titlepage:
    4155        @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
    4358
    4459$(ARCHS_HTML): override html_arch = $(@:%$(S)html=%)
    4560$(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
    5464
    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
     84nochunks: tmpdir $(ARCHS_NOCHUNKS) tidy
    5685
    5786$(ARCHS_NOCHUNKS): override nochunk_arch = $(@:%$(S)nochunks=%)
    5887$(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
    5998        @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
    61102
    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
     110pdf: tmpdir $(ARCHS_PDF)
    63111
    64112$(ARCHS_PDF): override pdf_arch =  $(@:%$(S)pdf=%)
    65113$(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
    66130        @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
    81132
    82133validate: $(ARCHS_VALIDATE)
     
    85136$(ARCHS_VALIDATE):
    86137        @echo "Validating $(validate_arch)..."
    87         @xmllint --xinclude --noout --nonet --postvalid $(PWD)/$(validate_arch)-index.xml
     138        $(Q)xmllint --xinclude --noout --nonet --postvalid $(PWD)/$(validate_arch)-index.xml
    88139
    89140trouble: $(ARCHS_TROUBLE)
     
    92143$(ARCHS_TROUBLE):
    93144        @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"
    97149
    98150dump-commands: $(ARCHS_DUMP)
     
    101153$(ARCHS_DUMP):
    102154        @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
    104157
    105158download-list: $(ARCHS_DLLIST)
     
    108161$(ARCHS_DLLIST):
    109162        @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
    111165
    112166help:
     
    119173        @echo "PDF Targets"
    120174        @echo -e "  \e[0;32mpdf \e[0;34m$(ARCHS_PDF)\e[0;0m"
    121         @echo
    122         @echo "Text Targets"
    123         @echo -e "  \e[0;32mtext \e[0;34m$(ARCHS_TEXT)\e[0;0m"
    124175        @echo
    125176        @echo "Validate Targets"
Note: See TracChangeset for help on using the changeset viewer.