bug-make
[Top][All Lists]
Advanced

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

Re: make-3.79.1.tar.gz


From: Paul D. Smith
Subject: Re: make-3.79.1.tar.gz
Date: Fri, 25 May 2001 14:05:32 -0400

%% "Gilbert, Peter" <address@hidden> writes:

  gp> This isn't a bug report, it's a request for a feature, which I'm
  gp> willing to implement and have folded into GNU make.

  gp> The problem is that some tools invoked by make produce multiple
  gp> outputs, and the only way I know to reasonably handle this is by
  gp> misstating dependencies.  For example:

  gp>   # This actually produces foo.cpp and foo.h
  gp>   foo.cpp : foo.w
  gp>           ctangle -b foo.w - foo.cpp

First, you should be aware that GNU make _does_ allow you to state the
multiple targets are created from a single invocation of a rule, _but_
you can only do so using pattern rules.

See the GNU make manual section "Introduction to Pattern Rules".

Obviously this only works if your dependency relationship can be
expressed as a pattern rule.  In the example you give this is easy, but
for some tools the name of the output files is not derivable from the
name of the input files (or vice versa) using patterns.

There is no way to do this for explicit rules; this is a long-known
deficiency in GNU make and one that I'd like to address someday.

  gp> What I would instead propose is something along these lines.  The
  gp> special target .MULTIPLE will indicate that the new, variant
  gp> behavior is desired.  Then whenever the commands for two or more
  gp> targets are identical (after expansion), make will assume that all
  gp> the targets are made by the commands.  To implement this, make
  gp> would keep the expanded commands for every target being built;
  gp> before building another target, it would check whether its
  gp> expanded commands are identical to some previous one, skipping
  gp> this new target if so.  (For parallel builds, the new target would
  gp> have to wait for completion of the previous commands, of course).

This seems exceedingly complex (too complex :).

What I was thinking was that a new syntax be introduced for the
definition of a rule, which would mean that all the targets of that rule
would be created with one invocation of its commands.

Perhaps, something like:

  foo bar :+ biz baz
        xxx > foo
        xxx > bar

or whatever (I don't have any great ideas about the syntax :).

-- 
-------------------------------------------------------------------------------
 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]