Changes between Version 4 and Version 5 of pm-automake-intro


Ignore:
Timestamp:
Jun 2, 2006 9:18:06 PM (14 years ago)
Author:
andreasw
Comment:

cleaned up

Legend:

Unmodified
Added
Removed
Modified
  • pm-automake-intro

    v4 v5  
    11= Introduction of Automake Concepts =
    22
    3 The format of the Automake {{{Makefile.am}}} input files is essentially that of a usual Makefile:  One can have comments (everything in a line following a "{{{#}}}"), set Makefile variables, and write rules.
     3The language of the Automake {{{Makefile.am}}} input files is essentially that of a usual Makefile:  One can have comments (everything in a line following a "{{{#}}}"), set Makefile variables, and write rules.
    44
    5 Some of the Makefile variables in a {{{Makefile.am}}} file have special meaning.  For example, the {{{SUBDIRS}}} variable can be set to the list of directories, into which the generated Makefile should recurse.
     5Some of the Makefile variables in a {{{Makefile.am}}} file have a special meaning.  For example, the {{{SUBDIRS}}} variable can be set to the list of directories, into which the generated Makefile should recurse.
    66
    77The things that should be built, are listed in variable names that have a '''primary''', and possibly a '''prefix'''.  Typical examples are
     
    2626 * '''LTLIBRARIES''':  This primary is used to tell Automake the name(s) of libraries that should be build.  (Since we are using Libtool in COIN, we don't use the {{{LIBRARIES}}} primary.)  The extension should be libtool's {{{.la}}} (not {{{.a}}} or {{{.so}}}). The prefix again indicates, where the library (or libraries, if both static libraries and shared objects are compiled) are to be installed.  Usually, this is '''lib_''' to have them installed in the {{{lib}}} directory, or '''noinst_''', if they should not be installed.
    2727
    28   * '''SOURCES''': This primary is used to list all the source files that should be compiled in order to generate a program or a library.  Depending on the extension of the source file, Automake will figure out how the file should be compiled and generate automatically the requires rules.  One also includes all header files, so that a {{{make dist}}} will know, what to include in a distribution.  (In COIN, we generate the tarballs not by this feature, but it is still a good idea to follow the common scheme.)
     28  * '''SOURCES''': This primary is used to list all the source files that should be compiled in order to generate a program or a library.  Depending on the extension of a source file, Automake will figure out how the file should be compiled and generate automatically the requires rules.  One also includes all header files, so that a {{{make dist}}} will know what to include in a distribution.  (In COIN, we generate the tarballs not by this feature, but it is still a good idea to follow the common scheme.)
    2929
    3030  The prefix for {{{SOURCES}}} is the name of the program or library, including extension, where any dash ("{{{-}}}") and any period ("{{{.}}}") is replaced by an underscore ("{{{_}}}").
     
    3232 * '''HEADERS''': This is usually used with the '''include_''' prefix, and one lists here all the header files that should be installed in the {{{include}}} directory.  Note that not all header files in the source code directory might be required by a user in order to link her/his code to the library, and it is good practice to only install required header files.
    3333
    34  * There are a number of additional primaries, such as '''LDFLAGS''' in the above example.  In this case, this lists additional flags that should be used when the library is "linked" (a Libtool term).  The prefix specifies, for which program or library this applies.
     34 * There are a number of additional primaries, such as '''LDFLAGS''' in the above example.  With this specific primary, one lists additional flags that should be used when the library is "linked" (a Libtool term).  The prefix specifies for which program or library this applies.
    3535
    3636
     
    5858  else
    5959  tellme:
    60           echo "Something must have gone wrong with the configure test"
     60          echo "Something must have gone wrong in the configure test"
    6161  endif
    6262 }}}
    6363 If the conditional {{{COIN_IS_GREAT}}} is true, then the {{{tellme}}} target will output the first line, otherwise the second.  (In the final Makefile, the inactive lines are simply commented out.)
    6464
    65  * The {{{Makefile.am}}} file can {{{include other input files}}}.  For example, in
     65 * The {{{Makefile.am}}} file can '''include other input files'''.  For example, with
    6666 {{{
    6767 include BuildTools/Makemain.inc
     
    7777 * '''AM_CXXFLAGS''':  This variable is provided to add other C++ compiler flags (which are not already determined by {{{configure}}}).  Similarly, '''AM_CFLAGS''' and '''AM_F77FLAGS''' can be used to add C and Fortran compiler flags.
    7878
    79  * '''SUBDIRS''' can be set to the subdirectories into which the final Makefile should recurse into.
     79 * '''SUBDIRS''' can be set to the subdirectories into which the final Makefile should recurse into for the Automake default targets (such as {{{all}}}, {{{install}}}, {{{clean}}}, etc.).
    8080
    81  * '''srcdir''' is an Autoconf output variable that is set to the directory with the source code correponding to the {{{Makefile}}} that is run.  In case of a VPATH compilation, the current director and the source code directory are two different directories.
     81 * '''srcdir''' is an Autoconf output variable that is set to the directory with the source code correponding to the {{{Makefile}}} that is run.  In case of a VPATH compilation, the current directory and the source code directory are two different directories.
    8282
    8383 * '''DISTCLEANFILES''' can be set to all files (including wildcards) that should be deleted by a '''make distclean''' and are not deleted by defaults.  For example, if a test program generates output files, those should be listed here.
    8484
    85  * '''EXTRA_DIST''':  This variable matters for a '''make dist''', which generates a tarball with everything necessary to compile the package.  To generate the COIN tarballs, we use a different mechanism than {{{make dist}}}.  However, if you want to make sure that {{{make dist}}} works, you need to list all files here, that are not included
     85 * '''EXTRA_DIST''':  This variable matters for a '''make dist''', which generates a tarball with everything necessary to compile the package.  To generate the COIN tarballs, we use a different mechanism than {{{make dist}}}.  However, if you want to make sure that {{{make dist}}} works, you need to list all files here, that are not included by default.