You probably want to have one object that has symbols for the date and
the time, and this object to be depending on other objects.

I am not an expert of Automake. But my solution seems to work. And this is:

noinst_LTLIBRARIES=libfoo.la
lib_LTLIBRARIES=liball.la
libfoo_la_SOURCES=foo.c bar.c
liball_la_SOURCES=time.c
liball_la_LIBADD=libfoo.la
$(liball_la_OBJECTS): $(libfoo_la_OBJECTS)

time.c contains something like:
const char build_time[] = __TIME__;
const char build_date[] = __DATE__;

And then, the date and time in the .rodata of your library should
always be more recent than the build of the last object in libfoo.

On Thu, Nov 4, 2010 at 9:33 AM, Benjamin Bihler
<benjamin.bih...@twt-gmbh.de> wrote:
>
> Hi Ralf,
>
>
> your first suggestion (with the phony target) works great. The second one
> does not force compilation here (but that doesn't matter anymore since I
> use the phony target now).
>
> As to the third suggestion: I use the __DATE__ and __TIME__ macros in my
> code as a kind of version information. Therefore the compilation result
> differs with every compilation, although my source file does not change. Is
> there yet a better method to store the compilation time stamp in a library
> without fiddling with make targets?
>
>
> Thank you very much and bye,
> Benjamin
>
>
>
>



-- 
Valentin David
valentin.da...@gmail.com

Reply via email to