X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=docs%2Fusers_guide%2Fseparate_compilation.xml;h=9ce971d511ca5c9c4c3ade957f3a58ddefac950a;hb=a0f6d307b097bd788e181434a4d9b7fdd56a6c6b;hp=bc3afcab6342807034f052804756e9287cb39ea5;hpb=e42d6cb48df657053029aff833de1151cf7349bf;p=ghc-hetmet.git
diff --git a/docs/users_guide/separate_compilation.xml b/docs/users_guide/separate_compilation.xml
index bc3afca..9ce971d 100644
--- a/docs/users_guide/separate_compilation.xml
+++ b/docs/users_guide/separate_compilation.xml
@@ -299,7 +299,7 @@
dir. For example:
-$ ghc -c parse/Foo.hs parse/Bar.hs gurgle/Bumble.hs -odir `arch`
+$ ghc -c parse/Foo.hs parse/Bar.hs gurgle/Bumble.hs -odir `uname -m`
The object files, Foo.o,
@@ -374,6 +374,20 @@ $ ghc -c parse/Foo.hs parse/Bar.hs gurgle/Bumble.hs -odir `arch`
+
+
+ dir
+
+
+
+ The option is shorthand for
+ the combination
+ of , ,
+ and .
+
+
+
+
suffix
@@ -426,6 +440,8 @@ $ ghc -c parse/Foo.hs parse/Bar.hs gurgle/Bumble.hs -odir `arch`
.hc files, saving
+ .ll files, saving
+ .s files, saving
@@ -453,6 +469,23 @@ $ ghc -c parse/Foo.hs parse/Bar.hs gurgle/Bumble.hs -odir `arch`
+ ,
+
+
+
+
+
+ Keep intermediate .ll files when
+ doing .hs-to-.o
+ compilations via LLVM (NOTE: .ll files
+ aren't generated when using the native code generator, you
+ may need to use to force them
+ to be produced).
+
+
+
+
+
,
@@ -565,9 +598,9 @@ $ ghc -c parse/Foo.hs parse/Bar.hs gurgle/Bumble.hs -odir `arch`
the same as the old one; this is friendly to
make. When an interface does change,
it is often enlightening to be informed. The
- option will make GHC run
- diff on the old and new
- .hi files.
+ option will make GHC
+ report the differences between the old and
+ new .hi files.
@@ -647,24 +680,24 @@ $ ghc -c parse/Foo.hs parse/Bar.hs gurgle/Bumble.hs -odir `arch`
B, say) may conceivably not change
B.hi one jot. So now…
- GHC keeps a version number on each interface file, and on
- each type signature within the interface file. It also keeps in
- every interface file a list of the version numbers of everything
- it used when it last compiled the file. If the source file's
- modification date is earlier than the .o
- file's date (i.e. the source hasn't changed since the file was
- last compiled), and the recompilation checking is on, GHC will be
- clever. It compares the version numbers on the things it needs
- this time with the version numbers on the things it needed last
- time (gleaned from the interface file of the module being
- compiled); if they are all the same it stops compiling rather
- early in the process saying “Compilation IS NOT
- required”. What a beautiful sight!
-
- Patrick Sansom had a workshop paper about how all this is
- done (though the details have changed quite a bit). Ask him if you want a
- copy.
+ GHC calculates a fingerprint (in fact an MD5 hash) of each
+ interface file, and of each declaration within the interface
+ file. It also keeps in every interface file a list of the
+ fingerprints of everything it used when it last compiled the
+ file. If the source file's modification date is earlier than
+ the .o file's date (i.e. the source hasn't
+ changed since the file was last compiled), and the recompilation
+ checking is on, GHC will be clever. It compares the fingerprints
+ on the things it needs this time with the fingerprints
+ on the things it needed last time (gleaned from the
+ interface file of the module being compiled); if they are all
+ the same it stops compiling early in the process saying
+ “Compilation IS NOT required”. What a beautiful
+ sight!
+
+ You can read
+ about how
+ all this works in the GHC commentary.
@@ -1011,15 +1044,7 @@ M.o : X.hi-boot
option below).
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
- the GHC command line must be preceded by
- -optdep. For example, to pass -f
- .depend to the dependency generator, you say
-
-
-ghc -M -optdep-f -optdep.depend ...
-
+ additional options, which you may find useful.
The options which affect dependency generation are:
@@ -1028,15 +1053,7 @@ ghc -M -optdep-f -optdep.depend ...
Display a list of the cycles in the module graph. This is
- useful when trying to eliminate such cycles. You do not need the -optdep prefix
- for this flag.
-
-
-
-
-
-
- Turn off warnings about interface file shadowing.
+ useful when trying to eliminate such cycles.
@@ -1052,14 +1069,14 @@ ghc -M -optdep-f -optdep.depend ...
- file
+ fileUse file as the makefile,
rather than makefile or
Makefile. If
file doesn't exist,
mkdependHS creates it. We often use
- to put the dependencies in
+ to put the dependencies in
.depend and then
include the file
.depend into
@@ -1067,21 +1084,8 @@ ghc -M -optdep-f -optdep.depend ...
-
-
-
+ Make extra dependencies that declare that files
with suffix
@@ -1090,13 +1094,14 @@ ghc -M -optdep-f -optdep.depend ...
.<suf>_hi, or (for
{-# SOURCE #-}
imports) on .hi-boot. Multiple
- flags are permitted. For example,
- will make dependencies
- for .hc on
+ flags are permitted. For example,
+
+ will make dependencies
+ for .hs on
.hi,
- .a_hc on
+ .a_hs on
.a_hi, and
- .b_hc on
+ .b_hs on
.b_hi. (Useful in
conjunction with NoFib "ways".)
@@ -1112,35 +1117,6 @@ ghc -M -optdep-f -optdep.depend ...
-
-
- same as
-
-
-
-
-
- Regard modules imported from packages as unstable,
@@ -1247,7 +1223,13 @@ These considerations lead to the following definition of an orphan module:
-GHC will warn you if you are creating an orphan module, if you add `-fwarn-orphan-modules`.
+If you use the flag , GHC will warn you
+if you are creating an orphan module.
+Like any warning, you can switch the warning off with ,
+and
+will make the compilation fail if the warning is issued.
+
+
You can identify an orphan module by looking in its interface
file, M.hi, using the
mode. If there is a [orphan module] on the
@@ -1259,7 +1241,6 @@ first line, GHC considers it an orphan module.