[project @ 2001-08-07 10:46:57 by simonmar]
[ghc-hetmet.git] / ghc / docs / users_guide / separate_compilation.sgml
index 1433a3e..caa2382 100644 (file)
          <term><option>-i&lt;dirs&gt;</option></term>
          <listitem>
            <para><indexterm><primary><option>-i&lt;dirs&gt;</option>
-            </primary></indexterm>This flag prepends a colon-separated
+            </primary></indexterm>This flag appends a colon-separated
             list of <filename>dirs</filename> to the &ldquo;import
-            directories&rdquo; list.  See also <XRef LinkEnd="recomp">
-            for the significance of using relative and absolute
-            pathnames in the <option>-i</option> list.</para>
+            directories&rdquo; list, which initially contains a single
+            entry: <quote>.</quote>.</para>
+
+           <para>This list is scanned before any package directories
+            (see <xref linkend="packages">) when looking for imports,
+            but note that if you have a home module with the same name
+            as a package module then this is likely to cause trouble
+            in other ways, with link errors being the least nasty
+            thing that can go wrong...</para>
+
+           <para>See also <XRef LinkEnd="recomp"> for the
+            significance of using relative and absolute pathnames in
+            the <option>-i</option> list.</para>
          </listitem>
        </varlistentry>
 
 
       <variablelist>
        <varlistentry>
-         <term><option>-ohi</option>  <replaceable>file</replaceable></term>
-         <indexterm><primary><option>-ohi</option></primary>
-         </indexterm>
-         <listitem>
-           <para>The interface output may be directed to another file
-            <filename>bar2/Wurble.iface</filename> with the option
-            <option>-ohi bar2/Wurble.iface</option> (not recommended).
-            To avoid generating an interface at all, you can say
-            <literal>-ohi /dev/null</literal>, for example.</para>
-         </listitem>
-       </varlistentry>
-
-       <varlistentry>
          <term><option>-ddump-hi</option></term>
          <indexterm><primary><option>-ddump-hi</option></primary>
          </indexterm>
@@ -367,6 +364,14 @@ A.o : B.hi-boot
         <filename>makefile</filename>, then the old dependencies are
         deleted first.</para>
 
+       <para>Don't forget to use the same <option>-package</option>
+       options on the <literal>ghc -M</literal> command line as you
+       would when compiling; this enables the dependency generator to
+       locate any imported modules that come from packages.  The
+       package modules won't be included in the dependencies
+       generated, though (but see the
+       <option>--include-prelude</option> option below).</para>
+
        <para>The dependency generation phase of GHC can take some
         additional options, which you may find useful.  For historical
         reasons, each option passed to the dependency generator from
@@ -477,13 +482,11 @@ ghc -M -optdep-f -optdep.depend ...
          <varlistentry>
            <term><option>--include-prelude</option></term>
            <listitem>
-             <para>Regard prelude libraries as unstable, i.e.,
-              generate dependencies on the prelude modules used
-              (including <literal>Prelude</literal>).  This option is
-              normally only used by the various system libraries. If a
-              <option>-package</option> option is used, dependencies
-              will also be generated on the library's
-              interfaces.</para>
+             <para>Regard modules imported from packages as unstable,
+              i.e., generate dependencies on the package modules used
+              (including <literal>Prelude</literal>, and all other
+              standard Haskell libraries).  This option is normally
+              only used by the various system libraries.</para>
            </listitem>
          </varlistentry>
        </variablelist>