Changeset 157ab39 for BOOK/Makefile


Ignore:
Timestamp:
Nov 16, 2006, 4:45:10 PM (18 years ago)
Author:
Jim Gifford <clfs@…>
Branches:
clfs-1.2, clfs-2.1, clfs-3.0.0-systemd, clfs-3.0.0-sysvinit, master, systemd, sysvinit
Children:
191b828
Parents:
fd281b78
Message:

More Text Updates for E2fsprogs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BOOK/Makefile

    rfd281b78 r157ab39  
    1 BASEDIR=~/cross-lfs-book
    2 DUMPDIR=~/cross-lfs-commands
    3 DLLISTDIR=~/cross-lfs-dllist
    4 CHUNK_QUIET=1
    5 XSLROOTDIR=/usr/share/xml/docbook/xsl-stylesheets-1.69.1
    6 ARCH=x86 x86_64 x86_64-64 sparc sparc64 sparc64-64 mips mips64 mips64-64 ppc ppc64 alpha
     1BASEDIR         := ~/cross-lfs-book
     2DUMPDIR         := ~/cross-lfs-commands
     3DLLISTDIR       := ~/cross-lfs-dllist
     4CHUNK_QUIET     := 1
     5XSLROOTDIR      := /usr/share/xml/docbook/xsl-stylesheets-1.69.1
    76
    8 # HTML Rendering Chunked
    9 define HTML_RENDER
    10         echo "Rendering HTML of $$arch..." ; \
    11         xsltproc --xinclude --nonet -stringparam profile.condition html \
    12           -stringparam chunk.quietly $(CHUNK_QUIET) -stringparam base.dir $(BASEDIR)/$$arch/ \
    13           $(PWD)/stylesheets/lfs-chunked.xsl $(PWD)/$$arch-index.xml ; \
    14         mkdir -p $(BASEDIR)/$$arch/stylesheets ; \
    15         cp $(PWD)/stylesheets/*.css $(BASEDIR)/$$arch/stylesheets ; \
    16         cd $(BASEDIR)/$$arch/; sed -i -e "s@../stylesheets@stylesheets@g" *.html ; \
    17         mkdir -p $(BASEDIR)/$$arch/images ; \
    18         cp $(XSLROOTDIR)/images/*.png $(BASEDIR)/$$arch/images ; \
    19         cd $(BASEDIR)/$$arch/; sed -i -e "s@../images@images@g" *.html
    20 endef
     7S               := -
    218
    22 # HTML Rendering No Chunks
    23 define HTML_RENDER2
    24         echo "Rendering Single File HTML of $$arch..." ; \
    25         xsltproc --xinclude --nonet -stringparam profile.condition html \
    26            --output $(BASEDIR)/CLFS-BOOK-$$arch.html \
    27            $(PWD)/stylesheets/lfs-nochunks.xsl $$arch-index.xml
    28 endef
     9ARCHS           := x86 x86_64 x86_64-64 sparc sparc64 sparc64-64 mips mips64 mips64-64 ppc ppc64 alpha
    2910
    30 # PDF Rendering
    31 define PDF_RENDER
    32         echo "Rendering PDF of $$arch..." ; \
    33         xsltproc --xinclude --nonet --output $(BASEDIR)/lfs-pdf.fo \
    34                 $(PWD)/stylesheets/lfs-pdf.xsl $$arch-index.xml ; \
    35         sed -i -e "s/inherit/all/" $(BASEDIR)/lfs-pdf.fo ; \
    36         fop.sh -q $(BASEDIR)/lfs-pdf.fo -pdf $(BASEDIR)/CLFS-BOOK-$$arch.pdf ; \
    37         rm $(BASEDIR)/lfs-pdf.fo
    38 endef
     11ARCHS_HTML      := $(ARCHS:%=%$(S)html)
     12ARCHS_NOCHUNKS  := $(ARCHS:%=%$(S)nochunks)
     13ARCHS_PDF       := $(ARCHS:%=%$(S)pdf)
     14ARCHS_TEXT      := $(ARCHS:%=%$(S)text)
     15ARCHS_VALIDATE  := $(ARCHS:%=%$(S)validate)
     16ARCHS_TROUBLE   := $(ARCHS:%=%$(S)trouble)
     17ARCHS_DUMP      := $(ARCHS:%=%$(S)dump)
     18ARCHS_DLLIST    := $(ARCHS:%=%$(S)dllist)
    3919
    40 # Plain Text Rendering
    41 define TEXT_RENDER
    42         echo "Rendering Text of $$arch..." ; \
    43         xsltproc --xinclude --nonet --output $(BASEDIR)/lfs-pdf.fo \
    44                 $(PWD)/stylesheets/lfs-pdf.xsl $$arch-index.xml ; \
    45         sed -i -e "s/inherit/all/" $(BASEDIR)/lfs-pdf.fo ; \
    46         fop.sh $(BASEDIR)/lfs-pdf.fo -txt $(BASEDIR)/CLFS-BOOK-$$arch.txt ; \
    47         rm $(BASEDIR)/lfs-pdf.fo
    48 endef
     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)
    4921
    50 # Validation
    51 define VALIDATE
    52         echo "Validating $$arch..." ; \
    53         xmllint --xinclude --noout --nonet --postvalid $(PWD)/$$arch-index.xml
    54 endef
     22lfs: render tidy
    5523
    56 # TroubleShoot
    57 define TROUBLE
    58         echo "Troubleshooting $$arch..." ; \
    59         xmllint --xinclude --nonet --postvalid $(PWD)/$$arch-index.xml > /tmp/dump-$$arch ; \
    60         xmllint --xinclude --noout --nonet --valid /tmp/dump-$$arch ; \
    61         echo "You can now look at /tmp/dump-$$arch to see the errors"
    62 endef
    63 
    64 # Dump commands
    65 define DUMP
    66         echo "Extracting commands from $$arch..." ; \
    67         xsltproc --xinclude --nonet --output $(DUMPDIR)/$$arch/ \
    68            $(PWD)/stylesheets/dump-commands.xsl $$arch-index.xml
    69 endef
    70 
    71 # Get commands
    72 define DLLIST
    73         echo "Creating download list for $$arch..." ; \
    74         xsltproc --xinclude --nonet --output $(DLLISTDIR)/$$arch.dl.list \
    75            $(PWD)/stylesheets/wget.xsl $$arch-index.xml
    76 endef
    77 
    78 clfs: toplevel render common
    79 
    80 toplevel:
    81         @xsltproc --nonet --output $(BASEDIR)/index.html $(PWD)/stylesheets/top-index.xsl $(PWD)/index.xml
    82 
    83 render:
    84         @for arch in $(ARCH) ; do \
    85         $(HTML_RENDER) ; \
    86         done
    87 
    88 common:
     24ifeq ($(shell which tidy >/dev/null 2>&1 && echo yes),yes)
     25tidy:
     26        @echo Running tidy on the created HTML
    8927        @for filename in `find $(BASEDIR) -name "*.html"`; do \
    9028          tidy -config tidy.conf $$filename; \
     
    9331          sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \
    9432        done;
     33else
     34tidy:
     35        @echo Tidy is not installed on this system
     36endif
    9537
    96 nochunks: nochunk_render common
     38render: $(ARCHS_HTML) titlepage
    9739
    98 nochunk_render:
     40titlepage:
     41        @xsltproc --nonet --output $(BASEDIR)/index.html $(PWD)/stylesheets/top-index.xsl $(PWD)/index.xml
    9942
    100         @for arch in $(ARCH) ; do \
    101         $(HTML_RENDER2) ; \
    102         done
     43$(ARCHS_HTML): override html_arch = $(@:%$(S)html=%)
     44$(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
    10353
    104 pdf:
    105         @for arch in $(ARCH) ; do \
    106         $(PDF_RENDER) ; \
    107         done
     54nochunks: $(ARCHS_NOCHUNKS) tidy
    10855
    109 text:
    110         @for arch in $(ARCH) ; do \
    111         $(TEXT_RENDER) ; \
    112         done
     56$(ARCHS_NOCHUNKS): override nochunk_arch = $(@:%$(S)nochunks=%)
     57$(ARCHS_NOCHUNKS):
     58        @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
    11360
    114 validate:
    115         @for arch in $(ARCH) ; do \
    116         $(VALIDATE) ; \
    117         done
     61pdf: $(ARCHS_PDF)
    11862
    119 trouble:
    120         @for arch in $(ARCH) ; do \
    121         $(TROUBLE) ; \
    122         done
     63$(ARCHS_PDF): override pdf_arch =  $(@:%$(S)pdf=%)
     64$(ARCHS_PDF):
     65        @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
    12370
    124 dump-commands:
    125         @for arch in $(ARCH) ; do \
    126         $(DUMP) ; \
    127         done
     71text: $(ARCHS_TEXT)
    12872
    129 download-list:
    130         @for arch in $(ARCH) ; do \
    131         $(DLLIST) ; \
    132         done
     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
    13380
    134 target-list:
    135         @printf "%-15s %-10s\n" "Architecture" "Build Type" ;\
    136         for arch in $(ARCH) ; do \
    137         MULTILIB=0 ;\
    138         PURE64=0 ;\
    139         TEST="`echo $$arch | grep -c -e '-64'`" ;\
    140         if [ "$$TEST" = "1" ]; then \
    141                 PURE64=1 ;\
    142         else \
    143                 TEST="`echo $$arch | grep -c -e '64'`" ;\
    144                 if [ "$$TEST" = "1" ]; then \
    145                         MULTILIB=1 ;\
    146                 fi; \
    147         fi; \
    148         if [ "$$PURE64" = "1" ]; then \
    149                 printf "%-15s %-10s\n" $$arch "Pure 64" ;\
    150         else \
    151                 if [ "$$MULTILIB" = "1" ]; then \
    152                         printf "%-15s %-10s\n" $$arch "Multilib" ;\
    153                 else \
    154                         printf "%-15s %-10s\n" $$arch "Default" ;\
    155                 fi; \
    156         fi; \
    157         done
     81validate: $(ARCHS_VALIDATE)
     82
     83$(ARCHS_VALIDATE): override validate_arch =  $(@:%$(S)validate=%)
     84$(ARCHS_VALIDATE):
     85        @echo "Validating $(validate_arch)..."
     86        @xmllint --xinclude --noout --nonet --postvalid $(PWD)/$(validate_arch)-index.xml
     87
     88trouble: $(ARCHS_TROUBLE)
     89
     90$(ARCHS_TROUBLE): override trouble_arch =  $(@:%$(S)trouble=%)
     91$(ARCHS_TROUBLE):
     92        @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"
     96
     97dump-commands: $(ARCHS_DUMP)
     98
     99$(ARCHS_DUMP): override dump_arch =  $(@:%$(S)dump=%)
     100$(ARCHS_DUMP):
     101        @echo "Extracting commands from $(dump_arch)..."
     102        @xsltproc --xinclude --nonet --output $(DUMPDIR)/$(dump_arch)/ $(PWD)/stylesheets/dump-commands.xsl $(dump_arch)-index.xml
     103
     104download-list: $(ARCHS_DLLIST)
     105
     106$(ARCHS_DLLIST): override dllist_arch = $(@:%$(S)dllist=%)
     107$(ARCHS_DLLIST):
     108        @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
    158110
    159111help:
    160         @printf "%-25s %-20s\n" "Command" "Function"
    161         @printf "%-25s %-20s\n" "make download-list" "Create download file lists"
    162         @printf "%-25s %-20s\n" "make dump-commands" "Dump all the commands from the book"
    163         @printf "%-25s %-20s\n" "make clfs" "Make the standard multilib page book"
    164         @printf "%-25s %-20s\n" "make nochunks" "Make single html file book"
    165         @printf "%-25s %-20s\n" "make pdf" "Make pdf copy of the book"
    166         @printf "%-25s %-20s\n" "make target-list" "Get List of Architecture targets"
    167         @printf "%-25s %-20s\n" "make text" "Make a text copy of the book"
    168         @printf "%-25s %-20s\n" "make trouble" "Make a copy that's easy to troubleshoot"
    169         @printf "%-25s %-20s\n" "make validate" "Run book validation"
    170 
    171 .PHONY: clfs toplevel common render nochunks nochunk_render pdf text validate trouble dump-commands download-list \
    172         target-list help
     112        @echo "HTML Targets"
     113        @echo -e "  \e[0;32mlfs tidy render titlepage \e[0;34m$(ARCHS_HTML)\e[0;0m"
     114        @echo
     115        @echo "NoChunks Targets"
     116        @echo -e "  \e[0;32mnochunks tidy \e[0;34m$(ARCHS_NOCHUNKS)\e[0;0m"
     117        @echo
     118        @echo "PDF Targets"
     119        @echo -e "  \e[0;32mpdf \e[0;34m$(ARCHS_PDF)\e[0;0m"
     120        @echo
     121        @echo "Text Targets"
     122        @echo -e "  \e[0;32mtext \e[0;34m$(ARCHS_TEXT)\e[0;0m"
     123        @echo
     124        @echo "Validate Targets"
     125        @echo -e "  \e[0;32mvalidate \e[0;34m$(ARCHS_VALIDATE)\e[0;0m"
     126        @echo
     127        @echo "Trouble Targets"
     128        @echo -e "  \e[0;32mtrouble \e[0;34m$(ARCHS_TROUBLE)\e[0;0m"
     129        @echo
     130        @echo "Dump-Commands Targets"
     131        @echo -e "  \e[0;32mdump-commands \e[0;34m$(ARCHS_DUMP)\e[0;0m"
     132        @echo
     133        @echo "Download-List Targets"
     134        @echo -e "  \e[0;32mdownload-list \e[0;34m$(ARCHS_DLLIST)\e[0;0m"
Note: See TracChangeset for help on using the changeset viewer.