I can use the wildcard function to specify the sources, but automake
doesn't deal with this when figuring out the objects.
Am I missing something really obvious (entirely possible), or is this
truly far more difficult that it should be?
Thanks!
--
========================================================================
Ian Pilcher pilc...@attbi.com
========================================================================
> I am trying to construct a Makefile.am that will build a program out of
> all the *.c files in a directory. It seems like it should be simple,
> but I can't find a way to make it work.
Automake will want a complete list of the sources of your program, so
that it can compute dependencies.
> I can use the wildcard function to specify the sources, but automake
> doesn't deal with this when figuring out the objects.
> Am I missing something really obvious (entirely possible), or is this
> truly far more difficult that it should be?
It's not possible, and is actively discouraged. You should explicitly
define your sources:
bin_PROGRAMS = myprog
myprog_SOURCES = foo.c bar.c baz.c
If you want to conditionally compile source code, you can list extra
potential source files with EXTRA_myprog_SOURCES, and then include
them in myprog_SOURCES with @foo@ configure substitutions.
--
Roger Leigh
** Registration Number: 151826, http://counter.li.org **
Need Epson Stylus Utilities? http://gimp-print.sourceforge.net/
GPG Public Key: 0x25BFB848 available on public keyservers
Of course. It would be foolish to use computers to automate repetitive
tasks.
> Roger Leigh wrote:
> >
> > It's not possible, and is actively discouraged. You should explicitly
> > define your sources:
>
> Of course. It would be foolish to use computers to automate repetitive
> tasks.
This has just been mentioned on the automake lists. Currently it's
not possible, but it may be in the future. This is one thing I would
not automate though--a build should be _reliable_, and using wildcards
will not guarantee consistency. For example, if you accidentally copy
an extra .c file into a directory, it will be built and distributed
without your knowledge (but if you use CVS, others will build
something different, as they won't have this `extra' file). The
converse also applies, and you will get errors if files are missing,
which is good.