help-make
[Top][All Lists]
Advanced

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

Re: Request for critique on a small makefile


From: Philip Guenther
Subject: Re: Request for critique on a small makefile
Date: Tue, 12 Dec 2006 15:37:00 -0700

On 12/12/06, Edward Z. Yang <address@hidden> wrote:
...
Is there a specific reason, then, that you use $< rather than $^?

No, more personal habit than rational decision: I used $< in makefile
long before I ever used a make that supported $^.  I agree that $^
makes more sense for rules that may have more than one input, such as
those for linking executables.

> Ah.  Hmm.  My *guess* is that g++ will only add the .exe suffix if
> there isn't already such a suffix present.  If so, then following the
> three points I listed should work.

This seems to be the case. I'm currently working around it by cleaning
up *.exe files with make clean.   On Unix, ${programs} does the dirty
work. I think this is a satisfactory solution (and not a hack).

So you didn't add the .exe suffix to the names in the 'programs'
variable?  Hmm.  What happens if you run 'make' twice, without
modifying any files?  If your makefile is correctly set up, then the
second 'make' will do nothing, because the targets are all up to date.
If the .exe confusion means that your makefile is violating Paul's
rule #2 then one or both executable will be rebuilt by the second
make.


Philip Guenther




reply via email to

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