fixed case where two main modules are in the same directory
fixed case where two main modules are in the same directory


It's pretty common to have a situation where two modules with
different filenames are both named Main.  If they're in the same
directory, and we use the -odir and -hidir flags, ghc --make uses the
Main.o produced from the first build to link the 2nd!

I added a pretty tricky test case for this, after it was reported by
Ganes Sittampalam while trying to build the HaXmL executables.

I fixed it today by adding the executable name to the -odir and -hidir
paths, to make sure that they don't use the same Main.o... this is a
bit inefficient, though, because I'm pretty sure that means it will
rebuild any bits of the library it depends on for each executable.

Any objections to this?


20050107072416-6d90f-e11ab0852941590f903488c2c22775479c4b029f.gz

dcreager/cabal,dcreager/cabal