[Haskell-cafe] Makefile for a Haskell Project

Scott Lawrence bytbox at gmail.com
Fri Dec 28 07:27:22 CET 2012


On Fri, 28 Dec 2012, xuan bach wrote:

> Hi Scott,
>
> Thanks for your kind comment.
>
> By the way, is it possible to use ghc --make for my
> project including some external libraries and tools
> such as happy, Parsec and haskell stub calling C
> library?

I'm not sure about happy and foreign interfaces - as long as parsec is 
installed (via cabal or your distribution's packages), GHC will use it 
correctly.

> I also tried out cabal to build my project but it seems
> quite complicated to use.

It's worth it if you want a more elaborate build process than ghc itself can 
accomodate, or if you intend to distribute your software on hackage. Running 
"cabal init" will guide you through creating a stub cabal file, so it's not 
too bad.

>
> Best Regards.
>
> On Fri, Dec 28, 2012 at 2:08 PM, Scott Lawrence <bytbox at gmail.com> wrote:
>
>> On Fri, 28 Dec 2012, xuan bach wrote:
>>
>>  Hi everyone,
>>> I'm a newbie in Haskell.
>>>
>>> I'm wondering that if there is any tool support
>>> creating Makefile for Haskell project like Ocamlbuild
>>> for Ocaml project?
>>>
>>
>> Since ghc handles dependencies automatically, I usually just do,
>>
>>         all:
>>                 ghc --make myprog
>>
>> And then make sure `myprog.hs` is your Main module.
>>
>>
>>> Thank you,
>>> Regards.
>>>
>>> --
>>> *Le Dinh Xuan Bach*
>>> *Tel: 01234711869 or +65 86967149
>>> *
>>> *Email: pig28789 at gmail.com
>>>
>>> School of Information and Communication,
>>> *
>>> *Hanoi University of Science and Technology
>>>
>>> ------------------------------**------------------------------**---------
>>> レ。ディン。スアン。バイック
>>> 電話番号:01234711869 or +65 86967149
>>> メール:      pig28789 at gmail.com
>>> *
>>>
>>>
>> --
>> Scott Lawrence
>
>
>
>
> -- 
> *Le Dinh Xuan Bach*
> *Tel: 01234711869 or +65 86967149
> *
> *Email: pig28789 at gmail.com
> School of Information and Communication,
> *
> *Hanoi University of Science and Technology
> ---------------------------------------------------------------------
> レ。ディン。スアン。バイック
> 電話番号:01234711869 or +65 86967149
> メール:      pig28789 at gmail.com
> *
>

-- 
Scott Lawrence


More information about the Haskell-Cafe mailing list