On Fri, 27 Mar 2009, Daniel Richard G. wrote:

I have a Makefile.am with programs that are conditionally compiled, e.g.

        EXTRA_PROGRAMS = foo bar

        if ENABLE_STUFF
        bin_PROGRAMS = foo bar
        endif


I don't think you need to use EXTRA_PROGRAMS if you use the idiom

        bin_PROGRAMS =
        if ENABLE_STUFF
        bin_PROGRAMS += foo bar
        endif


EXTRA_PROGRAMS was designed for cases like

== in configure.ac ==
if test X; then
  PROGS="foo bar"
else
  PROGS="baz"
fi
AC_SUBST(PROGS)

== in Makefile.am ==
EXTRA_PROGRAMS=foo bar baz
bin_PROGRAMS=quux $(PROGS)


Without the EXTRA_PROGRAMS, automake wouldn't know what to do with things like foo_SOURCES since foo is otherwise missing from Makefile.am.

- Daniel H



Reply via email to