On 26-Sep-05, at 3:01 PM, Brian Gerkey wrote:


When writing an automake file (Makefile.am), you must NOT define or modify SUBDIRS conditionally.  If you do this, then when it comes time to make a distribution (with 'make dist'), the conditionally-included subdirectories will only be included if the system on which the distribution is made passes the relevant tests.  This it not what you want.

SUBDIRS must be defined unconditionally to include all subdirectories that might ever be needed, on any system.

The right way to handle conditionally building parts of the codebase is modify the Makefile.am in the directory where the conditionally-built code resides.  Using automake conditionals, you can add to (via +=) the appropriate target (e.g., lib_LTLIBRARIES, or bin_PROGRAMS).

My bad, thanks for the correction.

The reason I did it that way at all is because I couldn't figure out the syntax for a two-condition conditional.

Here's your code:

noinst_PROGRAMS =
  noinst_PROGRAMS += test

but originally building test also depended on BUILD_TESTS (or similar) being set. Automake's 'if' only allows one variable to be tested, and I couldn't get a test-within a test to work.

If BUILD_TESTS is no longer to be used, the problem goes away. But multiple conditions might come up elsewhere...?



Brian Gerkey

SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
Playerstage-developers mailing list


Richard Vaughan

School of Computing Science / Simon Fraser University