Changes between Version 4 and Version 5 of pm-base-make


Ignore:
Timestamp:
Jun 1, 2006 8:22:16 PM (14 years ago)
Author:
andreasw
Comment:

reorganized comments to fit into makefile.am text

Legend:

Unmodified
Added
Removed
Modified
  • pm-base-make

    v4 v5  
    11= The Package Base Directory Makefile.am File =
     2
     3In the [wiki:user-directories directory structure example], the package base directory is {{{Coin-Clp}}}.
    24
    35A typical COIN package base directory {{{Makefile.am}}} file looks like this example taken from Clp:
     
    1517
    1618EXTRA_DIST = doxydoc/doxygen.conf
     19}}}
    1720
     21 * One should always start with a '''copyright note and author information''', and include the '''{{{svn:keyword}}} "{{{$Id}}}"'''.  The line with the keyword should start with "{{{##}}}" so that it is not copied into the generated {{{Makefile.in}}} file, which causes some confusion for subversion.
     22
     23 * The '''AUTOMAKE_OPTIONS''' variable is a special variable that indicates certain options for the {{{automake}}} run.  The '''foreign''' option doesn't require the strict conformance with GNU guidelines.
     24
     25 * The '''EXTRA_DIST''' variable is set to every file that should be included in a {{{make dist}}} generated tarball.  One only needs to list non-source files, and non-autotools related files.  In the above example, this is only the configuration file for doxygen.
     26
     27
     28{{{
    1829########################################################################
    1930#                          Subdirectories                              #
     
    2334# into
    2435SUBDIRS = $(subdirs)
     36}}}
    2537
     38 * The {{{Makefile.am}}} in a package base directory needs to be told into which subdirectories to recurse.  This is done with the '''SUBDIRS''' variable.  The Autoconf output variable is already automatically set to the correct value by {{{configure}}}, based on the results of the {{{AC_COIN_MAIN_SUBDIRS}}} macro tests.
     39
     40{{{
    2641########################################################################
    2742#                           Extra Targets                              #
     
    4156
    4257unitTests: tests
     58}}}
    4359
     60 * In theis next section we can define '''extra Makefile targets'''.  As you can see, the '''test''' (and '''unitTest''') first make sure that everything is compiled (the target {{{all}}} is the automatically generated target for compilation of everything).  Then it changes into the packages project directory and runs the {{{test}}} target there.  It is also nice to provide a '''tests''' (and '''unitTests''') target, which runs the {{{test}}} targets in every project subdirectory that seems to have a {{{test}}} subdirectory with a Makefile.
     61
     62
     63{{{
    4464doxydoc:
    4565        cd $(srcdir); doxygen doxydoc/doxygen.conf
    4666
    4767.PHONY: test unitTest tests unitTests doxydoc
     68}}}
    4869
     70 * For C++ packages, we usually also provide a target '''doxydoc''', which runs the {{{doxygen}}} program for all source code found in subdirectories.  Note the "'''cd $(srcdir)'''" here.  In case of a VPATH compilation, the Makefile generated from this {{{Makefile.am}}} file is not run in the directory where {{{doxygen}}} should be run.  The Autoconf output variable '''srcdir''' is set to the directory which contains the source code (such as the {{{Makefile.am}}} file) corresponding to the VPATH directory.
     71
     72{{{
    4973########################################################################
    5074#                         Maintainer Stuff                             #
     
    5781}}}
    5882
    59  * One should always start with a copyright note and author information, and include the {{{svn:keyword}}} "{{{$Id}}}".  The line with the keyword should start with "{{{##}}}" so that it is not copied into the generated {{{Makefile.in}}} file.
    60 
    61  * The '''AUTOMAKE_OPTIONS''' variable is a special variable that indicates certain options for the {{{automake}}} run.  The '''foreign''' option doesn't require the strict conformance with GNU guidelines.
    62 
    63  * The '''EXTRA_DIST''' variable is set to every file that should be included in a {{{make dist}}} generated tarball.  One only needs to list non-source files, and non-autotools related files.  In the above example, this is only the configuration file for doxygen.
    64 
    65  * The {{{Makefile.am}}} in a package base directory needs to be told into which subdirectories to recurse.  This is done with the '''SUBDIRS''' variable.  The Autoconf output variable is already automatically set to the correct value by {{{configure}}}, based on the results of the {{{AC_COIN_MAIN_SUBDIRS}}} macro tests.
    66 
    67  * In the next section we can define '''extra Makefile targets'''.  As you can see, the '''test''' (and '''unitTest''') first make sure that everything is compiled (the target {{{all}}} is the automatically generated target for compilation of everything).  Then it changes into the packages project directory and runs the {{{test}}} target there.  It is also nice to provide a '''tests''' (and '''unitTests''') target, which runs the {{{test}}} targets in every project subdirectory that seems to have a {{{test}}} subdirectory with a Makefile.
    68 
    69  * For C++ packages, we usually also provide a target '''doxydoc''', which runs the {{{doxygen}}} program for all source code found in subdirectories.  Note the "'''cd $(srcdir)'''" here.  In case of a VPATH compilation, the Makefile generated from this {{{Makefile.am}}} file is not run in the directory where {{{doxygen}}} should be run.  The Autoconf output variable '''srcdir''' is set to the directory which contains the source code (such as the {{{Makefile.am}}} file) corresponding to the VPATH directory.
    70 
    7183 * Finally, we '''include the !BuildTools include Makefile.am'''.  This makes sure that additional maintainer-specific targets are defined (such as an automatic update of the {{{svn:externals}}} property when the {{{Externals}}} file has been changed).  Since in this include files values are added to the '''DISTCLEANFILES''' variable, it needs to be "initalized" here, even if it is set to no value.