Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I declare an optional target in automake?

Tags:

automake

In my Makefile.am file I have something like this:

bin_PROGRAMS = foo bar

foo_SOURCES = foo.cpp

bar_SOURCES = bar.cpp

I am interested in having bar only compiled when I do a make bar, not when I do a make all. But I want foo always compiled. How do I do that?

Thanks.

like image 322
vy32 Avatar asked Feb 02 '12 20:02

vy32


1 Answers

If you want do declare a program can be built (i.e. the target must be emitted by Automake), but should not be built by make all or make check, you can simply declare it as EXTRA_PROGRAMS.

bin_PROGRAMS = foo
EXTRA_PROGRAMS = bar
foo_SOURCES = foo.cpp
bar_SOURCES = bar.cpp
like image 158
adl Avatar answered Dec 14 '22 14:12

adl