help-make
[Top][All Lists]
Advanced

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

Re: newbie needs help in make


From: CHEN Cheng
Subject: Re: newbie needs help in make
Date: Wed, 8 Jul 2009 17:23:30 +0800
User-agent: Mutt/1.5.17 (2007-11-01)

On Wed, Jul 08, 2009 at 01:03:08AM -0700, Payal wrote:
> Hi,
> I have justed started learning make by reading the reference manual by rms 
> et. al.
> My makefile looks like this,
> 
> default: ttt Make1 makefile
>     tar cvf address@hidden $^
> 
> 
> When I do,
> $ make -f Make2
> tar cvf default.tar ttt Make1 makefile
> ttt
> Make1
> makefile
> 
> This I get each time, even when none of the prerequistes have been modified. 
> Why?
> I expected tar to be executed only in case either ttt, makefile or Make1 
> change.
> 
See, your target is "default", instead of "default.tar".

Whenever gmake checks whether to update this target or not, it
compares modify time with its prerequisites' modify time.

In this case, there is no file named "default" generated by command
"tar cvf address@hidden $^". So, in gmake's eyes, this target should be always
updated. Note that I found no statement about this in the manual, but
the following code should work:

default.tar: ttt Make1 makefile
    tar cvf $@ $^


-Cheng




reply via email to

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