Hi, Simon -
I've had a chance to try out your makefile patch for Cabal tonight as
part of pulling out cabal-rpm into a standalone program, and I'm finding
problems with it.
The first is with the code that attempts to use "mkdir" to create the
hierarchy of object directories. It will in several instances try to
generate a directory without first having created its parent. You can
reproduce this by trying to build Cabal in this way; it will fail
because it's trying to mkdir Language/Haskell, but does not first create
Language. I've hacked around this locally by invoking "mkdir -p"
instead, but that's not portable to old systems.
The second problem occurs immediately afterwards. If you try to build
e.g. the binary package, it will fail almost immediately, as follows:
binary-0.3 $ make
Panic! dist/build/Data/Binary/Get.o exists, but
dist/build/Data/Binary/Get.hi does not.
This error message is misleading. The dependency that make is trying to
follow is this:
dist/build/Data/Binary/Get.hi: dist/build/Data/Binary/Get.o
That triggers this portion of the Makefile:
%.$(way_)hi : %.$(way_)o
@if [ ! -f $@ ] ; then \
echo Panic! $< exists, but $@ does not.; \
exit 1; \
else exit 0 ; \
fi
In this case, neither side of the rule exists. I'm not too sure what
this is trying to do, or whether there's a step I ought to be taking
between "Setup makefile" and "make", but alas, no luck so far.
Thanks for any light you can shed.
<b