automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

dynamic include in Makefile.am


From: Tim Just
Subject: dynamic include in Makefile.am
Date: Fri, 02 Apr 2010 10:04:13 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4

Hi,

the project I am working on uses GNU autotools as build system and has
the following structure:

app/
lib/
modules/
configure.ac
Makefile.am

We use one central Makefile.am to avoid the recursive use of make. This
central Makefile.am contains all information related to app/ and lib/.
However each module defines its build system information in an own
Makefile.am that is located in modules/. A typical module-Makefile.am
looks like this:

---------- module Makefile.am ----------

lib_LTLIBRARIES += modules/update/app/libupdate.la

modules_update_app_libupdate_la_SOURCES = modules/update/app/update.c

app_app_LDADD += modules/update/app/libupdate.la

----------------------------------------

By default each module Makefile.am should be included to the central
Makefile.am. Furthermore it should be possible to disable modules per
configure option. That is to not include the corresponding module
Makefile.am.

My first approach was to include an intermediate file generated by
configure. This file (e.g. Makefile.modules) is always included by
Makefile.am. Each configure run changes the content of Makefile.modules
according to the module configuration.

This solution works for in-tree builds, but there are problems with
VPATH builds and the make distcheck target.

Anyway I want to get rid of this intermediate file. Therfore I'm
searching a way to include the module Makefile.am's to the central
Makefile.am, but without knowing which or how many modules exists.

Since includes with wildcards (as in GNU make), don't work in automake,
I've no idea how to realize that.

I use automake 1.11 and autoconf 2.13.

Is there a way to realize the explained functionality?

Thank you,

Tim






reply via email to

[Prev in Thread] Current Thread [Next in Thread]