Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!cs.utexas.edu!uunet!mcvax!hp4nl!botter!star.cs.vu.nl!erikb From: erikb@cs.vu.nl (Erik Baalbergen) Newsgroups: comp.os.minix Subject: Re: Guilty party exonerated Message-ID: <2907@erikb.cs.vu.nl> Date: 19 Jul 89 07:00:41 GMT References: <2904@ast.cs.vu.nl> Reply-To: erikb@cs.vu.nl (Erik Baalbergen) Organization: VU Informatica, Amsterdam Lines: 28 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 Vrije Universiteit / Dept. of Maths. & Comp. Sc. De Boelelaan 1081 1081 HV Amsterdam / The Netherlands tel. +31 20 548 8080