csci5451/assignments/02/Makefile

36 lines
622 B
Makefile
Raw Normal View History

2023-10-31 04:37:41 +00:00
.PHONY: all handin clean run-example
2023-10-23 00:38:42 +00:00
CC := cc
2023-10-31 04:37:41 +00:00
# CFLAGS := -g -O0
# LDFLAGS := -g
CFLAGS := -O3
LDFLAGS :=
2023-10-23 00:38:42 +00:00
CFLAGS += $(shell pkg-config --cflags mpi)
LDFLAGS += $(shell pkg-config --libs mpi)
all: qs_mpi
2023-10-31 04:37:41 +00:00
handin: zhan4854.tar.gz
zhan4854.tar.gz: Makefile ASSIGNMENT.md qs_mpi.c report.pdf
mkdir -p zhan4854
cp $^ zhan4854
tar -czvf $@ zhan4854
rm -r zhan4854
2023-10-31 00:48:27 +00:00
run-example: qs_mpi
2023-10-31 04:37:41 +00:00
mpirun -v --allow-run-as-root -np 4 ./qs_mpi 32 output.txt
report.pdf: report.typ
typst compile $< $@
2023-10-31 00:48:27 +00:00
2023-10-23 00:38:42 +00:00
qs_mpi: qs_mpi.o
2023-10-29 21:34:22 +00:00
$(CC) $^ $(CFLAGS) $(LDFLAGS) -o $@
2023-10-23 00:38:42 +00:00
qs_mpi.o: qs_mpi.c
$(CC) $(CFLAGS) -c -o $@ $^
clean:
rm -f qs_mpi *.o