-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (27 loc) · 715 Bytes
/
Makefile
File metadata and controls
36 lines (27 loc) · 715 Bytes
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
CC = mpicc
CFLAGS = -Wall -O2 -std=c99
EXEC = library_system
SRCS = main.c coordinator.c client.c lib.c
OBJS = $(SRCS:.c=.o)
all: $(EXEC)
$(EXEC): $(OBJS)
$(CC) $(CFLAGS) -o $@ $^
@echo "Build completed! Usage: mpirun -np <processes> ./$(EXEC) <N>"
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
clean:
rm -f $(EXEC) *.o
@echo "Clean completed."
test2:
@echo "Testing N=2 (9 processes)"
mpirun -np 9 ./$(EXEC) 2
test3:
@echo "Testing N=3 (23 processes)"
mpirun -np 23 ./$(EXEC) 3
test4:
@echo "Testing N=4 (49 processes)"
mpirun -np 49 ./$(EXEC) 4
debug: CFLAGS += -g -DDEBUG
debug: clean $(EXEC)
@echo "Debug build completed"
.PHONY: all clean test2 test3 test4 debug