Changes in / [1f9faab:4317f44]


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • BOOK/Makefile

    r1f9faab r4317f44  
    1010ROOT_ID  :=
    1111
    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')
     12S               := -
    1513
    16 ARCHS           := x86 x86_64 x86_64-64 \
    17                    sparc sparc64 sparc64-64 \
    18                    mips mips64 mips64-64 \
    19                    ppc ppc64 \
    20                    alpha
     14ARCHS           := x86 x86_64 x86_64-64 sparc sparc64 sparc64-64 mips mips64 mips64-64 \
     15                   ppc ppc64 alpha
    2116
    2217ARCHS_VD_XML    := $(ARCHS:%=%-validate_dump-xml)
    2318ARCHS_P_XML     := $(ARCHS:%=%-profiled-xml)
    2419
    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)
     20ARCHS_HTML      := $(ARCHS:%=%$(S)html)
     21ARCHS_NOCHUNKS  := $(ARCHS:%=%$(S)nochunks)
     22ARCHS_PDF       := $(ARCHS:%=%$(S)pdf)
     23ARCHS_VALIDATE  := $(ARCHS:%=%$(S)validate)
     24ARCHS_TROUBLE   := $(ARCHS:%=%$(S)trouble)
     25ARCHS_DUMP      := $(ARCHS:%=%$(S)dump)
     26ARCHS_DLLIST    := $(ARCHS:%=%$(S)dllist)
    3227
    3328ifdef V
     
    3732endif
    3833
    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
    4038clfs lfs: tmpdir render
    4139render: $(ARCHS_HTML) titlepage
     
    4745download-list: $(ARCHS_DLLIST)
    4846
    49 .PHONY: tmpdir
    5047tmpdir:
    51         $(Q)mkdir -p $(RENDERTMP)
     48        $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP)
    5249
    53 .PHONY: tidy tidy-f tidy-d
    5450ifeq ($(shell which tidy >/dev/null 2>&1 && echo yes),yes)
    5551tidy:
     
    6864endif
    6965
    70 .PHONY: titlepage
    7166titlepage:
    7267        @echo "Rendering the top-level index..."
     
    7570        @$(MAKE) --no-print-directory tidy-f TIDY_FILE=$(BASEDIR)/index.html
    7671
     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
    7777
    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
    8481
    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-xml
     82        @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
    8986
    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
    9490
    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)
    10293        $(Q)xsltproc --nonet -stringparam chunk.quietly $(CHUNK_QUIET) \
    10394          -stringparam rootid "$(ROOT_ID)" \
    104           -stringparam base.dir $(BASEDIR)/$(arch)/ \
    105           $(PWD)/stylesheets/clfs-chunked.xsl $(RENDERTMP)/$(arch)-html.xml
     95          -stringparam base.dir $(BASEDIR)/$(html_arch)/ \
     96          $(PWD)/stylesheets/clfs-chunked.xsl $(RENDERTMP)/$(html_arch)-html.xml
    10697
    107         @echo "Copying CSS code and images for $(arch)..."
    108         $(Q)mkdir -p $(BASEDIR)/$(arch)/stylesheets
    109         $(Q)cp $(PWD)/stylesheets/lfs-xsl/*.css $(BASEDIR)/$(arch)/stylesheets
    110         $(Q)sed -i -e "s@../stylesheets@stylesheets@g" $(BASEDIR)/$(arch)/*.html
    111         $(Q)mkdir -p $(BASEDIR)/$(arch)/images
    112         $(Q)cp $(PWD)/images/*.png $(BASEDIR)/$(arch)/images
    113         $(Q)sed -i -e "s@../images@images@g" $(BASEDIR)/$(arch)/*.html
     98        @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
    114105
    115         @$(MAKE) --no-print-directory tidy-d TIDY_DIR=$(BASEDIR)/$(arch)
     106        @$(MAKE) --no-print-directory tidy-d TIDY_DIR=$(BASEDIR)/$(html_arch)
    116107
    117 .PHONY: $(ARCHS_NOCHUNKS)
    118 $(ARCHS_NOCHUNKS): override arch = $(@:%-nochunks=%)
     108$(ARCHS_NOCHUNKS): override nochunk_arch = $(@:%$(S)nochunks=%)
    119109$(ARCHS_NOCHUNKS): tmpdir
    120         @$(MAKE) --no-print-directory $(arch)-profiled-xml
     110        @$(MAKE) --no-print-directory $(nochunk_arch)-profiled-xml
    121111
    122         @echo "Rendering Single File HTML of $(arch)..."
     112        @echo "Rendering Single File HTML of $(nochunk_arch)..."
    123113        $(Q)mkdir -p $(BASEDIR)
    124114        $(Q)xsltproc --nonet -stringparam rootid "$(ROOT_ID)" \
    125           --output $(BASEDIR)/CLFS-$(arch).html \
    126           $(PWD)/stylesheets/clfs-nochunks.xsl $(RENDERTMP)/$(arch)-html.xml
     115          --output $(BASEDIR)/CLFS-$(nochunk_arch).html \
     116          $(PWD)/stylesheets/clfs-nochunks.xsl $(RENDERTMP)/$(nochunk_arch)-html.xml
    127117
    128         @$(MAKE) --no-print-directory tidy-f TIDY_FILE=$(BASEDIR)/CLFS-$(arch).html
     118        @$(MAKE) --no-print-directory tidy-f TIDY_FILE=$(BASEDIR)/CLFS-$(nochunk_arch).html
    129119
    130 .PHONY: $(ARCHS_PDF)
    131 $(ARCHS_PDF): override arch =  $(@:%-pdf=%)
     120$(ARCHS_PDF): override pdf_arch =  $(@:%$(S)pdf=%)
    132121$(ARCHS_PDF): tmpdir
    133         @$(MAKE) --no-print-directory $(arch)-profiled-xml
     122        @$(MAKE) --no-print-directory $(pdf_arch)-profiled-xml
    134123
    135         @echo "Generating FO file of $(arch)..."
     124        @echo "Generating FO file of $(pdf_arch)..."
    136125        $(Q)xsltproc --nonet -stringparam rootid "$(ROOT_ID)" \
    137           --output $(RENDERTMP)/$(arch).fo $(PWD)/stylesheets/clfs-pdf.xsl \
    138           $(RENDERTMP)/$(arch)-html.xml
    139         $(Q)sed -i -e 's/span="inherit"/span="all"/' $(RENDERTMP)/$(arch).fo
     126          --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
    140129
    141         @echo "Rendering PDF of $(arch)..."
     130        @echo "Rendering PDF of $(pdf_arch)..."
    142131        $(Q)mkdir -p $(BASEDIR)
    143         $(Q)fop $(RENDERTMP)/$(arch).fo $(BASEDIR)/CLFS-$(arch).pdf
     132        $(Q)fop $(RENDERTMP)/$(pdf_arch).fo $(BASEDIR)/CLFS-$(pdf_arch).pdf
    144133
    145 .PHONY: $(ARCHS_VALIDATE)
    146 $(ARCHS_VALIDATE): override arch =  $(@:%-validate=%)
     134$(ARCHS_VALIDATE): override validate_arch =  $(@:%$(S)validate=%)
    147135$(ARCHS_VALIDATE):
    148         @echo "Validating $(arch)..."
    149         $(Q)xmllint --xinclude --noout --nonet --postvalid $(PWD)/$(arch)-index.xml
     136        @echo "Validating $(validate_arch)..."
     137        $(Q)xmllint --xinclude --noout --nonet --postvalid $(PWD)/$(validate_arch)-index.xml
    150138
    151 .PHONY: $(ARCHS_TROUBLE)
    152 $(ARCHS_TROUBLE): override trouble_arch =  $(@:%-trouble=%)
     139$(ARCHS_TROUBLE): override trouble_arch =  $(@:%$(S)trouble=%)
    153140$(ARCHS_TROUBLE): tmpdir
    154141        @echo "Troubleshooting $(trouble_arch)..."
    155142        $(Q)xmllint --xinclude --nonet --postvalid \
    156           -o $(RENDERTMP)/dump-$(arch) $(PWD)/$(arch)-index.xml
    157         $(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"
    159146
    160 .PHONY: $(ARCHS_DUMP)
    161 $(ARCHS_DUMP): override arch =  $(@:%-dump=%)
     147$(ARCHS_DUMP): override dump_arch =  $(@:%$(S)dump=%)
    162148$(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.xml
     149        @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
    167153
    168 .PHONY: $(ARCHS_DLLIST)
    169 $(ARCHS_DLLIST): override arch = $(@:%-dllist=%)
     154$(ARCHS_DLLIST): override dllist_arch = $(@:%$(S)dllist=%)
    170155$(ARCHS_DLLIST):
    171         @echo "Creating download list for $(arch)..."
     156        @echo "Creating download list for $(dllist_arch)..."
    172157        $(Q)mkdir -p $(DLLISTDIR)
    173         $(Q)xsltproc --xinclude --nonet --output $(DLLISTDIR)/$(arch)/dl.list \
    174           $(PWD)/stylesheets/wget.xsl $(PWD)/$(arch)-index.xml
     158        $(Q)xsltproc --xinclude --nonet --output $(DLLISTDIR)/$(dllist_arch)/dl.list \
     159          $(PWD)/stylesheets/wget.xsl $(PWD)/$(dllist_arch)-index.xml
    175160
    176161help:
     
    178163        @echo
    179164        @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"
    181166        @echo
    182167        @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"
    184169        @echo
    185170        @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"
    187172        @echo
    188173        @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"
    190175        @echo
    191176        @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"
    193178        @echo
    194179        @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"
    196181        @echo
    197182        @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.