bug-make
[Top][All Lists]
Advanced

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

RE: make -j and multiple targets


From: Paul D. Smith
Subject: RE: make -j and multiple targets
Date: Thu, 6 Sep 2001 10:25:19 -0400

%% Peter Gammie <address@hidden> writes:

  pg> Howard,
  pg> On Thu, 6 Sep 2001, Howard Chu wrote:

  >> These rules don't accurately describe the dependencies that you're
  >> dealing with.  If you analyzed your actual order of events, you
  >> wouldn't have this problem:
  >> 
  >> lexer.c: lexer.l
  >> flex -t lexer.l > lexer.c
  >> 
  >> lexer.h: lexer.c
  >> genHeader.pl lexer.l

  pg> point taken, patryk told me the same thing. however, it remains
  pg> that there is a nasty interaction between multiple targets and
  pg> parallel makes.

You're looking at it the wrong way, though.  As Howard alluded to, you
mustn't think that the syntax:

  all: foo bar

  foo bar: baz
        xxx

means that foo and bar are created by invoking a single "xxx" command.
Rather, that syntax is exactly identical to:

  all: foo bar

  foo: baz
        xxx
  bar: baz
        xxx

The former is simply shorthand for the latter.  This is well documented
(see the chapter of the GNU make manual dealing with rules, in
particular the section "Multiple Targets in a 
Rule")==========================""", and is, besides,
behavior mandated by the POSIX standard for make and how every make has
worked since make was invented :).

If you wrote it this way you wouldn't think there was any "nasty
interaction", would you?

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://www.paulandlesley.org/gmake/
 "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]