help-make
[Top][All Lists]
Advanced

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

Re: print project compile date


From: John Calcote
Subject: Re: print project compile date
Date: Tue, 01 Sep 2009 09:48:02 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.1) Gecko/20090715 Thunderbird/3.0b3

On 8/31/2009 10:29 PM, Mike Shal wrote:
On 9/1/09, John Calcote<address@hidden>  wrote:
  Basically, you're telling us that you want a.c to compile every time you
build your project, so that you get the latest date/time stamp from the
latest build. I guess the exception to this might be that you only want to
"update" a.c if the program needs to be rebuilt for any other reason,
otherwise, you want make to act as it always does if everything is already
up to date - that is, do nothing.

  Try adding this line to the *end* of your Makefile (untested):

  a.c: $(APP)
Wouldn't that cause a circular dependency? After all, the file with
the date stamp must ultimately be linked into the application.

Hi Mike,

Yes, of course you're right. It does introduce a circular dependency. But GNU make is smart enough to detect such cycles. I just hoped that it would build a.c before dropping the dependency. Alas, I tested it this morning, and it drops the dependency before building a.c - as it should, I suppose. :)

Anyway, your solution was much better.

Thanks,
John





reply via email to

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