Created
April 2, 2017 02:48
-
-
Save aymanosman/5827b842244ac07904c6884522f5a63a to your computer and use it in GitHub Desktop.
Haskell Makefile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HC = ghc | |
HC_OPTS = -cpp $(EXTRA_HC_OPTS) | |
SRCS = Main.lhs Foo.lhs Bar.lhs | |
OBJS = Main.o Foo.o Bar.o | |
.SUFFIXES : .o .hs .hi .lhs .hc .s | |
cool_pgm : $(OBJS) | |
rm -f $@ | |
$(HC) -o $@ $(HC_OPTS) $(OBJS) | |
# Standard suffix rules | |
.o.hi: | |
@: | |
.lhs.o: | |
$(HC) -c $< $(HC_OPTS) | |
.hs.o: | |
$(HC) -c $< $(HC_OPTS) | |
.o-boot.hi-boot: | |
@: | |
.lhs-boot.o-boot: | |
$(HC) -c $< $(HC_OPTS) | |
.hs-boot.o-boot: | |
$(HC) -c $< $(HC_OPTS) | |
# Inter-module dependencies | |
Foo.o Foo.hc Foo.s : Baz.hi # Foo imports Baz | |
Main.o Main.hc Main.s : Foo.hi Baz.hi # Main imports Foo and Baz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment