On 8/31/2009 10:29 PM, Mike Shal wrote:
On 9/1/09, John Calcote<[email protected]> 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
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make