Fix for Windows, and delete the .mk file if ghc-config fails
[ghc.git] / testsuite / mk / boilerplate.mk
index dd5be68..bac5e3b 100644 (file)
@@ -140,10 +140,10 @@ $(TOP_ABS)/mk/ghc-config : $(TOP_ABS)/mk/ghc-config.hs
 
 empty=
 space=$(empty) $(empty)
-ghc-config-mk = $(TOP_ABS)/mk/ghcconfig$(subst $(space),_,$(subst /,_,$(subst \,_,$(TEST_HC)))).mk
+ghc-config-mk = $(TOP_ABS)/mk/ghcconfig$(subst :,_,$(subst $(space),_,$(subst /,_,$(subst \,_,$(TEST_HC))))).mk
 
 $(ghc-config-mk) : $(TOP_ABS)/mk/ghc-config
-       $(TOP_ABS)/mk/ghc-config "$(TEST_HC)" >"$@" || $(RM) "$@"
+       $(TOP_ABS)/mk/ghc-config "$(TEST_HC)" >"$@"; if [ $$? != 0 ]; then $(RM) -f "$@"; exit 1; fi
 
 include $(ghc-config-mk)