views:

107

answers:

2

How should I run a prebuilt Makefile from a Makefile.am?

I am new to automake/autoconf build system. The package I am implementing autotools for has a couple libraries and test executables for each. Some of the libraries are auto-generated ASN1C code that come with prebuilt makefiles. I am not sure of the best way to say inside of the Makefile.am "Build the ASN1C library with the prebuilt makefile".

Attempting to search google with something like this is a bit tough because of the abundance of makefile documentation.

Thanks, Chenz

A: 

This is relatively easy for full builds, but much harder for incremental builds.

It also matters whether the library supports out-of-tree builds.

The important thing to remember is that automake files can contain make rules, so you can create a set of rules to build the library, then add/copy the output of that build where you need it for your build.

Assign a directory for the library build. Write make rules to wrap the library build process. Tie in the output of the library build as dependencies of your build.

The only bit we haven't done is using the default automake rules for distribution/installation - I'm not sure how you would add the libraries to those lists, but I assume there is a way, as you must be able to distribution random files like translations in your distribution.

Incremental builds are much harder, because you have to capture appropriate dependencies in your make rules, to cover the dependencies from the library makefile.

Douglas Leeder
+1  A: 

The Automake manual has a section about this.

adl