Skip to content
Snippets Groups Projects
  • George Joseph's avatar
    a81e14d2
    Makefile: Allow XML documentation to exist outside source files · a81e14d2
    George Joseph authored
    Moved the xmldoc build logic from the top-level Makefile into
    its own script "make_xml_documentation" in the build_tools
    directory.
    
    Created a new utility script "get_sourceable_makeopts", also in
    the build_tools directory, that dumps the top-level "makeopts"
    file in a format that can be "sourced" from shell sscripts.
    This allows scripts to easily get the values of common make
    build variables such as the location of the GREP, SED, AWK, etc.
    utilities as well as the AST* and library *_LIB and *_INCLUDE
    variables.
    
    Besides moving logic out of the Makefile, some optimizations
    were done like removing "third-party" from the list of
    subdirectories to be searched for documentation and changing some
    assignments from "=" to ":=" so they're only evaluated once.
    The speed increase is noticeable.
    
    The makeopts.in file was updated to include the paths to
    REALPATH and DIRNAME.  The ./conifgure script was setting them
    but makeopts.in wasn't including them.
    
    So...
    
    With this change, you can now place documentation in any"c"
    source file AND you can now place it in a separate XML file
    altogether.  The following are examples of valid locations:
    
    res/res_pjsip.c
        Using the existing /*** DOCUMENTATION ***/ fragment.
    
    res/res_pjsip/pjsip_configuration.c
        Using the existing /*** DOCUMENTATION ***/ fragment.
    
    res/res_pjsip/pjsip_doc.xml
        A fully-formed XML file.  The "configInfo", "manager",
        "managerEvent", etc. elements that would be in the "c"
        file DOCUMENTATION fragment should be wrapped in proper
        XML.  Example for "somemodule.xml":
    
        <?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE docs SYSTEM "appdocsxml.dtd">
        <docs>
            <configInfo>
            ...
            </configInfo>
        </docs>
    
    It's the "appdocsxml.dtd" that tells make_xml_documentation
    that this is a documentation XML file and not some other XML file.
    It also allows many XML-capable editors to do formatting and
    validation.
    
    Other than the ".xml" suffix, the name of the file is not
    significant.
    
    As a start... This change also moves the documentation that was
    in res_pjsip.c to 2 new XML files in res/res_pjsip:
    pjsip_config.xml and pjsip_manager.xml.  This cut the number of
    lines in res_pjsip.c in half. :)
    
    Change-Id: I486c16c0b5a44d7a8870008e10c941fb19b71ade
    a81e14d2
    History
    Makefile: Allow XML documentation to exist outside source files
    George Joseph authored
    Moved the xmldoc build logic from the top-level Makefile into
    its own script "make_xml_documentation" in the build_tools
    directory.
    
    Created a new utility script "get_sourceable_makeopts", also in
    the build_tools directory, that dumps the top-level "makeopts"
    file in a format that can be "sourced" from shell sscripts.
    This allows scripts to easily get the values of common make
    build variables such as the location of the GREP, SED, AWK, etc.
    utilities as well as the AST* and library *_LIB and *_INCLUDE
    variables.
    
    Besides moving logic out of the Makefile, some optimizations
    were done like removing "third-party" from the list of
    subdirectories to be searched for documentation and changing some
    assignments from "=" to ":=" so they're only evaluated once.
    The speed increase is noticeable.
    
    The makeopts.in file was updated to include the paths to
    REALPATH and DIRNAME.  The ./conifgure script was setting them
    but makeopts.in wasn't including them.
    
    So...
    
    With this change, you can now place documentation in any"c"
    source file AND you can now place it in a separate XML file
    altogether.  The following are examples of valid locations:
    
    res/res_pjsip.c
        Using the existing /*** DOCUMENTATION ***/ fragment.
    
    res/res_pjsip/pjsip_configuration.c
        Using the existing /*** DOCUMENTATION ***/ fragment.
    
    res/res_pjsip/pjsip_doc.xml
        A fully-formed XML file.  The "configInfo", "manager",
        "managerEvent", etc. elements that would be in the "c"
        file DOCUMENTATION fragment should be wrapped in proper
        XML.  Example for "somemodule.xml":
    
        <?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE docs SYSTEM "appdocsxml.dtd">
        <docs>
            <configInfo>
            ...
            </configInfo>
        </docs>
    
    It's the "appdocsxml.dtd" that tells make_xml_documentation
    that this is a documentation XML file and not some other XML file.
    It also allows many XML-capable editors to do formatting and
    validation.
    
    Other than the ".xml" suffix, the name of the file is not
    significant.
    
    As a start... This change also moves the documentation that was
    in res_pjsip.c to 2 new XML files in res/res_pjsip:
    pjsip_config.xml and pjsip_manager.xml.  This cut the number of
    lines in res_pjsip.c in half. :)
    
    Change-Id: I486c16c0b5a44d7a8870008e10c941fb19b71ade