help-make
[Top][All Lists]
Advanced

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

RE: makedepends and implicit rule


From: Paul Smith
Subject: RE: makedepends and implicit rule
Date: Wed, 31 Jan 2007 08:17:13 -0500

On Wed, 2007-01-31 at 10:22 +0000, sharan basappa wrote:

> >Make has an implicit "%.o : %.c" rule.  Look in the make info file, 
> >section 10.2 "Catalogue of Implicit Rules".
> 
> The question I was asking how make decides to compile even though I
> dont have a rule of the form
> *.o : *.c
> The only rule I have is
> a : a.o
> I believe this rule should force make to invoke linker but make also invokes 
> compiler (cc -c -o b.o b.c)

Sure it invokes the compiler: how else can you get the .o you need to
link?

Dave already gave you the answer: make has a number of built-in implicit
rules that tell it how to do various things: building a .o from a .c is
of course one of those built-in rules.  So, you don't need to provide an
explicit rule for this (unless you don't like the built-in rule and want
to change it to something else).

As Dave says, the GNU make manual has a list of many of the built-in
rules.  Use "make -p -f /dev/null" to see an entire list.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

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