[project @ 2002-03-12 10:41:48 by simonmar]
[ghc-hetmet.git] / ghc / compiler / main / DriverPipeline.hs
index f48f9e0..fb98729 100644 (file)
@@ -439,17 +439,19 @@ run_phase MkDependHS basename suff input_fn output_fn
       hdl <- readIORef v_Dep_tmp_hdl
 
        -- std dependency of the object(s) on the source file
-      hPutStrLn hdl (unwords objs ++ " : " ++ basename ++ '.':suff)
+      hPutStrLn hdl (unwords (map escapeSpaces objs) ++ " : " ++
+                    escapeSpaces (basename ++ '.':suff))
 
       let genDep (dep, False {- not an hi file -}) = 
-            hPutStrLn hdl (unwords objs ++ " : " ++ dep)
+            hPutStrLn hdl (unwords (map escapeSpaces objs) ++ " : " ++
+                           escapeSpaces dep)
           genDep (dep, True  {- is an hi file -}) = do
             hisuf <- readIORef v_Hi_suf
             let dep_base = remove_suffix '.' dep
                 deps = (dep_base ++ hisuf)
                        : map (\suf -> dep_base ++ suf ++ '_':hisuf) extra_suffixes
                  -- length objs should be == length deps
-            sequence_ (zipWith (\o d -> hPutStrLn hdl (o ++ " : " ++ d)) objs deps)
+            sequence_ (zipWith (\o d -> hPutStrLn hdl (escapeSpaces o ++ " : " ++ escapeSpaces d)) objs deps)
 
       sequence_ (map genDep [ d | Just d <- deps ])
       return (Just output_fn)
@@ -472,6 +474,7 @@ run_phase MkDependHS basename suff input_fn output_fn
           -- (where .o is $osuf, and the other suffixes come from
           -- the cmdline -s options).
    
+
 -----------------------------------------------------------------------------
 -- Hsc phase
 
@@ -526,10 +529,13 @@ run_phase Hsc basename suff input_fn output_fn
        do_recomp   <- readIORef v_Recomp
        todo        <- readIORef v_GhcMode
        expl_o_file <- readIORef v_Output_file
-        let o_file = 
-               case expl_o_file of
-                 Nothing -> unJust "source_unchanged" (ml_obj_file location)
-                 Just x  -> x
+
+       let o_file -- if the -o option is given and IT IS THE OBJECT FILE FOR
+                  -- THIS COMPILATION, then use that to determine if the 
+                  -- source is unchanged.
+               | Just x <- expl_o_file, todo == StopBefore Ln  =  x
+               | otherwise = unJust "source_unchanged" (ml_obj_file location)
+
        source_unchanged <- 
           if not (do_recomp && ( todo == DoLink || todo == StopBefore Ln ))
             then return False
@@ -712,7 +718,7 @@ run_phase SplitAs basename _suff _input_fn output_fn
 
        odir <- readIORef v_Output_dir
        let real_odir = case odir of
-                               Nothing -> basename
+                               Nothing -> basename ++ "_split"
                                Just d  -> d
 
        let assemble_file n
@@ -1115,7 +1121,6 @@ compile ghci_mode summary source_unchanged have_object
 
       HscRecomp pcs details iface
        stub_h_exists stub_c_exists maybe_interpreted_code -> do
-          
           let 
           maybe_stub_o <- compileStub dyn_flags' stub_c_exists
           let stub_unlinked = case maybe_stub_o of