-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (39 loc) · 1.06 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
SHELL='bash'
#
# Bridges - PSC
#
# Intel Compilers are loaded by default
# You will need to specifically switch to GNU Modules
# With with `modules.sh`
#
CC = g++
MPCC = mpic++
OPENMP = -fopenmp
CFLAGS = -O3
LIBS =
TARGETS = serial pthreads openmp mpi autograder
all: $(TARGETS)
serial: serial.o common.o
$(CC) -o $@ $(LIBS) serial.o common.o
autograder: autograder.o common.o
$(CC) -o $@ $(LIBS) autograder.o common.o
pthreads: pthreads.o common.o
$(CC) -o $@ $(LIBS) -lpthread pthreads.o common.o
openmp: openmp.o common.o
$(CC) -o $@ $(LIBS) $(OPENMP) openmp.o common.o
mpi: mpi.o common.o
$(MPCC) -o $@ $(LIBS) $(MPILIBS) mpi.o common.o
autograder.o: autograder.cpp common.h
$(CC) -c $(CFLAGS) autograder.cpp
openmp.o: openmp.cpp common.h
$(CC) -c $(OPENMP) $(CFLAGS) openmp.cpp
serial.o: serial.cpp common.h
$(CC) -c $(CFLAGS) serial.cpp
pthreads.o: pthreads.cpp common.h
$(CC) -c $(CFLAGS) pthreads.cpp
mpi.o: mpi.cpp common.h
$(MPCC) -c $(CFLAGS) mpi.cpp
common.o: common.cpp common.h
$(CC) -c $(CFLAGS) common.cpp
clean:
rm -f *.o $(TARGETS) *.stdout *.txt