2020-05-18 15:59:07 +03:00
|
|
|
##### Options which a user might set before building go here #####
|
|
|
|
|
2021-06-18 13:06:45 +03:00
|
|
|
# Where to install idris2 binaries and libraries (must be an absolute path)
|
2020-05-20 15:31:04 +03:00
|
|
|
PREFIX ?= $(HOME)/.idris2
|
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
|
|
|
|
|
2024-03-21 15:32:37 +03:00
|
|
|
CFLAGS += -Wall
|
2022-09-08 03:08:54 +03:00
|
|
|
CPPFLAGS := $(CPPFLAGS)
|
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
|
|
|
|
else ifneq (, $(findstring bsd, $(MACHINE)))
|
|
|
|
OS := bsd
|
|
|
|
SHLIB_SUFFIX := .so
|
|
|
|
else
|
2020-05-28 01:58:11 +03:00
|
|
|
OS := linux
|
|
|
|
SHLIB_SUFFIX := .so
|
2021-07-21 16:35:21 +03:00
|
|
|
endif
|
|
|
|
|
2023-01-14 17:19:12 +03:00
|
|
|
ifneq (, $(findstring freebsd, $(MACHINE)))
|
|
|
|
CFLAGS += -I$(shell /sbin/sysctl -n user.localbase)/include
|
|
|
|
LDFLAGS += -L$(shell /sbin/sysctl -n user.localbase)/lib
|
|
|
|
endif
|
|
|
|
|
2021-07-21 16:35:21 +03:00
|
|
|
ifneq ($(OS),windows)
|
2020-05-28 01:58:11 +03:00
|
|
|
CFLAGS += -fPIC
|
2021-07-21 16:35:21 +03:00
|
|
|
else ifneq (, $(findstring NT-6.1,$(shell uname)))
|
|
|
|
OLD_WIN = 1
|
2020-05-18 15:59:07 +03:00
|
|
|
endif
|
2020-05-23 15:25:50 +03:00
|
|
|
|
2020-05-18 15:59:07 +03:00
|
|
|
ifeq ($(OS),bsd)
|
|
|
|
MAKE := gmake
|
|
|
|
else
|
|
|
|
MAKE := make
|
|
|
|
endif
|
2021-07-21 16:35:21 +03:00
|
|
|
|
|
|
|
export OS MAKE OLD_WIN
|
2020-06-17 15:31:17 +03:00
|
|
|
|
|
|
|
# Add a custom.mk file to override any of the configurations
|
|
|
|
-include custom.mk
|