CC=gcc CFLAGS=-O2 LDFLAGS=-lm -lgmp -lz HAVE_CC=$(shell $(CC) --version ; echo \$?) IS_CC_GCC=$(shell $(CC) --version | grep -Eic 'gcc' || echo "NUL") IS_CC_CLANG=$(shell $(CC) --version | grep -Eic '(llvm|clang)' || echo "NUL") IS_CC_ICC=$(shell $(CC) --version | grep -Eic 'Intel' || echo "NUL") ifneq ($(IS_CC_GCC),"NUL") # compiler is GCC CFLAGS+=-fopenmp else ifneq ($(IS_CC_CGLANG), "NUL") # compiler is CLANG LDFLAGS+=-lomp else ifneq ($(IS_CC_ICC), "NUL") # compiler is Intel icc CFLAGS+=-qopenmp endif endif endif all: reducibility_complexity clean: rm -f reducibility_complexity reducibility: reducibility_complexity.c $(CC) $(CFLAGS) $(LDFLAGS) reducibility_complexity.c -o reducibility_complexity