[GHC] #843: Dependency information for the linking step
Volker Wysk
pf1 at volker-wysk.de
Mon Aug 7 12:47:15 EDT 2006
On Monday 07 August 2006 15:06, GHC wrote:
> #843: Dependency information for the linking step
> ------------------------------------+--------------------------------------
>- Reporter: pf1 at volker-wysk.de | Owner:
> Type: feature request | Status: new
> Priority: normal | Milestone:
> Component: Compiler | Version: 6.4.1
> Severity: normal | Resolution:
> Keywords: dependency generation | Os: Linux
> Difficulty: Easy (1 hr) | Architecture: Unknown
> ------------------------------------+--------------------------------------
>- Comment (by simonmar):
>
> Did you know that you don't have to give the names of all the modules in
> the program to ghc -M? The -M option behaves just like {{{--make}}}, that
> is it traverses the dependency graph.
>
> Does this solve the problem for you?
No, it doesn't. It reports the immediate dependencies for each module, but not
the dependencies of the binary program, which is made in the linking step
from all modules, which are directly or _indirectly_ imported by the Main
module.
For myself, I've already solved the problem, by writing a little program,
which reads the dependencies generated by "ghc -M" and forms the transitive
hull of all the modules imported by the Main module. That's what "ghc --make"
must be doing internally before calling the linker.
Note that the generated dependency information is needed only for ensuring the
up-to-date-ness of all modules, even .chs ones. You could let "ghc --make"
collect the right object files for linking, but it doesn't know about c2hs.
Regards,
V.W.
--
public key fingerprint: 6A10 66F1 40A2 C441 BB55 0AA8 FAB1 4FC1 08BE 24EF
More information about the Glasgow-haskell-bugs
mailing list