title: How do I configure Cabal to understand a C FFI?
body: <p>I am trying to create a Haskell library which uses a C FFI. I have 4 files:</p>
  
  <pre><code>MyLibrary.hs
  c_dependency.h
  c_dependency.c
  c_dependency.o
  test.hs
  </code></pre>
  
  <p>All on the same directory. <code>test.hs</code> loads MyLibrary and tests it:</p>
  
  <pre><code>-- test.hs
  import qualified MyLibrary as Lib
  main = Lib.test
  </code></pre>
  
  <p>I want to be able to compile <code>test.hs</code> as usual, without linking to <code>c_dependency.o</code>. That is, I want <code>ghc test.hs; ./test</code> to work. How can I init/configure cabal so it builds my library properly, taking care of linking <code>c_dependency.o</code> ?</p>