[project @ 2003-07-18 13:18:06 by simonmar]
authorsimonmar <unknown>
Fri, 18 Jul 2003 13:18:07 +0000 (13:18 +0000)
committersimonmar <unknown>
Fri, 18 Jul 2003 13:18:07 +0000 (13:18 +0000)
commit2d532e45924dfdb5b5157caf4d3fc3541497d86c
tree851ec778211ddb14e9389043396adc708497f68a
parent36265a1ac614b32f02738634f92f6ac1a8ff2d3d
[project @ 2003-07-18 13:18:06 by simonmar]
Revision to the filename policy changes of yesterday.  This fixes the
broken stage2 and library builds.

The new story is this:

  A Haskell source filename should take the form

<path>/<basename>.<extension>

  where

<path>      is any directory
<basename>  is the name of the module, with dots replaced by slashes.
<extension> is ".hs" or ".lhs".

  given a source filename in this form, GHC will produce object and
  interface files named respectively:

        <hidir>/<basename>.<hisuf>
<odir>/<basename>.<osuf>

  where

<hidir>   is the value of the -hidir flag, if one was given, or
  the value of <path> from the source file otherwise.

<odir>    the same, for the -odir flag.

        <osuf>   the object suffix (settable with the -osuf flag)
<hisuf>   the hi suffix (settable with the -hisuf flag)

For example, if I have a module A.B.C, in source file foo/A/B/C.hs,
then GHC will create foo/A/B/C.hi and foo/A/B/C.o.

If GHC is given a source filename which is *not* of the form
<path>/<basename>.<extension>, then it uses a different strategy.
This happens if the filename does not follow the module name.  In this
case, GHC will set <path> to be the directory in which the source file
resides, and <basename> to the module name with dots replaced by
slashes, and then use the rules above.

For example, if we put module A.B.C in foo/bar/baz.hs, then GHC will
produce foo/bar/A/B/C.o and foo/bar/A/B/C.hi.
ghc/compiler/compMan/CompManager.lhs
ghc/compiler/main/DriverMkDepend.hs
ghc/compiler/main/DriverPipeline.hs
ghc/compiler/main/Finder.lhs