[Top][All Lists]

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

Re: non-phony rules without commands

From: Yakov Lerner
Subject: Re: non-phony rules without commands
Date: Wed, 11 Feb 2004 18:48:58 +0200
User-agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.0.1) Gecko/20020920 Netscape/7.0

Boris Kolpackov wrote:
foo : bar.o

bar.o : bar.cpp
        g++ -c -o $@ $<

Here I don't have a command for 'foo'. 'foo' is not declared
phony. However make 'imagines' that this target is somehow
gets updated. Obviously there is no way 'foo' can be created
(side-effects aside for a moment) so effectively 'foo' becomes an implicit phony target. My question is when this logic can be useful?

As far as I remember, early make (say 20 years ago) didn't have
notion of explicit phony targets. Any such-file-unlikely-to-exist names
could be used to define synonyms/aliases for targets:

  all: link
  link: $(EXECUTABLES)
  compile: $(OBJECTS)

Now they are called 'phony targets', but historically, they were just names that
didn't exist as files.

In old days, it worked unless accidentally, someone would accidentally
create files 'all', 'link', or 'compile'. Then later someone didn't
like this accidentality and came up with explicit 'phony' labeling.
But to sum up, this is historic compatibility I think.


reply via email to

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