diff --git a/openmp-threading/Makefile b/openmp-threading/Makefile index bc1fb66..85f06d7 100644 --- a/openmp-threading/Makefile +++ b/openmp-threading/Makefile @@ -2,11 +2,9 @@ # User Options #=============================================================================== -# Compiler options are "gnu", "llvm", and "intel". -# This can be set below, or with the "COMPILER" environment variable. -# Default is gnu. -ifeq ($(COMPILER),) -COMPILER = gnu +# Compiler can be set below, or via environment variable +ifeq ($(CC),) +CC = gcc endif OPTIMIZE = yes DEBUG = no @@ -32,24 +30,26 @@ obj = $(source:.c=.o) # Sets Flags #=============================================================================== +# Make sure we didn't pick up lower case cc +ifeq (cc,$(CC)) +CC = gcc +endif + # Standard Flags CFLAGS := -std=gnu99 -Wall # gcc Compiler -ifeq ($(COMPILER),gnu) - CC = gcc +ifneq (,$(findstring gcc,$(CC))) CFLAGS += -fopenmp -flto endif # LLVM Compiler -ifeq ($(COMPILER),llvm) - CC = clang +ifneq (,$(findstring clang,$(CC))) CFLAGS += -fopenmp -flto endif -# intel compiler -ifeq ($(COMPILER),intel) - CC = icc +# Intel Compiler +ifneq (,$(findstring intel,$(CC))) CFLAGS += -qopenmp -ipo endif