Changeset b47a4a1 for BOOK/Makefile


Ignore:
Timestamp:
Feb 22, 2011, 6:47:10 PM (14 years ago)
Author:
Joe Ciccone <jciccone@…>
Branches:
clfs-1.2, clfs-2.1, clfs-3.0.0-systemd, clfs-3.0.0-sysvinit, master, systemd, sysvinit
Children:
1f9faab, 879785b
Parents:
dabbced
git-author:
Joe Ciccone <jciccone@…> (02/22/11 17:36:44)
git-committer:
Joe Ciccone <jciccone@…> (02/22/11 18:47:10)
Message:

General cleanup of the Makefile.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BOOK/Makefile

    rdabbced rb47a4a1  
    1010ROOT_ID  :=
    1111
    12 S               := -
     12FG_GREEN        := $(shell echo -e '\e[0;32m')
     13FG_BLUE         := $(shell echo -e '\e[0;34m')
     14FG_DEFAULT      := $(shell echo -e '\e[0;0m')
    1315
    14 ARCHS           := x86 x86_64 x86_64-64 sparc sparc64 sparc64-64 mips mips64 mips64-64 \
    15                    ppc ppc64 alpha
     16ARCHS           := x86 x86_64 x86_64-64 \
     17                   sparc sparc64 sparc64-64 \
     18                   mips mips64 mips64-64 \
     19                   ppc ppc64 \
     20                   alpha
    1621
    1722ARCHS_VD_XML    := $(ARCHS:%=%-validate_dump-xml)
    1823ARCHS_P_XML     := $(ARCHS:%=%-profiled-xml)
    1924
    20 ARCHS_HTML      := $(ARCHS:%=%$(S)html)
    21 ARCHS_NOCHUNKS  := $(ARCHS:%=%$(S)nochunks)
    22 ARCHS_PDF       := $(ARCHS:%=%$(S)pdf)
    23 ARCHS_VALIDATE  := $(ARCHS:%=%$(S)validate)
    24 ARCHS_TROUBLE   := $(ARCHS:%=%$(S)trouble)
    25 ARCHS_DUMP      := $(ARCHS:%=%$(S)dump)
    26 ARCHS_DLLIST    := $(ARCHS:%=%$(S)dllist)
     25ARCHS_HTML      := $(ARCHS:%=%-html)
     26ARCHS_NOCHUNKS  := $(ARCHS:%=%-nochunks)
     27ARCHS_PDF       := $(ARCHS:%=%-pdf)
     28ARCHS_VALIDATE  := $(ARCHS:%=%-validate)
     29ARCHS_TROUBLE   := $(ARCHS:%=%-trouble)
     30ARCHS_DUMP      := $(ARCHS:%=%-dump)
     31ARCHS_DLLIST    := $(ARCHS:%=%-dllist)
    2732
    2833ifdef V
     
    3237endif
    3338
    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 
     39.PHONY: clfs lfs render nochunks pdf validate trouble dump-commands download-list
    3840clfs lfs: tmpdir render
    3941render: $(ARCHS_HTML) titlepage
     
    4547download-list: $(ARCHS_DLLIST)
    4648
     49.PHONY: tmpdir
    4750tmpdir:
    48         $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP)
     51        $(Q)mkdir -p $(RENDERTMP)
    4952
     53.PHONY: tidy tidy-f tidy-d
    5054ifeq ($(shell which tidy >/dev/null 2>&1 && echo yes),yes)
    5155tidy:
     
    6468endif
    6569
     70.PHONY: titlepage
    6671titlepage:
    6772        @echo "Rendering the top-level index..."
     
    7075        @$(MAKE) --no-print-directory tidy-f TIDY_FILE=$(BASEDIR)/index.html
    7176
    72 $(ARCHS_VD_XML): override validate_dump_xml_arch = $(@:%-validate_dump-xml=%)
     77
     78.PHONY: $(ARCHS_VD_XML)
     79$(ARCHS_VD_XML): override arch = $(@:%-validate_dump-xml=%)
    7380$(ARCHS_VD_XML): tmpdir
    74         @echo "Validating $(validate_dump_xml_arch) book..."
     81        @echo "Validating $(arch) book..."
    7582        $(Q)xmllint --nonet --noent --xinclude --postvalid \
    76           -o $(RENDERTMP)/$(validate_dump_xml_arch)-full.xml $(PWD)/$(validate_dump_xml_arch)-index.xml
     83          -o $(RENDERTMP)/$(arch)-full.xml $(PWD)/$(arch)-index.xml
    7784
    78 $(ARCHS_P_XML): override profiled_xml_arch = $(@:%-profiled-xml=%)
     85.PHONY: $(ARCHS_P_XML)
     86$(ARCHS_P_XML): override arch = $(@:%-profiled-xml=%)
    7987$(ARCHS_P_XML): tmpdir
    80         @$(MAKE) --no-print-directory $(profiled_xml_arch)-validate_dump-xml
     88        @$(MAKE) --no-print-directory $(arch)-validate_dump-xml
    8189
    82         @echo "Generating profiled $(profiled_xml_arch) book for XHTML..."
     90        @echo "Generating profiled $(arch) book for XHTML..."
    8391        $(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
     92          --output $(RENDERTMP)/$(arch)-html.xml \
     93          $(PWD)/stylesheets/lfs-xsl/profile.xsl $(RENDERTMP)/$(arch)-full.xml
    8694
    87 $(ARCHS_HTML): override html_arch = $(@:%$(S)html=%)
     95.PHONY: $(ARCHS_HTML)
     96$(ARCHS_HTML): override arch = $(@:%-html=%)
    8897$(ARCHS_HTML): tmpdir
    89         @$(MAKE) --no-print-directory $(html_arch)-profiled-xml
     98        @$(MAKE) --no-print-directory $(arch)-profiled-xml
    9099
    91         @echo "Rendering chunked XHTML of $(html_arch)..."
    92         $(Q)mkdir -p $(BASEDIR)/$(html_arch)
     100        @echo "Rendering chunked XHTML of $(arch)..."
     101        $(Q)mkdir -p $(BASEDIR)/$(arch)
    93102        $(Q)xsltproc --nonet -stringparam chunk.quietly $(CHUNK_QUIET) \
    94103          -stringparam rootid "$(ROOT_ID)" \
    95           -stringparam base.dir $(BASEDIR)/$(html_arch)/ \
    96           $(PWD)/stylesheets/clfs-chunked.xsl $(RENDERTMP)/$(html_arch)-html.xml
     104          -stringparam base.dir $(BASEDIR)/$(arch)/ \
     105          $(PWD)/stylesheets/clfs-chunked.xsl $(RENDERTMP)/$(arch)-html.xml
    97106
    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
     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
    105114
    106         @$(MAKE) --no-print-directory tidy-d TIDY_DIR=$(BASEDIR)/$(html_arch)
     115        @$(MAKE) --no-print-directory tidy-d TIDY_DIR=$(BASEDIR)/$(arch)
    107116
    108 $(ARCHS_NOCHUNKS): override nochunk_arch = $(@:%$(S)nochunks=%)
     117.PHONY: $(ARCHS_NOCHUNKS)
     118$(ARCHS_NOCHUNKS): override arch = $(@:%-nochunks=%)
    109119$(ARCHS_NOCHUNKS): tmpdir
    110         @$(MAKE) --no-print-directory $(nochunk_arch)-profiled-xml
     120        @$(MAKE) --no-print-directory $(arch)-profiled-xml
    111121
    112         @echo "Rendering Single File HTML of $(nochunk_arch)..."
     122        @echo "Rendering Single File HTML of $(arch)..."
    113123        $(Q)mkdir -p $(BASEDIR)
    114124        $(Q)xsltproc --nonet -stringparam rootid "$(ROOT_ID)" \
    115           --output $(BASEDIR)/CLFS-$(nochunk_arch).html \
    116           $(PWD)/stylesheets/clfs-nochunks.xsl $(RENDERTMP)/$(nochunk_arch)-html.xml
     125          --output $(BASEDIR)/CLFS-$(arch).html \
     126          $(PWD)/stylesheets/clfs-nochunks.xsl $(RENDERTMP)/$(arch)-html.xml
    117127
    118         @$(MAKE) --no-print-directory tidy-f TIDY_FILE=$(BASEDIR)/CLFS-$(nochunk_arch).html
     128        @$(MAKE) --no-print-directory tidy-f TIDY_FILE=$(BASEDIR)/CLFS-$(arch).html
    119129
    120 $(ARCHS_PDF): override pdf_arch =  $(@:%$(S)pdf=%)
     130.PHONY: $(ARCHS_PDF)
     131$(ARCHS_PDF): override arch =  $(@:%-pdf=%)
    121132$(ARCHS_PDF): tmpdir
    122         @$(MAKE) --no-print-directory $(pdf_arch)-profiled-xml
     133        @$(MAKE) --no-print-directory $(arch)-profiled-xml
    123134
    124         @echo "Generating FO file of $(pdf_arch)..."
     135        @echo "Generating FO file of $(arch)..."
    125136        $(Q)xsltproc --nonet -stringparam rootid "$(ROOT_ID)" \
    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
     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
    129140
    130         @echo "Rendering PDF of $(pdf_arch)..."
     141        @echo "Rendering PDF of $(arch)..."
    131142        $(Q)mkdir -p $(BASEDIR)
    132         $(Q)fop $(RENDERTMP)/$(pdf_arch).fo $(BASEDIR)/CLFS-$(pdf_arch).pdf
     143        $(Q)fop $(RENDERTMP)/$(arch).fo $(BASEDIR)/CLFS-$(arch).pdf
    133144
    134 $(ARCHS_VALIDATE): override validate_arch =  $(@:%$(S)validate=%)
     145.PHONY: $(ARCHS_VALIDATE)
     146$(ARCHS_VALIDATE): override arch =  $(@:%-validate=%)
    135147$(ARCHS_VALIDATE):
    136         @echo "Validating $(validate_arch)..."
    137         $(Q)xmllint --xinclude --noout --nonet --postvalid $(PWD)/$(validate_arch)-index.xml
     148        @echo "Validating $(arch)..."
     149        $(Q)xmllint --xinclude --noout --nonet --postvalid $(PWD)/$(arch)-index.xml
    138150
    139 $(ARCHS_TROUBLE): override trouble_arch =  $(@:%$(S)trouble=%)
     151.PHONY: $(ARCHS_TROUBLE)
     152$(ARCHS_TROUBLE): override trouble_arch =  $(@:%-trouble=%)
    140153$(ARCHS_TROUBLE): tmpdir
    141154        @echo "Troubleshooting $(trouble_arch)..."
    142155        $(Q)xmllint --xinclude --nonet --postvalid \
    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"
     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"
    146159
    147 $(ARCHS_DUMP): override dump_arch =  $(@:%$(S)dump=%)
     160.PHONY: $(ARCHS_DUMP)
     161$(ARCHS_DUMP): override arch =  $(@:%-dump=%)
    148162$(ARCHS_DUMP):
    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
     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
    153167
    154 $(ARCHS_DLLIST): override dllist_arch = $(@:%$(S)dllist=%)
     168.PHONY: $(ARCHS_DLLIST)
     169$(ARCHS_DLLIST): override arch = $(@:%-dllist=%)
    155170$(ARCHS_DLLIST):
    156         @echo "Creating download list for $(dllist_arch)..."
     171        @echo "Creating download list for $(arch)..."
    157172        $(Q)mkdir -p $(DLLISTDIR)
    158         $(Q)xsltproc --xinclude --nonet --output $(DLLISTDIR)/$(dllist_arch)/dl.list \
    159           $(PWD)/stylesheets/wget.xsl $(PWD)/$(dllist_arch)-index.xml
     173        $(Q)xsltproc --xinclude --nonet --output $(DLLISTDIR)/$(arch)/dl.list \
     174          $(PWD)/stylesheets/wget.xsl $(PWD)/$(arch)-index.xml
    160175
    161176help:
     
    163178        @echo
    164179        @echo "HTML Targets"
    165         @echo -e "  \e[0;32mclfs lfs tidy render titlepage \e[0;34m$(ARCHS_HTML)\e[0;0m"
     180        @echo "  $(FG_GREEN)clfs lfs tidy render titlepage $(FG_BLUE)$(ARCHS_HTML)$(FG_DEFAULT)"
    166181        @echo
    167182        @echo "NoChunks Targets"
    168         @echo -e "  \e[0;32mnochunks tidy \e[0;34m$(ARCHS_NOCHUNKS)\e[0;0m"
     183        @echo "  $(FG_GREEN)nochunks tidy $(FG_BLUE)$(ARCHS_NOCHUNKS)$(FG_DEFAULT)"
    169184        @echo
    170185        @echo "PDF Targets"
    171         @echo -e "  \e[0;32mpdf \e[0;34m$(ARCHS_PDF)\e[0;0m"
     186        @echo "  $(FG_GREEN)pdf $(FG_BLUE)$(ARCHS_PDF)$(FG_DEFAULT)"
    172187        @echo
    173188        @echo "Validate Targets"
    174         @echo -e "  \e[0;32mvalidate \e[0;34m$(ARCHS_VALIDATE)\e[0;0m"
     189        @echo "  $(FG_GREEN)validate $(FG_BLUE)$(ARCHS_VALIDATE)$(FG_DEFAULT)"
    175190        @echo
    176191        @echo "Trouble Targets"
    177         @echo -e "  \e[0;32mtrouble \e[0;34m$(ARCHS_TROUBLE)\e[0;0m"
     192        @echo "  $(FG_GREEN)trouble $(FG_BLUE)$(ARCHS_TROUBLE)$(FG_DEFAULT)"
    178193        @echo
    179194        @echo "Dump-Commands Targets"
    180         @echo -e "  \e[0;32mdump-commands \e[0;34m$(ARCHS_DUMP)\e[0;0m"
     195        @echo "  $(FG_GREEN)dump-commands $(FG_BLUE)$(ARCHS_DUMP)$(FG_DEFAULT)"
    181196        @echo
    182197        @echo "Download-List Targets"
    183         @echo -e "  \e[0;32mdownload-list \e[0;34m$(ARCHS_DLLIST)\e[0;0m"
     198        @echo "  $(FG_GREEN)download-list $(FG_BLUE)$(ARCHS_DLLIST)$(FG_DEFAULT)"
Note: See TracChangeset for help on using the changeset viewer.