[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: express multiple output files in gnu make
From: |
Eli Zaretskii |
Subject: |
Re: express multiple output files in gnu make |
Date: |
Sun, 9 Jun 2002 08:26:46 +0300 (IDT) |
On Fri, 7 Jun 2002 address@hidden wrote:
> sh-2.04$ cat makefile
> x.c x.h: x.src; : building $@
> sh-2.04$ make x.c x.h
> : building x.c
> : building x.h
>
> sh-2.04$ cat makefile
> %.c %.h: %.src; : building $@
> sh-2.04$ make x.c x.h
> : building x.c
> make: Nothing to be done for `x.h'.
This is expected behavior: the second example tells Make that both x.c
and x.h are produced by the rule's command. This is explained in the
Make manual.
> So the question is, how to express an action that produces multiple
> output files?
With static pattern rules, like what you used in the second example.
> If they are related by a stem, then you can use a pattern
> rule as in the second case above; but what if they aren't?
Either make them related (by changing names or using % ingeniously), or
you are out of luck.