Add -outputdir flag (#2295)
authorSimon Marlow <simonmar@microsoft.com>
Sat, 27 Sep 2008 14:18:22 +0000 (14:18 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Sat, 27 Sep 2008 14:18:22 +0000 (14:18 +0000)
compiler/main/DynFlags.hs
docs/users_guide/flags.xml
docs/users_guide/separate_compilation.xml

index 34e9f9a..5a1981d 100644 (file)
@@ -680,7 +680,8 @@ getVerbFlag dflags
   | verbosity dflags >= 3  = "-v"
   | otherwise =  ""
 
-setObjectDir, setHiDir, setStubDir, setObjectSuf, setHiSuf, setHcSuf, parseDynLibLoaderMode,
+setObjectDir, setHiDir, setStubDir, setOutputDir,
+         setObjectSuf, setHiSuf, setHcSuf, parseDynLibLoaderMode,
          setPgmP, setPgmL, setPgmF, setPgmc, setPgmm, setPgms, setPgma, setPgml, setPgmdll, setPgmwindres,
          addOptL, addOptP, addOptF, addOptc, addOptm, addOpta, addOptl, addOptwindres,
          addCmdlineFramework, addHaddockOpts
@@ -693,6 +694,7 @@ setHiDir      f d = d{ hiDir      = Just f}
 setStubDir    f d = d{ stubDir    = Just f, includePaths = f : includePaths d }
   -- -stubdir D adds an implicit -I D, so that gcc can find the _stub.h file
   -- \#included from the .hc file when compiling with -fvia-C.
+setOutputDir  f = setObjectDir f . setHiDir f . setStubDir f
 
 setObjectSuf  f d = d{ objectSuf  = f}
 setHiSuf      f d = d{ hiSuf      = f}
@@ -1198,6 +1200,7 @@ dynamic_flags = [
   , Flag "hidir"          (HasArg (upd . setHiDir)) Supported
   , Flag "tmpdir"         (HasArg (upd . setTmpDir)) Supported
   , Flag "stubdir"        (HasArg (upd . setStubDir)) Supported
+  , Flag "outputdir"      (HasArg (upd . setOutputDir)) Supported
   , Flag "ddump-file-prefix" (HasArg (upd . setDumpPrefixForce . Just))
          Supported
 
index aa24617..4ccad78 100644 (file)
            </row>
            <row>
              <entry><option>-odir</option> <replaceable>dir</replaceable></entry>
-             <entry>set output directory</entry>
+             <entry>set directory for object files</entry>
              <entry>dynamic</entry>
              <entry>-</entry>
            </row>
              <entry>dynamic</entry>
              <entry>-</entry>
            </row>
+           <row>
+             <entry><option>-outputdir</option> <replaceable>dir</replaceable></entry>
+             <entry>set output directory</entry>
+             <entry>dynamic</entry>
+             <entry>-</entry>
+           </row>
          </tbody>
        </tgroup>
       </informaltable>
index 01748ae..8f14358 100644 (file)
@@ -374,6 +374,20 @@ $ ghc -c parse/Foo.hs parse/Bar.hs gurgle/Bumble.hs -odir `arch`
          </listitem>
        </varlistentry>
 
+        <varlistentry>
+          <term>
+            <option>-outputdir</option> <replaceable>dir</replaceable>
+            <indexterm><primary><option>-outputdir</option></primary></indexterm>
+          </term>
+          <listitem>
+            <para>The <option>-outputdir</option> option is shorthand for
+              the combination
+              of <option>-odir</option>, <option>-hidir</option>,
+              and <option>-stubdir</option>.
+            </para>
+          </listitem>
+        </varlistentry>
+
        <varlistentry>
          <term>
             <option>-osuf</option> <replaceable>suffix</replaceable>