> > >The -ohi flag lets you rename the interface file, or > -hisuf is useful > > >for renaming a whole bunch of interface files if you want to build > > >modules in two different ways in the same directory. > > > > We use -hidir/-odir to build for different platforms, so the only > > problem comes from ghc using hidir/<platform>/Main.hi for > > both pfe.hs and pfe_client.hs. Executables and sources have > > different names, why not the interface files? Will try -ohi and > > see if that helps. > > No, it doesn't (myghc--make is a slightly veiled call to ghc --make): > > cd refactorer; ./myghc--make -o pfe -ohi pfe.hi pfe.hs > 2>&1 | tee -a log.txt > c:\ghc\ghc-6.0.1\bin\ghc.exe: -ohi can only be used when > compiling a single source file > > The simplest approach would be to take the presence of -o as a > strong hint that there might be confusion about executables/Main > modules and thus to rename the Main.hi-file as well when -o is > present.
What you're really doing here is building a library that is subsequently used when building two separate executables. The right thing to do is to build the executables with the objects in different places (the interface is really part of the object code). The rules related to interface and object file naming were changed in 6.2 (cleaned up & fixed in several ways, actually). The User's Guide describes the current situation, in I hope a clear way: http://www.haskell.org/ghc/docs/latest/html/users_guide/separate-compila tion.html I'm reluctant to change these rules in anything but small ways, because doing so inevitably breaks someone else's strange build system. The problem is that there are lots of different scenarios under which the compiler has to do something reasonable and it's really hard (from experience!) to change things in a way that doesn't upset anyone. For instance, if I make -o change the location of the interface file for Main only, then don't I have to write special Makefile rules to take into account this special case or does it only apply to --make? This sounds like a rather hacky special case to me. Cheers, Simon _______________________________________________ Glasgow-haskell-bugs mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs