[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Clarification: deleting intermediate files
From: |
Ken Smith |
Subject: |
Re: Clarification: deleting intermediate files |
Date: |
Thu, 19 Jan 2006 10:53:44 -0500 |
User-agent: |
mutt-ng/devel-r569 (Linux) |
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)
Makefile
Description: Text document