Resending with a simplified example which doesn't require TeX.

  Ken

On Wed, Jan 18, 2006 at 03:14:51PM -0500, Ken Smith wrote:
> I have a question about deletion of intermediate files.  Attached are
> the makefile and test TeX document in question.
> 
> Environment: Linux 2.4, GNU make 3.81beta4
> Related Environment: TeX (Web2C 7.3.1) 3.14159
> 
> I want to have make delete the intermediate .aux, .log, .out, .ps, and
> .dvi files.
> 
> When I simply run make, I'm left with .aux and .log files.  Sometimes
> there is also a .out file.
> 
> When I run this
> 
>   gmake use-intermediate-rule=t
> 
> make deletes all the intermediate files.  Is this expected behavior?
> 
> I believe (from section 10.4 Chains of Implicit Rules and 10.5.1
> Introduction to Pattern Rules) that adding all the files explicitly to
> the dependency graph would automatically mark them all as intermediate.
> It is only marking .dvi and .ps as intermediate.
> 
>   Ken

> doc := test
> 
> all: $(doc).pdf
> 
> this-makefile := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
> 
> %.pdf: %.ps
>       ps2pdf $<
> 
> %.ps: %.dvi %.aux %.log %.out
>       dvips -Ppdf -t a4 -o $@ $<
> 
> $(if $(use-intermediate-rule), \
>   $(eval .INTERMEDIATE: $(addprefix $(doc),.aux .log .out)) \
>  )
> %.dvi %.aux %.log %.out: %.tex $(this-makefile)
>       latex $<
>       latex $< # Second invocation for cross references
> 
> 
> .PHONY: clean
> clean:
>       rm -f $(addprefix $(doc),.aux .log .out .dvi .pdf .ps)


doc := test

all: $(doc).final

%.final: %.step-two
        cp $< $@
        echo done >> $@

%.step-two: %.step-one.1 %.step-one.2 %.step-one.3 %.step-one.4
        cat $^ > $@

$(if $(use-intermediate-rule), \
  $(eval .INTERMEDIATE: $(addprefix $(doc),.step-one.2 .step-one.3 
.step-one.4)) \
 )

%.step-one.1 %.step-one.2 %.step-one.3 %.step-one.4: %.input $(this-makefile)
        cp $< $*.step-one.1
        cp $< $*.step-one.2
        cp $< $*.step-one.3
        cp $< $*.step-one.4

%.input:
        echo hi > $@

.PHONY: clean
clean:
        rm -f $(addprefix $(doc),.step-one.2 .step-one.3 .step-one.4 
.step-one.1 .final .step-two)
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to