Skip to content
Snippets Groups Projects
Commit 60855e71 authored by Chao Zhan's avatar Chao Zhan
Browse files

fix makefile

parent a1038a3a
No related branches found
No related tags found
No related merge requests found
......@@ -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 $<
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment