title: How do I build a simple project with Cabal?
body: <p>The Haskell wiki states that you should use Cabal as your build system. However, it seems to me much more directed at producing packages then just building binaries. Basically, all I want to do is build every *.hs file in my src/ directory into a seperate binary in bin/. This makefile accomplishes this nicely, but I want to learn about Cabal and this seems like a good example to get me started:</p>
  
  <pre><code>GHC = ghc
  GHCFLAGS = -outputdir bin
  SRC = $(wildcard src/*.hs)
  BIN = $(patsubst src/%.hs,%,$(SRC))
  
  all: $(addprefix bin/, $(BIN))
  
  bin/%: src/%.hs
      $(GHC) $(GHCFLAGS) $&lt; -o $@
  
  clean:
      rm bin/*
  </code></pre>