[Top][All Lists]

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

Re: How to modify algorithm that determines weather a target needs rebui

From: Bob Proulx
Subject: Re: How to modify algorithm that determines weather a target needs rebuild
Date: Mon, 9 Aug 2010 14:46:29 -0600
User-agent: Mutt/1.5.18 (2008-05-17)

mirage1987 wrote:
> I am new to GNU make and doesn't have much experience with builds. 

However you are jumping into it with both feet!  But because of this
statement and this question I wish to ask if this is an X-Y problem?

What are you really trying to do?

> And after every successful build of the target i touch the target file to
> point to timestamp of foo.c


> I want to do this because the timestamp of my source file (foo.c) could
> change both back and forth.

This sounds like the X part of the X-Y problem.  Why will the
timestamp of the file be changing back and forth?

Is this because you have two competing builds running in the same
directory with one doing it one way and the other doing it another
way?  I will guess that you build it first one way with make and a
Makefile and it is up to date.  Then you build it a second different
way with a different make and a second different Makefile.  Then it
also appears up to date when building it with the first Makefile too??

> So i need to build the target only if the timestamp changes for source.

This sounds like the Y part of the X-Y problem.  But the X part is the
one to solve.


reply via email to

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