How to declare an optional goal in automake?

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

bin_PROGRAMS = foo bar

foo_SOURCES = foo.cpp

bar_SOURCES = bar.cpp

I am interested in being barcompiled when I do make bar, and not when I do make all. But I want to fooalways be compiled. How to do it?

Thank.

+5
source share
1 answer

If you want to declare that a program can be created (i.e. the goal should be chosen by Automake), but should not be built with make allor make check, you can simply declare it as EXTRA_PROGRAMS.

bin_PROGRAMS = foo
EXTRA_PROGRAMS = bar
foo_SOURCES = foo.cpp
bar_SOURCES = bar.cpp
+8
source

All Articles