help-make
[Top][All Lists]
Advanced

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

Re: #include in a C file


From: Paul Smith
Subject: Re: #include in a C file
Date: Mon, 06 Dec 2010 11:22:35 -0500

On Mon, 2010-12-06 at 14:56 +0330, ali hagigat wrote:
> Dear Sam,
> You never answered my latest questions!!
> Does this rule have a recipe?!!:
> main.o main.d : main.c defs.h

When multiple targets appear in an explicit context, it's the same as
writing each target individually.  We've explained this before.

So the above statement is identical to writing:

        main.o : main.c defs.h
        main.d : main.c defs.h

So if you have an implicit or explicit rule for those
targets/prerequisites, then yes, you have a recipe.

For example, in the text you quoted:

> >> %.d: %.c
>>>     <recipe>

so yes, that target has a recipe.  One assumes the there is also a rule
somewhere (the builtin rule if nothing else) saying how to build a .o
from a .c, so yes, that has a recipe as well.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.net
 "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]