Cabal help please
ahey at iee.org
Thu Jun 16 13:12:07 EDT 2005
On Thursday 16 Jun 2005 4:48 pm, Isaac Jones wrote:
> "Simon Marlow" <simonmar at microsoft.com> writes:
> > On 16 June 2005 15:36, Adrian Hey wrote:
> >> Hello,
> >> I'm just getting around to tidying up the AVL library and releasing
> >> a new version and, of course thinking about Cabalising it too. But
> >> I'm finding difficult to figure out how to do this from the
> >> Cabal docs and Distribution library haddock.
> >> Anyway, what I want to do is..
> >> Run cpphs on all the sources
> >> Compile the results using -split-objs (for ghc at least).
> > Cabal doesn't support -split-objs at the moment. To do this you'll need
> > to write your own Makefile and hook it up to Cabal (possible, but a bit
> > fiddly I believe).
> Can someone outline what cabal needs to do to support this?
I can't answer your question, but I can say using split objs is a
bit weird if you're not familiar with how ghc does it (dunno
if you are or not). The split objects don't seem to go in the
same directory as the main object (in this case a dummy object)
would go (according to hierarchical name). Instead they seem to
get placed in the root object directory $(OBJDIR).
The relevant sections from my makefile are..
# ghc options
GHCOPTS = -Wall -O -split-objs -no-recomp -package DataCOrdering -package-name
$(LIBNAME) -i$(PKGDIR) -hidir $(PKGDIR) -odir $(OBJDIR)
#How to build (real & dummy) %.o files
@echo Compiling: $<
@rm -f $(OBJDIR)/$(*F)__*.o #Delete the old split objects
@ghc -c $(GHCOPTS) $< > $(OBJTO)/$*.core #Create the new split objects
@touch $@ #Create/Update the dummy object
@touch $(PKGDIR)/$(SRCDIR)/$*.hi #Update the corresponding .hi
#Static Library depends on TARGETS
rm -f $@
ar q $@ $(OBJDIR)/*__*.o
Dunno if that's any help. Simon M would probably give a better answer.
More information about the Libraries