[project @ 2003-07-23 14:05:51 by simonmar]
authorsimonmar <unknown>
Wed, 23 Jul 2003 14:05:51 +0000 (14:05 +0000)
committersimonmar <unknown>
Wed, 23 Jul 2003 14:05:51 +0000 (14:05 +0000)
Always create directories for the .o file, not just when using the
compilation manager.

ghc/compiler/main/DriverPipeline.hs

index 81ef08d..9866b56 100644 (file)
@@ -191,10 +191,6 @@ compile ghci_mode this_mod location
                -- we're in batch mode: finish the compilation pipeline.
                _other -> do
                   let object_filename = ml_obj_file location
-                      object_dir = directoryOf object_filename
-
-                  -- create the object dir if it doesn't exist
-                  createDirectoryHierarchy object_dir
 
                   runPipeline (StopBefore Ln) ""
                        True Nothing output_fn (Just location)
@@ -794,6 +790,10 @@ runPhase As _basename _suff input_fn get_output_fn maybe_loc
 
        output_fn <- get_output_fn Ln maybe_loc
 
+       -- we create directories for the object file, because it
+       -- might be a hierarchical module.
+       createDirectoryHierarchy (directoryOf output_fn)
+
        SysTools.runAs (map SysTools.Option as_opts
                       ++ [ SysTools.Option ("-I" ++ p) | p <- cmdline_include_paths ]
                       ++ [ SysTools.Option "-c"