[Haskell-cafe] Using Cabal during development

John D. Ramsdell ramsdell0 at gmail.com
Wed Feb 10 18:07:19 EST 2010


On Tue, Feb 9, 2010 at 8:48 AM, Limestraël <limestrael at gmail.com> wrote:
> Cabal/cabal-install are good tools for distribution and installation, but I
> was wondering -- as I was starting to learn how to use Cabal -- how do
> usually Haskell developpers build their softwares

I add the enclosed Makefile to the directory that contains the .cabal
file, and then in emacs, run M-x compile.  To move to location of an
error, type C-x `.  I bind compile to M-C-y in my .emacs.el file with:

   (global-set-key "\M-\C-y" 'compile)

--------------- Makefile ----------------
# Haskell/Cabal Makefile
# Requires GNU Make
# The all target creates a default configuration if need be.

PACKAGE := $(wildcard *.cabal)
CONFIG	= dist/setup-config
SETUP	= runhaskell Setup.hs

all:	$(CONFIG)
	$(SETUP) build

Makefile:
	@echo make $@

$(PACKAGE):
	@echo make $@

$(CONFIG):	$(PACKAGE)
	$(SETUP) configure --ghc --user --prefix="${HOME}"

%:	force
	$(SETUP) $@

.PHONY:	all force


More information about the Haskell-Cafe mailing list