2017-01-30 19:28:01 +03:00
|
|
|
UNAME_INFO := $(shell uname -a)
|
|
|
|
|
|
|
|
ifeq ($(filter , $(findstring MSYS, $(UNAME_INFO)) $(findstring MINGW, $(UNAME_INFO))),)
|
2016-03-08 09:51:44 +03:00
|
|
|
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
|
|
|
|
|
2015-05-21 18:46:56 +03:00
|
|
|
RANLIB ?=ranlib
|
|
|
|
|
2012-10-29 22:56:53 +04:00
|
|
|
CABAL :=cabal
|
2014-07-17 00:22:48 +04:00
|
|
|
# IDRIS_ENABLE_STATS should not be set in final release
|
2014-09-26 19:47:44 +04:00
|
|
|
# Any flags defined here which alter the RTS API must also be added to src/IRTS/CodegenC.hs
|
2018-05-02 00:17:54 +03:00
|
|
|
CFLAGS :=-O2 -Wall -std=c99 -pipe -fdata-sections -ffunction-sections -D_POSIX_C_SOURCE=200809L -DHAS_PTHREAD -DIDRIS_ENABLE_STATS $(CFLAGS)
|
2014-07-17 00:22:48 +04:00
|
|
|
|
2016-07-27 15:46:10 +03:00
|
|
|
# CABALFLAGS :=
|
|
|
|
CABALFLAGS += --enable-tests
|
2013-03-23 03:56:54 +04:00
|
|
|
## Disable building of Effects
|
2016-07-27 15:46:10 +03:00
|
|
|
#CABALFLAGS :=-f NoEffects $(CABALFLAGS)
|
|
|
|
|
2013-03-23 03:56:54 +04:00
|
|
|
|
2013-11-19 16:03:39 +04:00
|
|
|
ifneq (, $(findstring bsd, $(MACHINE)))
|
|
|
|
GMP_INCLUDE_DIR :=
|
|
|
|
else
|
|
|
|
GMP_INCLUDE_DIR :=-I/usr/local/include
|
|
|
|
endif
|
2013-04-04 15:53:32 +04:00
|
|
|
|
|
|
|
MACHINE := $(shell $(CC) -dumpmachine)
|
|
|
|
ifneq (, $(findstring darwin, $(MACHINE)))
|
|
|
|
OS :=darwin
|
2016-01-10 05:16:30 +03:00
|
|
|
else ifneq (, $(findstring cygwin, $(MACHINE)))
|
2013-04-04 15:53:32 +04:00
|
|
|
OS :=windows
|
2016-01-10 05:16:30 +03:00
|
|
|
else ifneq (, $(findstring mingw, $(MACHINE)))
|
2013-04-04 15:53:32 +04:00
|
|
|
OS :=windows
|
2016-01-10 05:16:30 +03:00
|
|
|
else ifneq (, $(findstring windows, $(MACHINE)))
|
2015-09-21 05:23:29 +03:00
|
|
|
OS :=windows
|
2013-04-04 15:53:32 +04:00
|
|
|
else
|
|
|
|
OS :=unix
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(OS),darwin)
|
|
|
|
SHLIB_SUFFIX :=.dylib
|
2016-01-10 05:16:30 +03:00
|
|
|
else ifeq ($(OS),windows)
|
2013-04-04 15:53:32 +04:00
|
|
|
SHLIB_SUFFIX :=.DLL
|
|
|
|
else
|
|
|
|
SHLIB_SUFFIX :=.so
|
|
|
|
endif
|