From c2e526179d6f642a75f1e5dc0c59423246734173 Mon Sep 17 00:00:00 2001 From: simonmar Date: Wed, 16 Jul 2003 13:13:50 +0000 Subject: [PATCH] [project @ 2003-07-16 13:13:50 by simonmar] Respect -odir in one-shot compilations. --- ghc/compiler/main/DriverPipeline.hs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ghc/compiler/main/DriverPipeline.hs b/ghc/compiler/main/DriverPipeline.hs index f6f65a0..a5fe7c7 100644 --- a/ghc/compiler/main/DriverPipeline.hs +++ b/ghc/compiler/main/DriverPipeline.hs @@ -381,6 +381,7 @@ genOutputFilenameFunc :: Bool -> Maybe FilePath -> Phase -> String genOutputFilenameFunc keep_output maybe_output_filename stop_phase basename = do hcsuf <- readIORef v_HC_suf + odir <- readIORef v_Output_dir osuf <- readIORef v_Object_suf keep_hc <- readIORef v_Keep_hc_files #ifdef ILX @@ -398,12 +399,14 @@ genOutputFilenameFunc keep_output maybe_output_filename stop_phase basename | next_phase == stop_phase = case maybe_output_filename of Just file -> return file - Nothing | keep_output -> return persistent - | otherwise -> newTempName suffix + Nothing + | Ln <- next_phase -> return odir_persistent + | keep_output -> return persistent + | otherwise -> newTempName suffix -- sometimes, we keep output from intermediate stages | otherwise = case next_phase of - Ln -> return persistent + Ln -> return odir_persistent Mangle | keep_raw_s -> return persistent As | keep_s -> return persistent HCc | keep_hc -> return persistent @@ -412,6 +415,10 @@ genOutputFilenameFunc keep_output maybe_output_filename stop_phase basename suffix = myPhaseInputExt next_phase persistent = basename ++ '.':suffix + odir_persistent + | Just d <- odir = replaceFilenameDirectory persistent d + | otherwise = persistent + return func -- 1.7.10.4