From: simonmar Date: Mon, 30 Sep 2002 10:22:37 +0000 (+0000) Subject: [project @ 2002-09-30 10:22:37 by simonmar] X-Git-Tag: Approx_11550_changesets_converted~1610 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=145c7ebddb14323738902ad726cd339eb50e03d4;p=ghc-hetmet.git [project @ 2002-09-30 10:22:37 by simonmar] Set .DELETE_ON_ERROR rather than using the strange construction || ($(RM) $@; exit 1) in a few places. --- diff --git a/mk/suffix.mk b/mk/suffix.mk index 6a0a445..cdbefdd 100644 --- a/mk/suffix.mk +++ b/mk/suffix.mk @@ -16,6 +16,12 @@ .SUFFIXES: +# This declaration tells GNU make to delete the target if it has +# changed and the command which created it exited with a non-zero exit +# code. + +.DELETE_ON_ERROR: + # However, if $(way) is set then we have to define $(way_) and $(_way) # from it in the obvious fashion. # This must be done here (or earlier), but not in target.mk with the other @@ -165,7 +171,7 @@ else %.$(way_)o : %.$(way_)s @$(RM) $@ - $(AS) $(AS_OPTS) -o $@ $< || ( $(RM) $@ && exit 1 ) + $(AS) $(AS_OPTS) -o $@ $< %.$(way_)o : %.c @$(RM) $@ @@ -190,10 +196,10 @@ endif %.c : %.flex @$(RM) $@ - $(FLEX) -t $(FLEX_OPTS) $< > $@ || ( $(RM) $@ && exit 1 ) + $(FLEX) -t $(FLEX_OPTS) $< > $@ %.c : %.lex @$(RM) $@ - $(FLEX) -t $(FLEX_OPTS) $< > $@ || ( $(RM) $@ && exit 1 ) + $(FLEX) -t $(FLEX_OPTS) $< > $@ #----------------------------------------------------------------------------- # Yacc stuff