Simple Makefile example for MPI
1
2
3
4
5
6
7
8
9
10
11
12
13
CC=mpicxx
CFLAGS=-c -Wall
LDFLAGS=
SOURCES=test.cpp
OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=test
all: $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(LDFLAGS) $(OBJECTS) -o $@
.cpp.o:
$(CC) $(CFLAGS) $< -o $@
clean:
rm -rf *.o $(EXECUTABLE)