HaskellWiki

Haskell | Wiki community | Recent changes
Random page | Special pages

 

Not logged in
Log in | Help

Cabal-make

Categories: Tools | Cabal | Libraries | Packages

Contents

1 Abstract

Cabal-make is an include file for GNU make files to be used with Cabal in sharing Haskell packages. It is intended mainly for package authors. People who just build & install packages software can do so entirely with Cabal commands. In particular, it's a bit hairy to get the best results from Haddock & hscolour.

2 Features

3 Packages using cabal-make

To get a concrete sense of the first few of the features listed above, here are some links to docs for packages that use cabal-make. (Please add your own packages to this list when you use cabal-make.)

4 Example use

On my Windows system, I've placed cabal-make at c:\Haskell\cabal-make, and I like to install Haskell packages under c:\Haskell\packages. I might write a Makefile for the package TV as follows:

user = conal
configure-dirs=--prefix=c:/Haskell/packages --datadir=c:/Haskell/packages
haddock_interfaces=\
  http://haskell.org/ghc/docs/latest/html/libraries/base,c:/ghc/ghc-6.6/doc/html/libraries/base/base.haddock \
  http://haskell.org/ghc/docs/latest/html/libraries/mtl,c:/ghc/ghc-6.6/doc/html/libraries/mtl/mtl.haddock \
  http://darcs.haskell.org/packages/DeepArrow/doc/html,c:/Haskell/packages/DeepArrow-0.0.1/doc/html/DeepArrow.haddock

include c:/Haskell/cabal-make/cabal-make.inc

I don't like wiring the interface paths (especially with version numbers) into my makefile, but I don't know how to avoid it. Suggestions, please.

To build TV, I run "make" with targets like "configure", "build", "doc", and "install". Or "all" (default) for all of these targets.

Darcs-related targets:

The target "watch-comments" sets up a subscription to the Haskell wiki talk pages that correspond to the package's modules (for the user comment links inserted in the Haddock docs.)

There are a few other targets as well. See the source.

5 Specializing

I use a trick for collecting my favorite setting to be saved across my own packages. The file is called "my-cabal-make.inc":

user = conal
cabal-make = c:/Haskell/cabal-make
configure-dirs = --prefix=c:/Haskell/packages --datadir=c:/Haskell/packages
hscolour-css = $(cabal-make)/hscolour.css

include $(cabal-make)/cabal-make.inc

Then I just have to define haddock_interfaces and include my-cabal-make. My TV Makefile is really

haddock_interfaces=\
  http://haskell.org/ghc/docs/latest/html/libraries/base,c:/ghc/ghc-6.6/doc/html/libraries/base/base.haddock \
  http://haskell.org/ghc/docs/latest/html/libraries/mtl,c:/ghc/ghc-6.6/doc/html/libraries/mtl/mtl.haddock \
  http://darcs.haskell.org/packages/DeepArrow/doc/html,c:/Haskell/packages/DeepArrow-0.0.1/doc/html/DeepArrow.haddock

include ../my-cabal-make.inc

6 Dependencies

7 Use guidelines

8 Get it

darcs get --partial http://darcs.haskell.org/cabal-make

9 Customization

There are several customization variables defined in cabal-make that can be overriden. Simply define these variables in your makefile before "cabal-make.inc". See the "Settings" section of the source.

10 To do

Retrieved from "http://haskell.org/haskellwiki/Cabal-make"

This page has been accessed 2,348 times. This page was last modified 17:42, 3 March 2007. Recent content is available under a simple permissive license.