-
Notifications
You must be signed in to change notification settings - Fork 1
/
makefile
75 lines (48 loc) · 1.46 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
ifndef OCCA_DIR
ERROR:
@echo "Error, environment variable [OCCA_DIR] is not set"
endif
include ${OCCA_DIR}/scripts/Makefile
# define variables
HDRDIR =
# set options for this machine
# specify which compilers to use for c, fortran and linking
cc = gcc
FC = g77
#-std=legacy -fdefault-real-8 -fdefault-double-8
CC = g++
LD = g++
NVCC = nvcc
# compilerFlags +=
nvccFlags = -I./ -g
# s-I$(ALMONDDIR)
# compiler flags to be used (set to compile with debugging on)
CFLAGS = -I. $(compilerFlags) $(flags) -I$(HDRDIR) -I$(OGSDIR) -D DFUN='"${CURDIR}"' $(LIBP_OPT_FLAGS)
# link flags to be used
LDFLAGS = $(compilerFlags) $(LIBP_OPT_FLAGS)
# libraries to be linked in
LIBS = -L$(OCCA_DIR)/lib -locca $(linkerFlags)
#-L$(PARMETISDIR) -lparmetis -L$(METISDIR) -lmetis -L$(ALMONDDIR) -lparAlmond
INCLUDES =
DEPS = $(INCLUDES)
# types of files we are going to construct rules for
.SUFFIXES: .c .f .cu .cpp
# rule for .c files
.c.o: $(DEPS)
$(CC) $(CFLAGS) -o $*.o -c $*.c $(paths)
.cpp.o: $(DEPS)
$(CC) $(CFLAGS) -o $*.o -c $*.cpp $(paths)
.cu.o: $(DEPS)
$(NVCC) $(nvccFlags) -o $*.o -c $*.cu $(paths)
.f.o: $(DEPS)
$(FC) $(CFLAGS) -o $*.o -c $*.f $(paths)
# library objects
LOBJS =
main: $(LOBJS) ./src/main.o
$(LD) $(LDFLAGS) -o main ./src/main.o $(LOBJS) $(paths) $(LIBS)
main_omp: $(LOBJS) ./src/main_omp.o
$(LD) $(LDFLAGS) -o main_omp ./src/main_omp.o $(LOBJS) $(paths) $(LIBS)
all: main
# what to do if user types "make clean"
clean:
rm src/*.o main