mirror of
https://github.com/edwinb/Idris2-boot.git
synced 2024-11-23 20:22:34 +03:00
c7f893f6aa
It should be -O2 for the rts, but -O2 takes ages for idris2.c so should be saved for releases (also OPT should be able to be edited easily for e.g. adding profiling) Also default to clang (perhaps it would be better if we could check whether clang was available first, but it does a better job as the default overall).
48 lines
1000 B
Makefile
48 lines
1000 B
Makefile
##### Options which a user might set before building go here #####
|
|
|
|
PREFIX ?= $(HOME)/.idris2
|
|
|
|
# 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
|