>>> "EH" == Ed Hartnett <[EMAIL PROTECTED]> writes:
[...] EH> # These linker flags will be applied to all test program compiles. EH> LDADD = -lnetcdf -lhdf5 -lhdf5_hl EH> # Test programs (unless they have _h_ in the name) are dependent on EH> # the netcdf library (i.e. should be rebuilt if the library's more EH> # recent). EH> tst_nc_converts_DEPENDENCIES = libnetcdf.la EH> tst_lists_DEPENDENCIES = libnetcdf.la EH> tst_dims_DEPENDENCIES = libnetcdf.la EH> tst_v2_DEPENDENCIES = libnetcdf.la EH> tst_files_DEPENDENCIES = libnetcdf.la EH> ... EH> Is there a better way to do this? Specifically, one which doesn't EH> require me to explicitly list the dependency program for each and EH> every test program that depends on it. [...] I'm installing the following on HEAD and branch-1-9. 2005-07-27 Alexandre Duret-Lutz <[EMAIL PROTECTED]> * doc/automake.texi (Linking, Program and Library Variables): Suggest reserving -l for third-party libraries. Index: doc/automake.texi =================================================================== RCS file: /cvs/automake/automake/doc/automake.texi,v retrieving revision 1.120 diff -u -r1.120 automake.texi --- doc/automake.texi 27 Jul 2005 06:34:18 -0000 1.120 +++ doc/automake.texi 27 Jul 2005 19:02:42 -0000 @@ -3226,6 +3226,16 @@ cause an invalid value for @[EMAIL PROTECTED] to be generated. [EMAIL PROTECTED] @code{LDADD} and @option{-l} [EMAIL PROTECTED] @option{-l} and @code{LDADD} +We recommend that you avoid using @option{-l} options in @code{LDADD} +or @[EMAIL PROTECTED] when referring to libraries built by your +package. Instead, write the file name of the library explicitly as in +the above @code{cpio} example. Use @option{-l} only to list +third-party libraries. If you follow this rule, the default value of [EMAIL PROTECTED]@var{prog}_DEPENDENCIES} will list all your local libraries and +omit the other ones. + @node Conditional Sources @subsection Conditional compilation of sources @@ -4057,6 +4067,11 @@ maude_LDADD = $(X_PRE_LIBS) $(X_LIBS) $(X_EXTRA_LIBS) @end example +We recommend that you use @option{-l} and @option{-L} only when +referring to third-party libraries, and give the explicit file names +of any library built by your package. Doing so will ensure that [EMAIL PROTECTED] (see below) is correctly defined by default. + @item maude_LDFLAGS This variable is used to pass extra flags to the link step of a program or a shared library. It overrides the global @code{AM_LDFLAGS} variable. -- Alexandre Duret-Lutz