Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7516463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:08:21+00:00 2026-05-30T01:08:21+00:00

The Haskell wiki states that you should use Cabal as your build system. However,

  • 0

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:

GHC = ghc
GHCFLAGS = -outputdir bin
SRC = $(wildcard src/*.hs)
BIN = $(patsubst src/%.hs,%,$(SRC))

all: $(addprefix bin/, $(BIN))

bin/%: src/%.hs
    $(GHC) $(GHCFLAGS) $< -o $@

clean:
    rm bin/*
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T01:08:23+00:00Added an answer on May 30, 2026 at 1:08 am

    The easiest way to get started is to have Cabal generate a .cabal file for you that you can use as a starting point. To do this, go into your project directory and type

    $ cabal init
    

    It will then ask you a bunch of questions about your package. Some questions like author name and email only really matter if you plan on uploading your package to Hackage, so you can leave those blank if you want. After doing that, you can then edit the .cabal file to customize it. The generated file will contain a bunch of comments which should help you get started. After that, simply type

    $ cabal configure
    $ cabal build
    

    The binary will by default be placed in ./dist/build/<name>/.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I read this: http://hackage.haskell.org/trac/ghc/wiki/ViewPatterns I like the idea, want to use the extension. I
Haskell's cabal package manager stores recent package source code in ~/Library/Haskell/repo-cache/*/*.tgz I've found that
The Haskell wiki shows that you need to both set a compilation flag and
since Haskell has such expressive type system, is there something supported directly that we
I'm currently trying to build wxHaskell as described in the Haskell wiki here .
On the Haskell wiki I read that this : fib = let fib' 0
I have followed the tutorial on the Haskell wiki about i mplementing an IRC
In Haskell, is there a way to restrict a monad M a so that
In Haskell, how can I generate Fibonacci numbers based on the property that the
In Haskell, lifted type products mean that there's a semantic difference between (a,b,c) and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.