-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
58 lines (54 loc) · 1.22 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# GNU Make v3.81 supports else ifeq, v3.80 not !
#
# Intel AVX Optimization (has little influence) and OpenMP
ifeq ($(OLEVEL),DEBUG)
OPT:=
else
OPT:=-O$(OLEVEL)
endif
ifeq ($(CC),gcc)
OPENMP=-fopenmp
ifeq ($(OOPTIONS),AVX)
OPT:=$(OPT) -march=corei7-avx -mtune=corei7-avx
endif
endif
ifeq ($(CC),g++)
OPENMP=-fopenmp
ifeq ($(OOPTIONS),AVX)
OPT:=$(OPT) -march=corei7-avx -mtune=corei7-avx
endif
endif
ifeq ($(CC),icc)
OPENMP=-openmp
ifeq ($(OOPTIONS),-xP)
OPT:=$(OPT) -xP
endif
endif
ifeq ($(CC),icpc)
OPENMP=-openmp
ifeq ($(OOPTIONS),-xP)
OPT:=$(OPT) -xP
endif
endif
# compiler flags for Includes, Warnings, Definitons, Debug, etc: -I, -W, -D
CFLAGS:=-I/usr/local/include/gsl -Wall -Wno-maybe-uninitialized $(OPENMP) -DARMADILLO=$(ARMADILLO)
ifeq ($(OLEVEL),DEBUG)
CFLAGS:=-g3 $(CFLAGS)
endif
# Math, GSL and Armadillo libraries, Linker
LFLAGS:=-lm -lgsl -lgslcblas
ifeq ($(ARMADILLO),1)
LFLAGS:=$(LFLAGS) -larmadillo
endif
LFLAGS:=$(LFLAGS) -lc
all: XNDiff
XNDiff: XNDiff.o mtrand.o
# @echo $(CFLAGS)
# @echo $(LFLAGS)
$(CC) $(OPT) $(CFLAGS) -o XNDiff XNDiff.o mtrand.o $(LFLAGS)
mtrand.o: mtrand.cpp
$(CC) $(OPT) $(CFLAGS) -c mtrand.cpp
XNDiff.o: XNDiff.cpp
$(CC) $(OPT) $(CFLAGS) -c XNDiff.cpp
clean:
rm -f *.o XNDiff