On Wed, Dec 17, 2008 at 01:44:12PM -0800, Valery Reznic wrote:
>
>
>
> --- On Wed, 12/17/08, Jason Friedman <[email protected]> wrote:
>
> > From: Jason Friedman <[email protected]>
> > Subject: make question
> > To: [email protected]
> > 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 | [email protected] | VIM is
http://tzafrir.org.il | | a Mutt's
[email protected] | | best
ICQ# 16849754 | | friend
=================================================================
To unsubscribe, send mail to [email protected] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [email protected]