[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Rules with multiple outputs and intermediate chains
From: |
Lane Schwartz |
Subject: |
Re: Rules with multiple outputs and intermediate chains |
Date: |
Mon, 3 Jan 2011 12:53:56 -0500 |
On Wed, Dec 22, 2010 at 12:13 PM, Lane Schwartz <address@hidden> wrote:
> I am trying to solve an issue involving a pattern rule with multiple output
> files, where the output files should be intermediate. In the case below, if
> both output files from a pattern rule are later used as prerequisites, only
> the first one will be treated as intermediate.
>
> The steps to reproduce are below.
>
> Expected result of make all: foo.jkl is created, and all other files are
> created then deleted
> Actual result of make all: foo.jkl is created; foo.abc, foo.def, and
> foo.ghi are created; foo.abc and foo.def are deleted; foo.ghi is NOT deleted
>
> all: foo.jkl
>
>
>
> %.abc:
>
> date > $@
>
>
>
> %.def %.ghi: %.abc
>
> @echo "Generating $*.def and $*.ghi from $*.abc"
>
> @sleep 2
>
> @touch $*.def $*.ghi
>
>
>
> %.jkl: %.def %.ghi
>
> cat $^ > $@
>
> clean:
>
> rm -f *.*
>
>
>
>
>
> Adding the following line does not appear to change make's behavior:
>
>
>
> .INTERMEDIATE: %.ghi
>
>
>
>
>
> When I change the makefile such that the pattern rule that creates %.def
> and %.ghi is created through the use of a template and $(eval $(call
> MY_TEMPLATE)) as in section 8.8 of the GNU Make Manual, neither foo.def nor
> foo.ghi are deleted.
>
>
>
> This behavior seems to be inconsistent with the description of how implicit
> chains should be handled (in section 10.4 of the manual).
>
>
>
> I'd appreciate any advice, as well as confirmation on whether or not this
> behavior should be expected.
>
Paul,
Unfortunately, no one seems to have an answer for this. :-} Can you confirm
whether the above behavior is the expected behavior or is a bug?
Thanks,
Lane
- Re: Rules with multiple outputs and intermediate chains,
Lane Schwartz <=