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.