csci5451/assignments/02/Makefile

23 lines
374 B
Makefile
Raw Normal View History

2023-10-31 00:48:27 +00:00
.PHONY: all clean run-example
2023-10-23 00:38:42 +00:00
CC := cc
2023-10-30 09:09:03 +00:00
CFLAGS := -g
LDFLAGS := -g
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 00:48:27 +00:00
run-example: qs_mpi
mpirun --allow-run-as-root -np 4 ./qs_mpi 32 output.txt
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