fix: detect gcc version

This commit is contained in:
Hayden Kowalchuk 2019-12-09 12:07:49 -05:00
parent 082c381667
commit a2dcfcf997

View File

@ -14,9 +14,15 @@ OBJS += containers/stack.o containers/named_array.o containers/aligned_vector.o
SUBDIRS =
EXTRA_CFLAGS= -Wall -Wextra
KOS_CFLAGS += -ffast-math -O2 -funroll-loops -fsingle-precision-constant -Iinclude -funsafe-math-optimizations -DBUILD_LIBGL $(EXTRA_CFLAGS)
GCC5_FLAGS =
GCCVERSIONGTEQ4 := $(shell expr `sh-elf-gcc -dumpversion | cut -f1 -d.` \>= 5)
ifeq "$(GCCVERSIONGTEQ4)" "1"
GCC5_FLAGS += -mfsca -mfsrra -mlra
endif
KOS_CFLAGS += -ffast-math -O2 -funroll-loops -fsingle-precision-constant -Iinclude -funsafe-math-optimizations -funit-at-a-time -DBUILD_LIBGL $(EXTRA_CFLAGS) $(GCC5_FLAGS)
#KOS_CFLAGS += -O1 -mlra -Iinclude -DBUILD_LIBGL -Wall -Wextra
#GCC5_FLAGS = -mfsca -mfsrra -mlra
# Manipulate the CFLAGS to look our *our* version of the library and includes
INC_DIR = $(abspath ./include)
@ -24,12 +30,12 @@ LIB_DIR = $(abspath ./)
export CFLAGS := $(CFLAGS) -I $(INC_DIR)
export OBJEXTRA := $(LIB_DIR)/libGLdc.a
default: build link
default: link
link:
link: build
$(KOS_AR) rcs $(TARGET) $(OBJS)
build: $(OBJS) link
build: $(OBJS)
samples: build
$(KOS_MAKE) -C samples all