-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
45 lines (38 loc) · 988 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
45
CC = mpicc
FLAGS = -c
LINK_FLAGS = -lm
OBJS = main.o send_wrappers.o recv_wrappers.o initializations.o processing_img.o
EXECUTABLE_NAME = parallel-convolution
OUTPUT = output.raw
# Compile
all: $(OBJS)
ifdef OPEN_MP
$(CC) $(OBJS) -fopenmp $(LINK_FLAGS) -o $(EXECUTABLE_NAME)
else
$(CC) $(OBJS) $(LINK_FLAGS) -o $(EXECUTABLE_NAME)
endif
rm -f $(OBJS)
main.o: main.c
$(CC) $(FLAGS) main.c
send_wrappers.o: send_wrappers.c
$(CC) $(FLAGS) send_wrappers.c
recv_wrappers.o: recv_wrappers.c
$(CC) $(FLAGS) recv_wrappers.c
initializations.o: initializations.c
$(CC) $(FLAGS) initializations.c
processing_img.o: processing_img.c
ifdef OPEN_MP
$(CC) $(FLAGS) -D OMP -fopenmp processing_img.c
else
$(CC) $(FLAGS) processing_img.c
endif
# Clean-up
clean:
rm -f $(EXECUTABLE_NAME)
clean-all:
rm -rf $(EXECUTABLE_NAME) $(OUTPUT)
# Usage
help:
@:
$(info To run with OpenMP: <make all OPEN_MP=1>)
$(info if not, simply use: <make all>)