vy32
vy32

Reputation: 29655

How do I declare an optional target in 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.

Upvotes: 6

Views: 856

Answers (1)

adl
adl

Reputation: 16044

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

Upvotes: 10

Related Questions