[comp.os.minix] Guilty party exonerated

ast@cs.vu.nl (Andy Tanenbaum) (07/19/89)

I spoke too soon.  It is true that the new make does not expand $* the
way it used it.  I sort of assumed that it did it right in the old make and
wrong in the new one.  However, another possibility exists: it did it wrong
in the old one and right in the new one.

To quote Stu Feldman, "If the command was generated by an implicit rule
(see below), $< is the name of the related file that caused the action,
and $* is the prefix shared by the current and dependent file names."

Nothing is said about explicit rules, only implicit ones.  What do all you
'make' gurus think?

Andy Tanenbaum (ast@cs.vu.nl)

erikb@cs.vu.nl (Erik Baalbergen) (07/19/89)

In article <2904@ast.cs.vu.nl> ast@cs.vu.nl (Andy Tanenbaum) writes:
>I spoke too soon.  It is true that the new make does not expand $* the
>way it used it.  I sort of assumed that it did it right in the old make and
>wrong in the new one.  However, another possibility exists: it did it wrong
>in the old one and right in the new one.
>To quote Stu Feldman, "If the command was generated by an implicit rule
>(see below), $< is the name of the related file that caused the action,
>and $* is the prefix shared by the current and dependent file names."
$< and $* indeed work for implicit rules but not for explicit rules.
$@ and $? work for both.
Within the "body" of the implicit rule ".A.B: ; body", when triggered to
create file.B using file.A, $< expands to file.A, $* expands to file, $@
expnads to file.B, and $? expands to file.A.
Within the body of rule "t: d1 d2 d3", $< and $* are replaced by empty text,
$@ expands to t, and $? expands to the "string of names that were found
to be younger than the target" (Feldman), e.g. d1 d3.
In the context of an explicit rule there may be multiple files that caused
the action, so $< cannot be determined.  It could have been defined as
"the set of dependents" within an explicit rule, but it simply isn't.
$* is not uniquely defined within an explicit rule in general; there may
be no prefix shared by the target and its dependent(s).

Erik Baalbergen
-- 
Erik H. Baalbergen				    <erikb@cs.vu.nl>
Vrije Universiteit / Dept. of Maths. & Comp. Sc.
De Boelelaan 1081
1081 HV Amsterdam / The Netherlands		tel. +31 20 548 8080

V61%DHDURZ1.BITNET@cunyvm.cuny.edu (Ronald Lamprecht) (07/20/89)

I as the author of the patches (the guilty party) would like to point out that
Erik Baalbergen <erikb@CS.UU.NL> in his article from 19 Jul 89
did exactly figure out the reasons why I did set $* and $< to a NULL string
for explicit rules. Within the old version it has been set to the result of
the last evaluated implicit rule and did only match the common expectations
for the embracing explicit rule in 90% by chance.

Bitnet:  V61@DHDURZ1                               Ronald Lamprecht
UUCP:    ...!unido!DHDURZ1.bitnet!V61              Theoretische Physik
ARPAnet: V61%DHDURZ1.BITNET@CUNYVM.CUNY.EDU       (Heidelberg, West Germany)