use ghc-6.5 patch with ghc-6.6
[sbp.git] / Makefile.haskell
1 ghc_version = $(shell ghc --version | sed 's_.*version \([0-9]*\.[0-9]*\).*_\1_')
2
3 ifeq ($(ghc_version),6.5)
4 patchghc    = patch -p0 < $(shell pwd)/misc/ghc-6.5-patch &&
5 else
6 ifeq ($(ghc_version),6.6)
7 patchghc    = patch -p0 < $(shell pwd)/misc/ghc-6.5-patch &&
8 else
9 patchghc    =
10 endif
11 endif
12
13 ifeq ($(shell uname),Darwin)
14 with_jvmdir = --with-jvmdir=/System/Library/Frameworks/JavaVM.framework/
15 jvmlink     = -framework JavaVM -optl -fexceptions
16 patchmac    = patch -p0 < $(shell pwd)/misc/intel-mac-patch &&
17 linkopts    =
18 platlink    = -L$(prefix)/lib/ -L$(JAVA_HOME)/jre/lib/i386/ -L$(JAVA_HOME)/jre/lib/i386/client/
19 else
20 with_jvmdir = --with-jvmdir=$(JAVA_HOME)
21 jvmlink     = -ljava -ljvm -lverify
22 patchmac    =
23 linkopts    = -optl "-Wl,-rpath,$(JAVA_HOME)/jre/lib/i386/" -optl "-Wl,-rpath,$(JAVA_HOME)/jre/lib/i386/client/"
24 platlink    =
25 endif
26
27 prefix          = $(shell pwd)/prefix
28 jvm-bridge-site = umn.dl.sourceforge.net
29 jvm-bridge-url  = http://$(jvm-bridge-site)/sourceforge/jvm-bridge/haskell-jvm-bridge-0.3.tar.gz
30
31 #               The double -lHaskellJVMBridge is due to a circular link dep; the linux linker gets upset
32 link            = $(platlink) -lstdc++ -lHaskellJVMBridge -lJVMBridge -lJVMInvocation -lHaskellJVMBridge $(jvmlink)
33 packages        = -package haskell98 -package base -package rts
34 ghc             = ghc -fglasgow-exts $(packages) -i$(prefix)/imports/
35 bin             = $(prefix)/bin/