[Top][All Lists]

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

Re: Proposed syntax for coincidental rules

From: Paul D. Smith
Subject: Re: Proposed syntax for coincidental rules
Date: Sun, 14 May 2006 09:43:56 -0400

%% Alessandro Vesely <address@hidden> writes:

  av> I couldn't find a statement about multiple targets in SUS' man
  av> page.  SUS clearly states that target rules "can have more than
  av> one target name".  But it never says that it "is equivalent to
  av> writing many rules" as in
  av> .  I wander if running the commands just once would be POSIX
  av> compliant.

I couldn't find it either: but I think this must just be an error in the
spec.  There is not even one single implementation of "make" that I'm
aware of that treats multiple targets like this.

  av> I cannot recall the point of the original proposal. I'm confused:
  av> If I run my example makefile,

  av> .COINCIDENTAL: target1 target2 target3
  av> target1 target2 target3: something
  av>   cat something | tee target1 | tee target2 > target3

  av> with `make target1 target2 target3', I only get a couple of extra
  av> "make: `targetX' is up to date" with respect to the meant
  av> behavior.  Output under -n may also be misleading. However, those
  av> are just irrelevant cosmetic differences that shouldn't deserve
  av> deep syntax changes, aren't they? Then why have you been
  av> suggesting tricks like
  av> to achieve that result? What am I missing now?

This is _required_ for parallel builds.  If you use "make -j3" make will
try to build all three of those targets at the same time, so it will run
the same command three times, which will wreak havoc on the output.

Basically, make is allowed to do "bad things" (and it will do them, at
least sometimes) if it thinks that each target is built individually.

 Paul D. Smith <address@hidden>          Find some GNU make tips at:            
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist

reply via email to

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