Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 612
Crazy Chenz Avatar asked Dec 29 '25 15:12

Crazy Chenz


2 Answers

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.

like image 120
Douglas Leeder Avatar answered Jan 02 '26 00:01

Douglas Leeder


The Automake manual has a section about this.

like image 30
adl Avatar answered Jan 01 '26 22:01

adl



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!