help-gnu-utils
[Top][All Lists]
Advanced

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

Re: Avoid relinking when .so file changes


From: variablecloudiness
Subject: Re: Avoid relinking when .so file changes
Date: 1 Jul 2006 12:06:29 -0700
User-agent: G2/0.2

Henrik Carlqvist wrote:
> variablecloudiness@gmail.com wrote:
> > I don't, however, want 'myBinary' relinked, since the interface to
> > the .so file hasn't changed--relinking is unnecessary.
>
> But you want the .so file created if it doesn't already exist I suppose?

Correct.

> One way to fix this would be:
>
> myBinary: myBinary.o $(filter-out $(wildcard myLibrary.so), myLibrary.so)
>         g++ --go-go-gadget-linker
>
> With the above rule myBinary depends on myLibrary.so if it doesn't
> already exist. But if the file already exist it doesn't care if it is
> newer than myBinary.

Perfect!  Thanks!  I don't claim to understand how that works, but it
does work.

> > How do I change this Makefile to keep the relinking from happening?
> > Dropping the .so dependency creates pain, because then 'make -j' doesn't
> > work right.
>
> What is the problem with make -j? To me it seems as if dropping the
> dependency only would cause the .so file not to be created, regardless of
> if the -j flag is used.

The problem with dropping the dependency was that if I do a 'make
clean' then a 'make -j 4 all' (all is a target that depends on all the
.so files and all of the binaries), the binary may be linked before the
.so file is created, which is an error.

Vince



reply via email to

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