[Top][All Lists]

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

Re: [automake] Dependency question with _LDADD

From: Peter Johansson
Subject: Re: [automake] Dependency question with _LDADD
Date: Wed, 27 Aug 2008 10:50:48 -0400
User-agent: Thunderbird (X11/20080723)

Michel Briand wrote:

# Library: libtraining
# Generates its own pkg-config definition file

Why not put

in, so you don't need the above?  Of course you may want to
use a less generic name, e.g. TRAINING_LIBRARY_VERSION.

Similar applies to -DPROGRAM_VERSION in src/bin/

OK. That's a lot more concise. But having done this:

# Step 1: extract version number from a source file
Why do you keep that info in a separate file; why not just:


# Step 2: export this variable to Makefile
and if since you AC_SUBST the variable you could (if it is important) create file PROGRAM_VERSION from a

Setting the version in you can avoid all the headache with setting dependencies correctly, especially for a beginners' template that is not appropriate.

FWIW, you could actually add ../../LIBRARY_VERSION to this variable.

Yes, it works well too. I'll have all my dependencies handled that way.

But working a little with it, I have one remark:
since, with AC_DEFINE, the version is stored in config.h and that all
source files depend on it, all my C files are rebuild (in lib or bin)
if I change the version file. The smart dependency is lost. So I'll
remove library's and program's versions from config.h and rely on the
old define on the command line. That's better for my need. But I wait
for you comments/tips on the AC_DEFINE I showed earlier in this mail.

Defining the version like that at command line, (as far as I can see) you've lost the dependency, in other words, if you change the version number it will not cause a re-compilation. If you want the smart dependency, you could let aclocal create a version.h (AC_CONFIG_FILES) from a and then include version.h in only those c files in which it is needed.


reply via email to

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