help-make
[Top][All Lists]
Advanced

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

Re: makefile automatic variables question


From: Paul Smith
Subject: Re: makefile automatic variables question
Date: Mon, 12 Jul 2010 00:23:43 -0400

On Sun, 2010-07-11 at 20:02 -0700, tronix wrote:
> % : %.o
>       echo "First line\n"
>       gcc $< -o $@    
> 
> 
> # %.o : %.c
> #     echo "This is second line\n"
> #     gcc -c $<
> 
> .PHONY : clean
> clean :
>       -rm -f $(EXEC) $(OBJS)
> 
> With the lines that are commented I'm not providing any rule to make the
> object files. Hence when I execute make I expected this to give me error,

> does make "know" howto get .o files even with out specifying.

Yes.  See the section "Catalog of Implicit Rules" in the GNU make
manual.

-- 
-------------------------------------------------------------------------------
 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]