Commit dde80d73 authored by simonmar's avatar simonmar

[project @ 2005-10-28 15:51:15 by simonmar]

document -stubdir
parent f2e730f3
......@@ -107,6 +107,11 @@ extern HsInt foo(HsInt a0);</programlisting>
invoke <literal>foo()</literal> from C, just <literal>#include
"Foo_stub.h"</literal> and call <literal>foo()</literal>.</para>
<para>The <filename>foo_stub.c</filename> and
<filename>foo_stub.h</filename> files can be redirected using the
<option>-stubdir</option> option; see <xref linkend="options-output"
<sect3 id="using-own-main">
<title>Using your own <literal>main()</literal></title>
......@@ -242,6 +242,12 @@
<entry><option>-stubdir</option> <replaceable>dir</replaceable></entry>
<entry>redirect FFi stub files</entry>
......@@ -253,6 +253,23 @@
<filename>Main.hs</filename>, and put the resulting
executable in <filename>foo.exe</filename> (not
<para>If you use <command>ghc --make</command> and you don't
use the <option>-o</option>, the name GHC will choose
for the executable will be based on the name of the file
containing the module <literal>Main</literal>.
Note that with GHC the <literal>Main</literal> module doesn't
have to be put in file <filename>Main.hs</filename>.
Thus both
ghc --make Prog
ghc --make Prog.hs
will produce <filename>Prog</filename> (or
<filename>Prog.exe</filename> if you are on Windows).</para>
......@@ -324,6 +341,23 @@ $ ghc -c parse/Foo.hs parse/Bar.hs gurgle/Bumble.hs -odir `arch`
<option>-stubdir</option> <replaceable>dir</replaceable>
<para>Redirects all generated FFI stub files into
<replaceable>dir</replaceable>. Stub files are generated when the
Haskell source contains a <literal>foreign export</literal> or
<literal>foreign import "&amp;wrapper"</literal> declaration (see <xref
linkend="foreign-export-ghc" />). The <option>-stubdir</option>
option behaves in exactly the same way as <option>-odir</option>
and <option>-hidir</option> with respect to hierarchical
<option>-osuf</option> <replaceable>suffix</replaceable>
Markdown is supported
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