-
Notifications
You must be signed in to change notification settings - Fork 0
/
GNUmakefile
29 lines (23 loc) · 888 Bytes
/
GNUmakefile
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
# Place commonly changed variables
# at the top of the makefile
DIM = 3
TRAJ_SRC = $(HOME)/src/trajectory
ANALYSIS_SRC = $(HOME)/src/analysis
WRITER_SRC = $(HOME)/src/writer
CFLAGS = -Wall -I$(TRAJ_SRC) -I$(ANALYSIS_SRC) -I$(WRITER_SRC) -std=c++11 -pg
CXX = g++
#CXX = clang++
CPPFLAGS = -D DIM=$(DIM) -D READ_CHARGE_FILE=$(CHARGE)
TRAJ_SRCFILES:=$(wildcard $(TRAJ_SRC)/*.cpp)
TRAJ_OBJS:=$(patsubst %.cpp, %.o, $(TRAJ_SRCFILES))
ANALYSIS_SRCFILES:=$(wildcard $(ANALYSIS_SRC)/*.cpp)
ANALYSIS_OBJS:=$(patsubst %.cpp, %.o, $(ANALYSIS_SRCFILES))
WRITER_SRCFILES:=$(wildcard $(WRITER_SRC)/*.cpp)
WRITER_OBJS:=$(patsubst %.cpp, %.o, $(WRITER_SRCFILES))
OBJS = $(TRAJ_OBJS) $(ANALYSIS_OBJS) $(WRITER_OBJS)
%.o:%.cpp GNUmakefile
$(CXX) -c $(DEBUGFLAGS) $(CPPFLAGS) $(CFLAGS) $< -o $@
$(CXX) -MM $(CFLAGS) $< > $*.d
clean:
rm -r $(OBJS) $(OBJS:.o=.d) *.exe *.dSYM
#-include $(OBJS:-o=.d)