automake
[Top][All Lists]
Advanced

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

Re: revision control info in generated files


From: Jef Driesen
Subject: Re: revision control info in generated files
Date: Mon, 12 Apr 2010 15:42:03 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9pre) Gecko/20100217 Lightning/1.0pre Shredder/3.0.3pre

On 12/04/10 14:39, Jef Driesen wrote:
On 02/04/10 14:37, Peter Johansson wrote:
On 4/2/10 7:04 AM, Jef Driesen wrote:
I also have a corresponding version.c file that has the same info, but
for use at runtime:

#include "version.h
const int mylib_version_major = MYLIB_VERSION_MAJOR;
const int mylib_version_minor = MYLIB_VERSION_MINOR;
const int mylib_version_micro = MYLIB_VERSION_MICRO;

This should not be a problem when you have the generated version.h. You
can just use the defines from version.h. The tricky thing is that
version.cc will not compile if version.h is not present (not generated
yet), so you need to have a dependency that version.h needs to be
generated before version.o is created.
Read the section 9.4 in Automake manual that explains the details clearly

http://sources.redhat.com/automake/automake.html#Sources

The line

BUILT_SOURCES = version.h

should take care of that, not?

On a second thought, I think I can accomplish the same result with

mylib_la_SOURCES += version.c
mylib_HEADERS += version.h

Recording the dependencies manually should have the benefit of avoiding the "make foo" problem that is described in the manual.





reply via email to

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