Date: 2017oct6
Language: Haskell
Keywords: Haskel
Q. How can I setup a Makefile for my mini Haskell programs?
A. Assuming you have a folder with hello.hs, hello_getline.hs and factorial.hs
Put this in a file called "Makfile"
# Set the names of your programs here
ALL = hello hello_getline factorial
all: $(ALL)
install: all
install $(ALL) /usr/local/bin
clean:
rm $(ALL)
% : %.hs
ghc -Wno-tabs -o $@ $<
So you can do:
make - Which builds all
make hello - Just compiles hello.hs
make clean - Which removes all programs