forked from edwinb/Idris2-boot
-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.mk
47 lines (39 loc) · 1004 Bytes
/
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
##### Options which a user might set before building go here #####
PREFIX ?= $(HOME)/.idris2boot
# Add any optimisation/profiling flags for C here (e.g. -O2)
OPT =
# clang compiles the output much faster than gcc!
CC := clang
##################################################################
RANLIB ?= ranlib
AR ?= ar
CFLAGS := -Wall $(CFLAGS) $(OPT)
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
CFLAGS += -fPIC
else ifneq (, $(findstring bsd, $(MACHINE)))
OS := bsd
SHLIB_SUFFIX := .so
CFLAGS += -fPIC
else
OS := linux
SHLIB_SUFFIX := .so
CFLAGS += -fPIC
endif
ifeq ($(OS),bsd)
MAKE := gmake
else
MAKE := make
endif