-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.mk
48 lines (41 loc) · 1.25 KB
/
config.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
ifneq (, $(findstring MSYS, $(shell uname -a)))
ifeq (cc,$(CC))
# In MSYS2, when using the mingw version of gcc, there is no cc -> gcc
# symlink. We can't use ?= here because CC is set implicitly to cc.
# Cross compiling users can set CC to their cross compiler.
CC =gcc
endif
endif
RANLIB ?=ranlib
CABAL :=cabal
# IDRIS_ENABLE_STATS should not be set in final release
# Any flags defined here which alter the RTS API must also be added to src/IRTS/CodegenC.hs
CFLAGS :=-O2 -Wall -DHAS_PTHREAD -DIDRIS_ENABLE_STATS $(CFLAGS)
# CABALFLAGS :=
CABALFLAGS += --enable-tests
## Disable building of Effects
#CABALFLAGS :=-f NoEffects $(CABALFLAGS)
ifneq (, $(findstring bsd, $(MACHINE)))
GMP_INCLUDE_DIR :=
else
GMP_INCLUDE_DIR :=-I/usr/local/include
endif
MACHINE := $(shell $(CC) -dumpmachine)
ifneq (, $(findstring darwin, $(MACHINE)))
OS :=darwin
else ifneq (, $(findstring cygwin, $(MACHINE)))
OS :=windows
else ifneq (, $(findstring mingw, $(MACHINE)))
OS :=windows
else ifneq (, $(findstring windows, $(MACHINE)))
OS :=windows
else
OS :=unix
endif
ifeq ($(OS),darwin)
SHLIB_SUFFIX :=.dylib
else ifeq ($(OS),windows)
SHLIB_SUFFIX :=.DLL
else
SHLIB_SUFFIX :=.so
endif