On Wed, Dec 17, 2008 at 01:44:12PM -0800, Valery Reznic wrote: > > > > --- On Wed, 12/17/08, Jason Friedman <write.to.ja...@gmail.com> wrote: > > > From: Jason Friedman <write.to.ja...@gmail.com> > > Subject: make question > > To: linux-il@cs.huji.ac.il > > Date: Wednesday, December 17, 2008, 10:21 PM > > Hi all, > > > > I have had this make question that has been bugging me for > > a long time. > > > > I want to fix some eps files using eps2eps. This is the > > makefile I use: > > > > Your question already answered in the previous mails, so I'll wrote something > else :) > > In my Makefiles instead of > figure1_fixed.eps: figure1.eps > [tab] eps2eps $< $@ > > I use > figure1_fixed.eps: figure1.eps > [tab] rm -f $@ > [tab] eps2eps $< $@ || { rm -f $@; exit 1; } > > First line will allow Makefile to work even if for some reason target > file is read-only.
Yikes, why would you come to that? > Additional to second line "|| { rm -f $@ ...}" ensure that in case of > some failure no target file remain. So wrong / incomplete file can't > be occassionly used. Here's a similar version that is functionality-equivalent: all: figure1_fixed.eps %_fixed.eps: %.eps [tab] # rm -f $@ [tab] eps2eps $< $@ gmake deletes failed products of failed automatic targets that are in the middle of a chain. -- Tzafrir Cohen | tzaf...@jabber.org | VIM is http://tzafrir.org.il | | a Mutt's tzaf...@cohens.org.il | | best ICQ# 16849754 | | friend ================================================================= To unsubscribe, send mail to linux-il-requ...@cs.huji.ac.il with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail linux-il-requ...@cs.huji.ac.il