diff --git a/lab1/Makefile b/lab1/Makefile index 71a169c..8558e2c 100644 --- a/lab1/Makefile +++ b/lab1/Makefile @@ -2,15 +2,18 @@ MPICC ?= mpicc MPIRUN ?= mpirun CFLAGS ?= -O2 -Wall -TARGET := $(basename $(SRC)) SRC := mpi_hello_world.c serial_pi.c mpi_pi.c +TARGET := $(basename $(SRC)) .PHONY: all clean run all: $(TARGET) -$(TARGET): $(SRC) - $(MPICC) $(CFLAGS) -o $@ $< +mpi_%: mpi_%.c + $(MPICC) $(CFLAGS) -o $@ $< + +serial_%: serial_%.c + $(CC) $(CFLAGS) -o $@ $< run: $(TARGET) $(MPIRUN) -np 4 ./$@