-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (30 loc) · 704 Bytes
/
Makefile
File metadata and controls
40 lines (30 loc) · 704 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
30
31
32
33
34
35
36
37
38
39
CXX=g++
CXXFLAGS= -g -pg -std=c++11 -O3 -ftree-vectorize
LDFLAGS=
LDLIBS=
TARGET=nbody
DOC = doc
SRCDIR=src
OBJDIR=build
BINDIR=.
CXXFLAGS+= -I./$(SRCDIR)/*.hpp
SOURCES := $(wildcard $(SRCDIR)/*.cpp)
INCLUDES := $(wildcard $(SRCDIR)/*.hpp)
OBJECTS := $(SOURCES:$(SRCDIR)/%.cpp=$(OBJDIR)/%.o)
RM = rm -f
$(BINDIR)/$(TARGET): $(OBJECTS)
$(CXX) $(CXXFLAGS) $(OBJECTS) $(LDFLAGS) -o $@
@echo "Linking complete!"
$(OBJECTS): $(OBJDIR)/%.o : $(SRCDIR)/%.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@
.PHONY: clean
clean:
$(RM) $(OBJECTS)
@echo "Cleaned up objects."
.PHONY: cleanall
cleanall: clean
$(RM) $(BINDIR)/$(TARGET)
@echo "Cleaned up binaries."
.PHONY: doc
doc:
cd $(DOC) && doxygen Doxyfile