Hello Michel, * Michel Briand wrote on Tue, Aug 19, 2008 at 05:03:29PM CEST: > > Referring to GNU Automake manual ยง8.1.2, I'm using the <myprog>_LDADD > variable in my Makfile.am to link it with my library built in the same > package (but in a different directory). > > But every time I rebuild the library (without having changed any .h) the > program is relinked.
Which is as it should be: the program depends upon the library. Are you referring to a static or shared library BTW? With static libraries, it is pretty easy to see why the program needs updating: the code of the archive ends up in the program. With shared libraries, it is not strictly necessary to relink the program if the library has undergone only backward-compatible changes. But automake cannot know that, so the safe thing to do is to relink. Besides, even with compatible changes you want your program to pick up new versioned symbols (if used) and the like. > I'd like to have a Makefile.am that will not generated relinking of my > program once it has been linked one time. Why? You can probably achieve what you desire by setting <myprog>_DEPENDENCIES manually. Look in the current Makefile.in for how automake sets it, and put an adjusted setting in Makefile.am. Hope that helps. Cheers, Ralf