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)

Attachment: test.tex
Description: TeX document

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

Reply via email to