-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
56 lines (55 loc) · 2.68 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
CC=gcc
CFLAGS=-g -Wall -Wstrict-prototypes -std=gnu99 -fopenmp
LFLAGS=-lm -fopenmp
all: print-2d make-2d stencil-2d print-raw stencil-2d-stack omp-stencil-2d omp-stencil-2d-stack test-mpi-read mpi-stencil-2d mpi-stencil-2d-stack
#------------------------------------------------LINKING STEPS
print-2d: utilities.o print-2d.o
$(CC) $(LFLAGS) -o print-2d utilities.o print-2d.o
make-2d: utilities.o make-2d.o
$(CC) $(LFLAGS) -o make-2d utilities.o make-2d.o
stencil-2d: utilities.o stencil-2d.o
$(CC) $(LFLAGS) -o stencil-2d utilities.o stencil-2d.o
stencil-2d-stack: utilities.o stencil-2d-stack.o
$(CC) $(LFLAGS) -o stencil-2d-stack utilities.o stencil-2d-stack.o
print-raw: utilities.o print-raw.o
$(CC) $(LFLAGS) -o print-raw utilities.o print-raw.o
omp-stencil-2d: omp-stencil-2d.o utilities.o
$(CC) $(LFLAGS) -o omp-stencil-2d omp-stencil-2d.o utilities.o
omp-stencil-2d-stack: omp-stencil-2d-stack.o utilities.o
$(CC) $(LFLAGS) -o omp-stencil-2d-stack omp-stencil-2d-stack.o utilities.o
test-mpi-read: test-mpi-read.o MyMPI.o
mpicc -lm -o test-mpi-read test-mpi-read.o MyMPI.o
mpi-stencil-2d: mpi-stencil-2d.o MyMPI.o utilities.o
mpicc -lm -o mpi-stencil-2d mpi-stencil-2d.o MyMPI.o utilities.o
mpi-stencil-2d-stack: mpi-stencil-2d-stack.o MyMPI.o utilities.o
mpicc -lm -o mpi-stencil-2d-stack mpi-stencil-2d-stack.o MyMPI.o utilities.o
#------------------------------------------------COMPILING STEPS
utilities.o: utilities.c utilities.h
$(CC) $(CFLAGS) -c utilities.c
print-2d.o: print-2d.c utilities.h
$(CC) $(CFLAGS) -c print-2d.c
make-2d.o: make-2d.c utilities.h
$(CC) $(CFLAGS) -c make-2d.c
stencil-2d.o: stencil-2d.c utilities.h
$(CC) $(CFLAGS) -c stencil-2d.c
print-raw.o: print-raw.c utilities.h
$(CC) $(CFLAGS) -c print-raw.c
stencil-2d-stack.o: stencil-2d-stack.c utilities.h
$(CC) $(CLFLAGS) -c stencil-2d-stack.c
omp-stencil-2d.o: omp-stencil-2d.c utilities.h
$(CC) $(CFLAGS) -c omp-stencil-2d.c
omp-stencil-2d-stack.o: omp-stencil-2d-stack.c utilities.h
$(CC) $(CFLAGS) -c omp-stencil-2d-stack.c
MyMPI.o: MyMPI.c MyMPI.h
mpicc -g -Wall -Wstrict-prototypes -std=gnu99 -c MyMPI.c
test-mpi-read.o: test-mpi-read.c MyMPI.h
mpicc -g -Wall -Wstrict-prototypes -std=gnu99 -c test-mpi-read.c
mpi-stencil-2d.o: mpi-stencil-2d.c MyMPI.h
mpicc -g -Wall -Wstrict-prototypes -std=gnu99 -c mpi-stencil-2d.c
mpi-stencil-2d-stack.o: mpi-stencil-2d-stack.c MyMPI.h
mpicc -g -Wall -Wstrict-prototypes -std=gnu99 -c mpi-stencil-2d-stack.c
#-----------------------------------------------UTILITY FUNCTIONS
clean:
rm -f *.o core* print-2d make-2d stencil-2d stencil-2d-stack print-raw omp-stencil-2d omp-stencil-2d-stack test-mpi-read mpi-stencil-2d mpi-stencil-2d-stack
clean-data:
rm -f *.raw *.dat