Reputation: 2720
New to using autoconf
and automake
, I am following this to learn them.
I have a question regarding Makefile.am
file. For a simple helloworld
program below Makefile.am
works:
AUTOMAKE_OPTIONS = foreign
bin_PROGRAMS = helloworld
helloworld_SOURCES = hello.c
How do we specify multiple source files (if there are multiple source files required to compile the program) in the third line ?
You can assume all source files are in same directory where the Makefile.am
is.
Upvotes: 3
Views: 3611
Reputation: 27230
If you just dont want to provide all file names in _SOURCES
as below
helloworld_SOURCES = hello.c x.c y.c b.c
and just want to use *.c
then you can use it as below in makefile.am
helloworld_SOURCES = $(wildcard your_src_dir/*.c)
Upvotes: 1
Reputation: 14659
All you have to do is add them to the hellworld_SOURCES
each file is delimited by a space.
AUTOMAKE_OPTIONS = foreign
bin_PROGRAMS = helloworld
helloworld_SOURCES = hello.c x.c y.c b.c
Upvotes: 3