-
Notifications
You must be signed in to change notification settings - Fork 375
/
config.mk
65 lines (53 loc) · 1.47 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
##### Options which a user might set before building go here #####
# Where to install idris2 binaries and libraries (must be an absolute path)
PREFIX ?= $(HOME)/.idris2
# For Windows targets. Set to 1 to support Windows 7.
OLD_WIN ?= 0
##################################################################
RANLIB ?= ranlib
AR ?= ar
CFLAGS += -Wall
CPPFLAGS := $(CPPFLAGS)
LDFLAGS := $(LDFLAGS)
MACHINE := $(shell $(CC) -dumpmachine)
ifneq (,$(findstring cygwin, $(MACHINE)))
OS := windows
SHLIB_SUFFIX := .dll
else ifneq (,$(findstring mingw, $(MACHINE)))
OS := windows
SHLIB_SUFFIX := .dll
else ifneq (,$(findstring windows, $(MACHINE)))
OS := windows
SHLIB_SUFFIX := .dll
else ifneq (,$(findstring darwin, $(MACHINE)))
OS := darwin
SHLIB_SUFFIX := .dylib
else ifneq (, $(findstring bsd, $(MACHINE)))
OS := bsd
SHLIB_SUFFIX := .so
else
OS := linux
SHLIB_SUFFIX := .so
endif
# Find homebrew's libgmp on ARM macs
ifneq (,$(wildcard ${HOMEBREW_PREFIX}/include/gmp.h))
CPPFLAGS += -I${HOMEBREW_PREFIX}/include
LDFLAGS += -L${HOMEBREW_PREFIX}/lib
endif
ifneq (, $(findstring freebsd, $(MACHINE)))
CFLAGS += -I$(shell /sbin/sysctl -n user.localbase)/include
LDFLAGS += -L$(shell /sbin/sysctl -n user.localbase)/lib
endif
ifneq ($(OS),windows)
CFLAGS += -fPIC
else ifneq (, $(findstring NT-6.1,$(shell uname)))
OLD_WIN = 1
endif
ifeq ($(OS),bsd)
MAKE := gmake
else
MAKE := make
endif
export OS MAKE OLD_WIN
# Add a custom.mk file to override any of the configurations
-include custom.mk