Reorganise optimisation options for C

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).
This commit is contained in:
Edwin Brady 2020-05-16 18:08:00 +01:00
parent 6ef86bc5d6
commit c7f893f6aa
3 changed files with 3 additions and 3 deletions

View File

@ -6,7 +6,7 @@ PREFIX ?= $(HOME)/.idris2
OPT =
# clang compiles the output much faster than gcc!
CC ?= clang
CC := clang
##################################################################

2
dist/config.mk vendored
View File

@ -1,6 +1,6 @@
include $(IDRIS2_CURDIR)/config.mk
CFLAGS += -O2 -std=c99 -pipe -fdata-sections -ffunction-sections -D_POSIX_C_SOURCE=200809L
CFLAGS += $(OPT) -std=c99 -pipe -fdata-sections -ffunction-sections -D_POSIX_C_SOURCE=200809L
ifeq ($(OS),bsd)
GMP_INCLUDE_DIR = -I/usr/local/include

2
dist/rts/Makefile vendored
View File

@ -7,7 +7,7 @@ HDRS =idris_rts.h idris_heap.h idris_gc.h idris_gmp.h idris_bitstring.h \
idris_opts.h idris_stats.h idris_stdfgn.h idris_net.h \
idris_buffer.h idris_utf8.h getline.h
CFLAGS += $(GMP_INCLUDE_DIR) -DIDRIS_TARGET_OS="\"$(OS)\""
CFLAGS += -O2 $(GMP_INCLUDE_DIR) -DIDRIS_TARGET_OS="\"$(OS)\""
CFLAGS += -DIDRIS_TARGET_TRIPLE="\"$(MACHINE)\""
ifeq ($(OS), windows)