-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (23 loc) · 715 Bytes
/
Makefile
File metadata and controls
29 lines (23 loc) · 715 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
TARGET = nbody
SRCDIR = ./src
OBJDIR = ./obj
INCDIR = ./inc
COMPILER = clang++
mpi:COMPILER = mpic++
CFLAGS = -std=c++11
mpi:CFLAGS = -std=c++11 -DMPI
INCLUDE = -I $(INCDIR)
LDFLAGS =
SRCS = $(SRCDIR)/nbody.cpp $(SRCDIR)/Particle.cpp
OBJS = $(addprefix $(OBJDIR)/,$(notdir $(SRCS:.cpp=.o)))
$(TARGET): $(OBJS)
$(COMPILER) $(CFLAGS) -o ./bin/nbody $^ $(LDFLAGS)
nbody0 : $(SRCDIR)/nbody0.cpp $(SRCDIR)/Particle.cpp $(SRCDIR)/ParticleList.cpp
$(COMPILER) $(CFLAGS) -o ./bin/nbody0 $^ $(INCLUDE) $(LDFLAGS)
mpi:$(OBJS)
$(COMPILER) $(CFLAGS) -o ./bin/mpinbody $^ $(LDFLAGS)
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
$(COMPILER) $(CFLAGS) $(INCLUDE) -o $@ -c $<
.PHONY : clean cleanall
clean :
rm -f $(OBJS) $(TARGET)