Re: GNU Make - Problem defining pattern rules

Henrik Carlqvist <[email protected]> Thu, 29 Apr 2010 08:31:25 +0200
Newsgroups gmane.comp.gnu.utils
Organization SunSITE.dk - Supporting Open source
Message-ID <[email protected]>
Dave <[email protected]> wrote:

> When I execute:
> make src/application/SampleApplication
> 
> I see  "Building a Binary"
> 
> When I execute
> make src/libraries/PluginOne/libPluginOne.so
> 
> I see "make: Nothing to be done for `src/libraries/PluginOne/
> libPluginOne.so'."
> 
> Can anyone explain why the pattern rule for the binary appears to work,
> but the pattern rule for a .so library doesn't?

The "Nothing to be done..." message means that gnu makes considers the
target to already be up to date. This means in your case that
src/libraries/PluginOne/libPluginOne.so already exists and is newer than
src/libraries/PluginOne/libPluginOne.o. It also means that
src/libraries/PluginOne/libPluginOne.o is newer than any of its
prerequisites.

> ----------------------------------------------------------
> # Some Pattern Rules
> #
> %.o: %.cpp
>         @echo "Building Object Files"
> 
> %.so: %.o
>         @echo "Building a Library"
> 
> %: %.o
>         @echo "Building a Binary"

regards Henrik
-- 
The address in the header is only to prevent spam. My real address is:
hc3(at)poolhem.se Examples of addresses which go to spammers:
root@localhost postmaster@localhost