Changeset 40918 for trunk/doc-new


Ignore:
Timestamp:
Oct 18, 2008, 12:59:23 PM (11 years ago)
Author:
simon@…
Message:

doc-new: Removed hyphens from variable names as they are not recommended.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc-new/Makefile

    r40917 r40918  
    2525MAN   = man
    2626# Source directories.
    27 GUIDE-SRC = $(GUIDE)/xml
    28 MAN-SRC   = $(MAN)/xml
     27GUIDE_SRC = $(GUIDE)/xml
     28MAN_SRC   = $(MAN)/xml
    2929# Result directories.
    30 GUIDE-RESULT       = $(GUIDE)/html
    31 GUIDE-RESULT-CHUNK = $(GUIDE-RESULT)/chunked
    32 MAN-RESULT         = $(MAN)/man/
     30GUIDE_RESULT       = $(GUIDE)/html
     31GUIDE_RESULT_CHUNK = $(GUIDE_RESULT)/chunked
     32MAN_RESULT         = $(MAN)/man/
    3333# Man temporary directory.
    34 MAN-TMP = $(MAN)/tmp
     34MAN_TMP = $(MAN)/tmp
    3535
    3636# Path to the DocBook XSL files.
    3737DOCBOOK         = $(PREFIX)/share/xsl/docbook-xsl
    38 GUIDE-XSL       = $(GUIDE)/resources/single-page.xsl
    39 GUIDE-XSL-CHUNK = $(GUIDE)/resources/chunk.xsl
    40 MAN-XSL         = $(MAN)/resources/macports.xsl
     38GUIDE_XSL       = $(GUIDE)/resources/single-page.xsl
     39GUIDE_XSL_CHUNK = $(GUIDE)/resources/chunk.xsl
     40MAN_XSL         = $(MAN)/resources/macports.xsl
    4141
    4242# DocBook HTML stylesheet for the guide.
     
    4747all: guide man
    4848
    49 # Generate the HTML guide using DocBook from the XML sources in $(GUIDE-SRC).
     49# Generate the HTML guide using DocBook from the XML sources in $(GUIDE_SRC).
    5050guide:
    51         $(MKDIR) -p $(GUIDE-RESULT)
    52         $(CP) $(GUIDE)/resources/$(STYLESHEET) $(GUIDE-RESULT)/$(STYLESHEET)
    53         $(CP) $(GUIDE)/resources/images/* $(GUIDE-RESULT)/
     51        $(MKDIR) -p $(GUIDE_RESULT)
     52        $(CP) $(GUIDE)/resources/$(STYLESHEET) $(GUIDE_RESULT)/$(STYLESHEET)
     53        $(CP) $(GUIDE)/resources/images/* $(GUIDE_RESULT)/
    5454        $(LN) -sfh $(DOCBOOK) $(GUIDE)/resources/xsl
    5555        $(XSLTPROC) --xinclude \
    56             --output $(GUIDE-RESULT)/index.html \
    57             $(GUIDE-XSL) $(GUIDE-SRC)/guide.xml
     56            --output $(GUIDE_RESULT)/index.html \
     57            $(GUIDE_XSL) $(GUIDE_SRC)/guide.xml
    5858        # Convert all sections (h1-h9) to a link so it's easy to link to them.
    5959        # If someone knows a better way to do this please change it.
    6060        $(SED) -i "" -E \
    6161            's|(<h[0-9] [^>]*><a id="([^"]*)"></a>)([^<]*)(</h[0-9]>)|\1<a href="#\2">\3</a>\4|g' \
    62             $(GUIDE-RESULT)/index.html
     62            $(GUIDE_RESULT)/index.html
    6363
    6464# Generate the chunked HTML guide with one section per file.
    6565guide-chunked:
    66         $(MKDIR) -p $(GUIDE-RESULT-CHUNK)
    67         $(CP) $(GUIDE)/resources/$(STYLESHEET) $(GUIDE-RESULT-CHUNK)/$(STYLESHEET)
    68         $(CP) $(GUIDE)/resources/images/* $(GUIDE-RESULT-CHUNK)/
     66        $(MKDIR) -p $(GUIDE_RESULT_CHUNK)
     67        $(CP) $(GUIDE)/resources/$(STYLESHEET) $(GUIDE_RESULT_CHUNK)/$(STYLESHEET)
     68        $(CP) $(GUIDE)/resources/images/* $(GUIDE_RESULT_CHUNK)/
    6969        $(LN) -sfh $(DOCBOOK) $(GUIDE)/resources/xsl
    7070        $(XSLTPROC) --xinclude \
    71             --output $(GUIDE-RESULT-CHUNK)/index.html \
    72             $(GUIDE-XSL-CHUNK) $(GUIDE-SRC)/guide.xml
     71            --output $(GUIDE_RESULT_CHUNK)/index.html \
     72            $(GUIDE_XSL_CHUNK) $(GUIDE_SRC)/guide.xml
    7373        # Convert all sections (h1-h9) to a link so it's easy to link to them.
    7474        # If someone knows a better way to do this please change it.
    7575        $(SED) -i "" -E \
    7676            's|(<h[0-9] [^>]*><a id="([^"]*)"></a>)([^<]*)(</h[0-9]>)|\1<a href="#\2">\3</a>\4|g' \
    77             $(GUIDE-RESULT-CHUNK)/*.html
     77            $(GUIDE_RESULT_CHUNK)/*.html
    7878        # Add the table of contents to every junked HTML file.
    7979        # If someone knows a better way to do this please change it.
    80         $(TCLSH) toc-for-chunked.tcl $(GUIDE-RESULT-CHUNK)
     80        $(TCLSH) toc-for-chunked.tcl $(GUIDE_RESULT_CHUNK)
    8181
    8282
    83 # Generate the man pages using DocBook from the XML source in $(MAN-SRC).
    84 # The portfile-*.xml and portgroup-*.xml files in $(GUIDE-SRC) are copied to
    85 # $(MAN-TMP) and modified (section -> refsection) so they can be used as man
    86 # XML source files and then xincluded in the real man XML files in $(MAN-SRC).
    87 man: $(MAN-XSL)
    88         $(MKDIR) -p $(MAN-RESULT)
    89         $(MKDIR) -p $(MAN-TMP)
    90         $(CP) $(GUIDE-SRC)/portfile-*.xml $(MAN-TMP)
    91         $(CP) $(GUIDE-SRC)/portgroup-*.xml $(MAN-TMP)
    92         $(SED) -i "" 's|<section|<refsection|g' $(MAN-TMP)/*
    93         $(SED) -i "" 's|</section>|</refsection>|g' $(MAN-TMP)/*
    94         $(XSLTPROC) --xinclude --output $(MAN-RESULT) $(MAN-XSL) \
    95             $(MAN-SRC)/port.1.xml \
    96             $(MAN-SRC)/portfile.7.xml \
    97             $(MAN-SRC)/portgroup.7.xml \
    98             $(MAN-SRC)/porthier.7.xml
    99         $(RM) -r $(MAN-TMP)
     83# Generate the man pages using DocBook from the XML source in $(MAN_SRC).
     84# The portfile-*.xml and portgroup-*.xml files in $(GUIDE_SRC) are copied to
     85# $(MAN_TMP) and modified (section -> refsection) so they can be used as man
     86# XML source files and then xincluded in the real man XML files in $(MAN_SRC).
     87man: $(MAN_XSL)
     88        $(MKDIR) -p $(MAN_RESULT)
     89        $(MKDIR) -p $(MAN_TMP)
     90        $(CP) $(GUIDE_SRC)/portfile-*.xml $(MAN_TMP)
     91        $(CP) $(GUIDE_SRC)/portgroup-*.xml $(MAN_TMP)
     92        $(SED) -i "" 's|<section|<refsection|g' $(MAN_TMP)/*
     93        $(SED) -i "" 's|</section>|</refsection>|g' $(MAN_TMP)/*
     94        $(XSLTPROC) --xinclude --output $(MAN_RESULT) $(MAN_XSL) \
     95            $(MAN_SRC)/port.1.xml \
     96            $(MAN_SRC)/portfile.7.xml \
     97            $(MAN_SRC)/portgroup.7.xml \
     98            $(MAN_SRC)/porthier.7.xml
     99        $(RM) -r $(MAN_TMP)
    100100
    101101# Create XSL from template for man pages.
    102 $(MAN-XSL):
     102$(MAN_XSL):
    103103        $(SED) 's:@PREFIX@:$(PREFIX):' $@.in > $@
    104104
     
    106106clean:
    107107        $(RM) -rf $(GUIDE)/resources/xsl
    108         $(RM) -rf $(GUIDE-RESULT)
    109         $(RM) -rf $(MAN-RESULT)
    110         $(RM) -rf $(MAN-TMP)
    111         $(RM) -rf $(MAN-XSL)
     108        $(RM) -rf $(GUIDE_RESULT)
     109        $(RM) -rf $(MAN_RESULT)
     110        $(RM) -rf $(MAN_TMP)
     111        $(RM) -rf $(MAN_XSL)
    112112        $(RM) -f  guide.tmp.xml
    113113
     
    116116# ids.
    117117validate:
    118         $(XMLLINT) --xinclude $(GUIDE-SRC)/guide.xml > guide.tmp.xml
     118        $(XMLLINT) --xinclude $(GUIDE_SRC)/guide.xml > guide.tmp.xml
    119119        $(XMLLINT) --loaddtd --valid --noout guide.tmp.xml
Note: See TracChangeset for help on using the changeset viewer.