6

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.

adl
  • 15,627
  • 6
  • 51
  • 65
vy32
  • 28,461
  • 37
  • 122
  • 246

1 Answers1

10

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
adl
  • 15,627
  • 6
  • 51
  • 65