#! /usr/bin/make -f # ## Clean out temporary tex files # ## Called with no args removes temp files from current working directory. # works recursively through subdirs if called with arg "recurse". # works on directory DIR if called with option "-C DIR" # does not remove anything but prints what would be done instead if called with # option -n. # ## GPL 2004 Manfred Waßmann http://www.berlinos.de/ ## # # Copyright (C) 2004 Manfred Waßmann http://www.berlinos.de/ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2, # as published by the Free Software Foundation. # # tidytex,v 1.7 2007-12-30 22:17:50 manolo Exp # VERBOSE = yes JUNK_SUFFIXES = aux log tex~ tex.~*~ MAKEFLAGS = -s ################################### ### End of cunfigurable section ### ################################### JUNKFILES = $(foreach sfx,$(JUNK_SUFFIXES),$(wildcard *.$(sfx))) ifneq ($(strip $(VERBOSE)),) override VERBOSE := -v endif all: workdir # @+printf "[%s]\n" $@ recurse: workdir # @+printf "[%s]\n" $@ +$(foreach dir,$(shell find . -type d -not -name . -not -name ..),\ $(_) -C $(dir) $@;) help: @+printf "Usage: tidytex [all|recurse]\n" workdir: @+printf "[%s]\n" $(CURDIR) @test -z "$(strip $(JUNKFILES))" || $(RM) $(VERBOSE) $(JUNKFILES) .PHONY: all workdir recurse # # tidytex,v # Revision 1.7 2007-12-30 22:17:50 manolo # Support numbered backups. # # Revision 1.6 2005/06/29 06:38:16 manolo # Help target added. # # Revision 1.5 2005/01/27 21:03:30 manolo # More consistent output. # # Revision 1.4 2005/01/27 21:00:00 manolo # Reduced diagnostic messages. # # Revision 1.3 2005/01/27 20:26:57 manolo # Fixed dependency list of target .PHONY. # # Revision 1.2 2005/01/27 20:26:07 manolo # Renamed target recursive to recurse; added tex~ to list of suffixes. # # Revision 1.1 2005/01/27 20:21:50 manolo # Initial release. #