import Panic
import Util
+#ifdef GHCI
import Time ( getClockTime )
+#endif
import Directory
import System
import IOExts
import Maybe
import PackedString
-import MatchPS
-----------------------------------------------------------------------------
-- genPipeline
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)
-- (where .o is $osuf, and the other suffixes come from
-- the cmdline -s options).
+
-----------------------------------------------------------------------------
-- Hsc phase
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
odir <- readIORef v_Output_dir
let real_odir = case odir of
- Nothing -> basename
+ Nothing -> basename ++ "_split"
Just d -> d
let assemble_file n
++ pkg_extra_ld_opts
++ extra_ld_opts
++ if static && not no_hs_main then
- [ "-u", prefixUnderscore "PrelMain_mainIO_closure",
- "-u", prefixUnderscore "__stginit_PrelMain"]
+ [ "-u", prefixUnderscore "Main_zdmain_closure"]
else []))
-- parallel only: move binary to another dir -- HWL
++ pkg_lib_path_opts
++ pkg_lib_opts
++ pkg_extra_ld_opts
- ++ (case findPS (packString (concat extra_ld_opts)) (packString "--def") of
- Nothing -> [ "--export-all" ]
- Just _ -> [ "" ])
+ ++ (if "--def" `elem` (concatMap words extra_ld_opts)
+ then [ "" ]
+ else [ "--export-all" ])
++ extra_ld_opts
))
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