> A small archive is enclosed here that shows both remaining strange
> effects:
> uudecode, unzip --> several files, read readme.txt to install.
>
>
> 1.
> Makefile changes to
> ...
> obj:
> ghc -odir $(e) -hidir $(e) -package-name docon --make A
>
> docon: obj
> rm -f $(e)/libHSdocon.a $(e)/HSdocon.o
> ar -qc $(e)/libHSdocon.a $(wildcard $(e)/*.o)
> $(RANLIB) $(e)/libHSdocon.a
> ld -r -x --whole-archive $(e)/libHSdocon.a -o $(e)/HSdocon.o
>
> And it works this way: make init; make obj; make docon
>
> `obj' looks unnecessary here.
> But if we bring the command ghc -odir ... --make A
>
> inside the docon target, then `make docon' does not notice the
> appearing file $(e)/A.o and expands $(wildcard $(e)/*.o) to
> emptyness. I do not understand, why.
I would do it like this instead:
SRCS = $(wildcard *.hs)
OBJS = $(patsubst %.hs, $(e)/%.o, $(SRCS))
I think having a separate obj target is fine.
> 2.
> All right, let us, so far, `make' a thing with make init
> make obj
> make docon
> Then, we have $root/A.hs Makefile readme.txt
> /d/B.hs
> /export/A.o A.hi HSDocon.o libHSDocon.a,
>
> module A exports a = True,
> module B imports A and exports b = a,
> A.o is in package, B is not.
>
> cd $root
> ghci -package docon
> ...
> Loading package docon ... linking ... done.
> Prelude> A.a
> True -- hence, A is visible
> Prelude> :m A
> `A' is not currently loaded -- BUG ?
This is the same problem as before with 'Foo'. 'A' is a module in
package docon, and it is also a module in the home package. You need to
keep a clean separation between package modules and home modules - in
general it is best not to run GHCi in the directory in which the source
for a package resides, if that package is also loaded into GHCi.
I'll see if I can make GHCi produce a warning in this case.
Cheers,
Simon
_______________________________________________
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs