[Tfug] How do I get automake to set build number?

Bexley Hall bexley401 at yahoo.com
Wed Apr 18 11:29:36 MST 2007


--- Joe Blais <joe.blais at pti-instruments.com> wrote:

> Hello -
> 
> I've been using KDevelop with the GNU automake
> stuff.
> 
> I would really like to get a build number into a
> version string.
>
> Besides not knowing how to get it to update a
> version string, I don't even
> know where it's keeping the data for the version
> string. I just haven't
> gotten that deep into the automagic I guess.
> 
> I could put a line into the makefile, but automake
> remakes that.
> 
> I visual studio, I made an app that would parse a
> version.h file that I had
> for every project, and increment the build number. 
> In versio.h I had
> several defines for the various version string
> fields that winders liked to
> have:
> 
> #ifndef VERSION_H
> #define VERSION_H
> 
> #define FILE_VERSION   1, 1, 0, 31
> #define PROD_VERSION   1, 1, 0, 31
> #define FILE_VER_STR   "1, 1, 0, 31"
> #define PROD_VER_STR   "1, 1, 0, 31"
> 
> #endif
> 
> 
> I was able to set pre-build events in a project. 
> The event would call my
> utility, something like:  incbuild version.h
> Every build then had a unique version string, and
> when frantically figuring
> out what version of code was being tested and
> running on what machine, it
> really saved me, if I saved the code.
> 
> Linux seems to mess with file dates differently than
> winders, unless I need
> to look at a different date of a file so I can track
> it.  It seems modified
> and accessed are for the specific copy of a file,
> not the original one.
> 
> Anyway --
> 
> Does anyone out there have a good method of
> identifying the specific build
> of an application?

Why not just use a timestamp?  During development,
I find this far more useful than any "meaningless"
version/build number.  It lets me quickly determine
how "recent" the build is (was) without having to
dig through a log to figure out what/when I built
it.  Timestamps are "sufficiently different looking"
to never be mistaken for release versions.  I.e.
you know *immediately* if you are using "release"
vs. "development" binaries (which can be useful if
you have to "sanitize" binaries before release).

HTH,
--don

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




More information about the tfug mailing list