-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
executable file
·44 lines (32 loc) · 941 Bytes
/
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
# Usage:
# make # compile all binary
# make clean # remove ALL binaries and objects
CC = mpicc
CFLAGS = -std=c11 -std=gnu99
INCLUDES = -I../include
LFLAGS = -L../lib
LIBS = -lm -fopenmp
SRCS = $(wildcard *.c)
OBJS = $(SRCS:.c=.o)
EXECS = $(SRCS:%.c=%)
.PHONY: all clean
all: ${EXECS}
@echo sources compiled
${EXECS}: %: %.o
@echo "creating the executable.."
$(CC) $(CFLAGS) $(INCLUDES) -o $@ $< $(LFLAGS) $(LIBS)
.c.o:
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@ $(LIBS)
serial:
mpicc -std=c11 -std=gnu99 -fopenmp -o serial serial.c -fopenmp
openmp:
mpicc -std=c11 -std=gnu99 -fopenmp -o parallel parallel.c
omp-par-read-map:
mpicc -std=c11 -std=gnu99 -fopenmp -o parallel_read_map parallel_read_map.c
mpi:
mpicc -std=c11 -std=gnu99 -fopenmp -o mpi_parallel mpi_parallel.c
mpi-openmp:
mpicc -std=c11 -std=gnu99 -fopenmp -o mpi_openmp mpi_openmp.c
clean:
@echo "removing executables.."
$(RM) *.o *~ $(EXECS)