nmh-workers
[Top] [All Lists]

Re: problem w/ make install on MacOS X 10.1.5

2002-06-27 11:29:07
On June 27, 2002 at 01:03, "Dan Harkless" wrote:

Earl Hood <earl(_at_)earlhood(_dot_)com> writes:
Your problem could have been avoid if .PHONY was defined within
the makefile.

Apparently no one ever used nmh on a case-insensitive OS before, or if they
did, they didn't report that "make install" failed (so many open source
packages have a top-level "INSTALL" file that such people would probably
work around the "`install' is up to date" problem by reflex).

As for me, I'd never heard of .PHONY before now.  Is it GNU make specific?
I just looked at a Solaris make man page and it doesn't support this
(verified experimentally).

.PHONY is supported by GNU make, and I believe some other make variants,
but you are right, it appears that make on Solaris does not support
it (I just checked).  However, it causes no make syntax errors since
Solaris make treats .PHONY like a regular target.

The alternative is to use a bogus "force" target to get the same effect:

    install: FORCE
            ...

    FORCE:

Leave the FORCE target blank.  Use a different name if there is
a chance that FORCE may be an actual filename.  I typically use
a target name that starts with an underscore to minimize filename
conflict:

    install: _FORCE
            ...

    _FORCE:

Doing this will give the same effect as .PHONY, albeit less efficient.

Just out of habit, I have learned to use .PHONY for all non-file-based
targets since I've had projects with phony targets that did happen
to match a filename.

--ewh


<Prev in Thread] Current Thread [Next in Thread>