2020-05-18 15:59:07 +03:00
|
|
|
##### Options which a user might set before building go here #####
|
|
|
|
|
2020-05-20 15:31:04 +03:00
|
|
|
PREFIX ?= $(HOME)/.idris2
|
2020-05-18 15:59:07 +03:00
|
|
|
|
2020-05-24 22:15:24 +03:00
|
|
|
CC ?= clang
|
2020-05-18 15:59:07 +03:00
|
|
|
|
2020-06-02 05:30:44 +03:00
|
|
|
# For Windows targets. Set to 1 to support Windows 7.
|
|
|
|
OLD_WIN ?= 0
|
|
|
|
|
2020-05-18 15:59:07 +03:00
|
|
|
##################################################################
|
|
|
|
|
|
|
|
RANLIB ?= ranlib
|
|
|
|
AR ?= ar
|
|
|
|
|
2020-05-19 15:50:47 +03:00
|
|
|
CFLAGS := -Wall $(CFLAGS)
|
2020-05-18 15:59:07 +03:00
|
|
|
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
|
|
|
|
|
2020-05-23 15:25:50 +03:00
|
|
|
export OS
|
|
|
|
|
2020-05-18 15:59:07 +03:00
|
|
|
ifeq ($(OS),bsd)
|
|
|
|
MAKE := gmake
|
|
|
|
else
|
|
|
|
MAKE := make
|
|
|
|
endif
|