[Top][All Lists]

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

Re: Error in processing of :: targets

From: Paul D. Smith
Subject: Re: Error in processing of :: targets
Date: Tue, 14 Jun 2005 08:48:18 -0400

%% address@hidden writes:

  rm> I've run into a functional difference between the standard unix
  rm> make and GNUmake (3.80) involving how the :: rules are processed.

By "standard unix make" you seem to mean SystemV make.  Note that the
only official Standard-with-a-capital-S (recognized by the FSF and GNU
project) for make is the POSIX standard.  The POSIX standard doesn't
address this issue (it doesn't address parallelism at all).

SystemV make is, at best, a de facto standard, and there are plenty of
other (incompatible) versions of make out there.

In fact, GNU make is not intended to be a drop-in replacement for
SystemV make and there are _several_ points at which the behavior of the
two versions diverge.

  rm> In the standard unix make (Solaris), the :: targets ( i.e., all::)
  rm> are process in the order they are found in the Makefile serially,
  rm> regardless of whether parallelism is used (i.e., -jN, where N is >
  rm> 1).

  rm> In GNUmake (3.80), the when -j1 is used, the "::" targets are
  rm> executed serially.  When -jN is used the "::" targets are executed
  rm> in parallel.

GNU make's behavior here is exactly in keeping with the definition of
double-colon rules in the GNU make manual, which states:

>    When a target appears in multiple rules, all the rules must be the
> same type: all ordinary, or all double-colon.  If they are
> double-colon, each of them is independent of the others.  Each
> double-colon rule's commands are executed if the target is older than
> any prerequisites of that rule.  If there are no prerequisites for that
> rule, its commands are always executed (even if the target already
> exists).  This can result in executing none, any, or all of the
> double-colon rules.
>    Double-colon rules with the same target are in fact completely
> separate from one another.  Each double-colon rule is processed
> individually, just as rules with different targets are processed.

If you think a different set of behavior is desirable, the best thing is
probably to file an enhancement request on the Savannah
(https://savannah.gnu.org/) project page for GNU make and someone will
look at it.


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