Sam
Sam

Reputation: 1167

How to create dependencies in automake?

I have a Makefile.am file right now that looks like this:

lib_LIBRARIES = foo.a

foo_a_SOURCES = bar.F90 baz.F90

When compiled, bar.F90 gives bar.o. However, bar.F90 depends on several other Fortran files (cat.F90, dog.F90, pig.F90). I want to set up Automake to rebuild bar.o if the source of one of these dependencies change.

I've been reading the GNU manuals for automake/autoconf and was unable to find a solution to this. Thanks for reading.

Upvotes: 3

Views: 6568

Answers (1)

Sam Hanes
Sam Hanes

Reputation: 2839

Automake tracks most source-level dependencies automatically as described in the Dependencies section of its manual. If you already knew that and experimentation has shown that it isn't working you will likely have to override the bar.o target to add dependencies as described in the Extending section.

Upvotes: 3

Related Questions