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.



Thanks,

Lane
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to