Commit bb074cb7 authored by Simon Marlow's avatar Simon Marlow
Browse files

Add -outputdir flag (#2295)

parent a5e3c828
...@@ -680,7 +680,8 @@ getVerbFlag dflags ...@@ -680,7 +680,8 @@ getVerbFlag dflags
| verbosity dflags >= 3 = "-v" | verbosity dflags >= 3 = "-v"
| otherwise = "" | 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, setPgmP, setPgmL, setPgmF, setPgmc, setPgmm, setPgms, setPgma, setPgml, setPgmdll, setPgmwindres,
addOptL, addOptP, addOptF, addOptc, addOptm, addOpta, addOptl, addOptwindres, addOptL, addOptP, addOptF, addOptc, addOptm, addOpta, addOptl, addOptwindres,
addCmdlineFramework, addHaddockOpts addCmdlineFramework, addHaddockOpts
...@@ -693,6 +694,7 @@ setHiDir f d = d{ hiDir = Just f} ...@@ -693,6 +694,7 @@ setHiDir f d = d{ hiDir = Just f}
setStubDir f d = d{ stubDir = Just f, includePaths = f : includePaths d } 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 -- -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. -- \#included from the .hc file when compiling with -fvia-C.
setOutputDir f = setObjectDir f . setHiDir f . setStubDir f
setObjectSuf f d = d{ objectSuf = f} setObjectSuf f d = d{ objectSuf = f}
setHiSuf f d = d{ hiSuf = f} setHiSuf f d = d{ hiSuf = f}
...@@ -1198,6 +1200,7 @@ dynamic_flags = [ ...@@ -1198,6 +1200,7 @@ dynamic_flags = [
, Flag "hidir" (HasArg (upd . setHiDir)) Supported , Flag "hidir" (HasArg (upd . setHiDir)) Supported
, Flag "tmpdir" (HasArg (upd . setTmpDir)) Supported , Flag "tmpdir" (HasArg (upd . setTmpDir)) Supported
, Flag "stubdir" (HasArg (upd . setStubDir)) Supported , Flag "stubdir" (HasArg (upd . setStubDir)) Supported
, Flag "outputdir" (HasArg (upd . setOutputDir)) Supported
, Flag "ddump-file-prefix" (HasArg (upd . setDumpPrefixForce . Just)) , Flag "ddump-file-prefix" (HasArg (upd . setDumpPrefixForce . Just))
Supported Supported
......
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
</row> </row>
<row> <row>
<entry><option>-odir</option> <replaceable>dir</replaceable></entry> <entry><option>-odir</option> <replaceable>dir</replaceable></entry>
<entry>set output directory</entry> <entry>set directory for object files</entry>
<entry>dynamic</entry> <entry>dynamic</entry>
<entry>-</entry> <entry>-</entry>
</row> </row>
...@@ -276,6 +276,12 @@ ...@@ -276,6 +276,12 @@
<entry>dynamic</entry> <entry>dynamic</entry>
<entry>-</entry> <entry>-</entry>
</row> </row>
<row>
<entry><option>-outputdir</option> <replaceable>dir</replaceable></entry>
<entry>set output directory</entry>
<entry>dynamic</entry>
<entry>-</entry>
</row>
</tbody> </tbody>
</tgroup> </tgroup>
</informaltable> </informaltable>
......
...@@ -374,6 +374,20 @@ $ ghc -c parse/Foo.hs parse/Bar.hs gurgle/Bumble.hs -odir `arch` ...@@ -374,6 +374,20 @@ $ ghc -c parse/Foo.hs parse/Bar.hs gurgle/Bumble.hs -odir `arch`
</listitem> </listitem>
</varlistentry> </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> <varlistentry>
<term> <term>
<option>-osuf</option> <replaceable>suffix</replaceable> <option>-osuf</option> <replaceable>suffix</replaceable>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment