[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Commands with multiple output files
From: |
Paul D. Smith |
Subject: |
Re: Commands with multiple output files |
Date: |
Wed, 6 Feb 2002 17:57:14 -0500 |
%% Peter Eisentraut <address@hidden> writes:
pe> Paul D. Smith writes:
>> %% Peter Eisentraut <address@hidden> writes:
>>
pe> What is a good way to write rules that contain commands with multiple
pe> output files?
>>
>> Use multiple patterns in a pattern rule. See the GNU make manual,
>> section _Introduction to Pattern Rules_.
pe> That only works when the files have related names, but not in a general
pe> case, like
pe> abc def: uvw xyz
Absolutely. In the example you gave, that was the case.
There is no way that is not a "hack", for some definition of that word,
to do this in the case where the names are not related.
You have to do something like this:
foo: .gen_abc_def
<commands that use abc and def>
.gen_abc_def: <prerequisites of abc and def>
<build abc and def>
@touch $@
--
-------------------------------------------------------------------------------
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