automake
[Top][All Lists]
Advanced

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

Re: RFE: allow for computed version number


From: Ralf Wildenhues
Subject: Re: RFE: allow for computed version number
Date: Thu, 4 Jun 2009 08:43:21 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

Hi Bruno,

> * Bruno Haible wrote on Sun, May 31, 2009 at 12:50:13PM CEST:
> > - with a lazily computed version number (this is for projects where the 
> > version
> >   changes several times a day):
> > 
> >     AM_INIT_VERSION([$$version], [version=`sh $(top_srcdir)/gen-version`])

Here's a slightly different idea.  The basic unit of granularity in
makefiles is a target, or a file.  The problem we're facing is that the
version is clumped together with all other information inside
config.status, config.h, Makefile files.  So let's separate it by
declaring a special file that contains the version (whether that be
.version or another name), say, by some AM_VERSION_FILE macro.

You could then experiment with suitable rules to keep the file up to
date, depending on the VCS.  VCS hooks could ensure to update (or
remove, or otherwise outdate) the file.  All rules that need the version
can just depend upon the file, and read from it afterwards, that nicely
avoids any duplicate work.  The file should conceptually live in the
source tree as it is a source property not a build one (though newline
encoding may make this a bit ugly for cross-platform mounts).
Maintainer mode could even be used to avoid updates to this file.

What do you think of this approach?

Thanks,
Ralf




reply via email to

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