Cross platform makefiles for small Haskell project? -


i built small, one-file haskell utility included in 'tools' section of otherwise pure php (raised eyebrows, know) project.

initially checked in both .hs source file binary generated on linux development machine version control system use (git). think more it, i'd create cross platform makefiles go along other developers can compile on systems.

are there best practices / guidelines, or better, makefile templates available can download? nothing fancy, allows developers specify details ghc setup , run simple script started.

the recommended way of distributing haskell projects use cabal. cabal both build system , package manager haskell code, , makes easy build haskell code on different platforms while handling dependencies you.

here's example cabal file:

name:           mypackage version:        0.0 cabal-version:  >= 1.2 license:        bsd3 author:         angela author synopsis:       small package utility program build-type:     simple  executable myutility   build-depends:  base   main-is:        main.hs   hs-source-dirs: src 

you can generate cabal file interactively running

$ cabal init 

cabal ask simple questions , generate cabal file based on answers. can tweak file fit specific needs.


to install package run in package directory

$ cabal install 

you can upload package hackage, standard haskell package respository. way, people can download , install package (and dependencies) in single step command

$ cabal install mypackage 

there exist tools converting cabal packages other package managers, if don't want require users have cabal installed (although cabal included in haskell platform).

it plays haddock generating reference documentation package. check out of packages on hackage example of results.

there work being done improve support test suites in cabal.

overall, these reasons , many more make great benefit use cabal organize, build , distribute haskell projects.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -