From 60855e7168b35de3fb71f0b01f8e90fcd4c59872 Mon Sep 17 00:00:00 2001 From: Chao Zhan <chao.zhan@fu-berlin.de> Date: Thu, 15 Jun 2023 00:50:43 +0200 Subject: [PATCH] fix makefile --- exercises/MPI_examples/manager-worker/Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/exercises/MPI_examples/manager-worker/Makefile b/exercises/MPI_examples/manager-worker/Makefile index 73ba6f5..34e7812 100644 --- a/exercises/MPI_examples/manager-worker/Makefile +++ b/exercises/MPI_examples/manager-worker/Makefile @@ -5,15 +5,18 @@ CC = mpicc CFLAGS = -Wall -std=c11 CFLAGS += -I. # add the current directory to the include path +.PHONY: all +all: $(PROG1) $(PROG2) # build the program + $(PROG1): manager.o $(CC) $(CFLAGS) $^ -o $@ $(PROG2): worker.o $(CC) $(CFLAGS) $^ -o $@ -.Phone: run +.PHONY: run run: $(PROG1) $(PROG2) # build and run the program - MY_MPIRUN_OPTIONS="-usize 8" mpirun -np 4 ./$(PROG1) + mpirun -np 1 ./$(PROG1) $(OBJECTS): %.o: %.c # compile the source files into object files $(CC) $(CFLAGS) -c $< -- GitLab