[project @ 2001-06-07 11:03:07 by simonmar]
[ghc-hetmet.git] / ghc / compiler / main / TmpFiles.hs
index 68ced53..a1eae3b 100644 (file)
@@ -1,5 +1,5 @@
 -----------------------------------------------------------------------------
--- $Id: TmpFiles.hs,v 1.17 2001/04/18 11:58:02 sewardj Exp $
+-- $Id: TmpFiles.hs,v 1.21 2001/05/29 17:53:59 sof Exp $
 --
 -- Temporary file management
 --
@@ -87,7 +87,11 @@ removeTmpFiles verb fs = do
       blowAway f =
           (do  when verbose (hPutStrLn stderr ("Removing: " ++ f))
                if '*' `elem` f 
-                 then kludgedSystem ("rm -f " ++ f) "Cleaning temp files" >> return ()
+#if defined(mingw32_TARGET_OS) && defined(MINIMAL_UNIX_DEPS)
+                 then kludgedSystem (unwords [cRM, dosifyPath f]) "Cleaning temp files" >> return ()
+#else
+                 then kludgedSystem (unwords [cRM, f]) "Cleaning temp files" >> return ()
+#endif
                  else removeFile f)
            `catchAllIO`
           (\_ -> when verbose (hPutStrLn stderr 
@@ -99,8 +103,10 @@ removeTmpFiles verb fs = do
 -- because system() under Windows doesn't look at SHELL, and always uses CMD.EXE)
 kludgedSystem cmd phase_name
  = do
-#ifndef mingw32_TARGET_OS
-   la la la
+#if !defined(mingw32_TARGET_OS) || defined(MINIMAL_UNIX_DEPS)
+    -- in the case where we do want to use an MSDOS command shell, we assume
+    -- that files and paths have been converted to a form that's
+    -- understandable to the command we're invoking.
    exit_code <- system cmd `catchAllIO` 
                   (\_ -> throwDyn (PhaseFailed phase_name (ExitFailure 1)))
 #else