on master help sign in
Idris-dev/config.mk
50 lines 1.4 kB history raw
1UNAME_INFO := $(shell uname -a)
3ifeq ($(filter , $(findstring MSYS, $(UNAME_INFO)) $(findstring MINGW, $(UNAME_INFO))),)
4 ifeq (cc,$(CC))
5 # In MSYS2, when using the mingw version of gcc, there is no cc -> gcc
6 # symlink. We can't use ?= here because CC is set implicitly to cc.
7 # Cross compiling users can set CC to their cross compiler.
8 CC =gcc
9 endif
10endif
12RANLIB ?=ranlib
14CABAL :=cabal
15# IDRIS_ENABLE_STATS should not be set in final release
16# Any flags defined here which alter the RTS API must also be added to src/IRTS/CodegenC.hs
17CFLAGS :=-O2 -Wall -std=c99 -pipe -fdata-sections -ffunction-sections -D_POSIX_C_SOURCE=200809L -DHAS_PTHREAD -DIDRIS_ENABLE_STATS $(CFLAGS)
19# CABALFLAGS :=
20CABALFLAGS += --enable-tests
21## Disable building of Effects
22#CABALFLAGS :=-f NoEffects $(CABALFLAGS)
25ifneq (, $(findstring bsd, $(MACHINE)))
26 GMP_INCLUDE_DIR :=
27else
28 GMP_INCLUDE_DIR :=-I/usr/local/include
29endif
31MACHINE := $(shell $(CC) -dumpmachine)
32ifneq (, $(findstring darwin, $(MACHINE)))
33 OS :=darwin
34else ifneq (, $(findstring cygwin, $(MACHINE)))
35 OS :=windows
36else ifneq (, $(findstring mingw, $(MACHINE)))
37 OS :=windows
38else ifneq (, $(findstring windows, $(MACHINE)))
39 OS :=windows
40else
41 OS :=unix
42endif
44ifeq ($(OS),darwin)
45 SHLIB_SUFFIX :=.dylib
46else ifeq ($(OS),windows)
47 SHLIB_SUFFIX :=.DLL
48else
49 SHLIB_SUFFIX :=.so
50endif