[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: multiple targets
From: |
Luke Shumaker |
Subject: |
Re: multiple targets |
Date: |
Mon, 01 Feb 2016 16:00:48 -0500 |
User-agent: |
Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (Gojō) APEL/10.8 EasyPG/1.0.0 Emacs/24.5 (x86_64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) |
On Tue, 19 Jan 2016 04:56:42 -0500,
Phillip Lord wrote:
> While writing a make file, I've just hit the situation where I need to
> write a rule of the form:
>
>
> a b c d e: x y z
> generate_abcde
>
>
> Unfortunately, this doesn't work as the semantics are equivalent to the
> rules where the targets are separate -- that is generate_abcde gets run
> multiple times.
>
> I've done some poking around, and found that a couple of solutions,
> either with pattern rules or otherwise by creating an intermediate file,
> as described here:
>
> http://lists.gnu.org/archive/html/help-make/2007-04/msg00021.html
>
> My understanding is that there is no other way to do this, but I was
> wondering why this was the case; would it be possible to support to make
> for this directly?
Right now, no, there is no support for that in GNU Make.
The automake manual has a section on how to do multiple outputs (that
are all gross, because automake supports (nearly?) every
implementation of make):
https://www.gnu.org/software/automake/manual/html_node/Multiple-Outputs.html
As noted in the mailing list thread you linked, if {a,b,c,d,e} and at
least one of {x,y,z} have a common stem, then pattern rules can be
used with GNU Make (this syntax is non-portable). However, if the
filenames have nothing to do with eachother, then GNU Make has no way
of expressing that.
--
Happy hacking,
~ Luke Shumaker
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: multiple targets,
Luke Shumaker <=