X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=mk%2Fsuffix.mk;h=ade0255dd9e5ff431ae423bbfe41abf52aac2bb5;hb=474955abf3fe4d26171b3ba5ecdbc1784c80cf3a;hp=b914ce27c8dcda20410f432f848fd30e0ae48c05;hpb=56e57eb56cb12c5d85dcddd3118069896e2e2471;p=ghc-hetmet.git diff --git a/mk/suffix.mk b/mk/suffix.mk index b914ce2..ade0255 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 @@ -101,7 +107,7 @@ endif # BootingViaC #----------------------------------------------------------------------------- # Happy Suffix Rules # -.PRECIOUS: %.hs +.SECONDARY: %.hs %.hs : %.ly $(HAPPY) $(HAPPY_OPTS) $< @@ -159,13 +165,13 @@ ifeq "$(UseGhcForCc)" "YES" %.$(way_)s : %.c @$(RM) $@ - $(HC) $(GHC_CC_OPTS) -c $< -o $@ + $(HC) $(GHC_CC_OPTS) -S $< -o $@ 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 @@ -303,5 +309,5 @@ endif # Preprocessor suffix rule % : %.pp - rm -f $@ + @$(RM) $@ $(CPP) $(CPP_OPTS) -x c $< | $(SED) -e '/^#/d' > $@