-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
53 lines (39 loc) · 1.1 KB
/
makefile
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
COMPILER=icpc
#local environment
DEST = ~/bin
LIBDIR = /mnt/c/share/lib
TARDIR = ./bin
OBJDIR = ./obj
SRCDIR = ./
CPPFLAGS = -Wall -O3 -g -std=c++0x -lstdc++fs -DHDF5
INCLUDE = -I./include
#GLOG
#GLOG = $(LIBDIR)/glog
#LDFLAGS += -L$(GLOG)/lib -lglog -lpthread
#INCLUDE += -I$(GLOG)/include
#HDF5
HDF5 = $(LIBDIR)/HDF5
LDFLAGS += -L$(HDF5)/lib -hdf5_hl_cpp -lhdf5_cpp -hdf5_hl -lhdf5 -lz
INCLUDE += -I$(HDF5)/include
#boost
#BOOST = $(LIBDIR)/boost
#LDFLAGS += -L$(BOOST)/lib -lboost_graph
#INCLUDE += -I$(BOOST)/include
EIGEN = $(LIBDIR)/eigen
INCLUDE += -I$(EIGEN)/include/eigen3
TARGET = $(TARDIR)/run
SOURCES = $(wildcard $(SRCDIR)/*.cpp)
OBJECTS = $(addprefix $(OBJDIR)/, $(notdir $(SOURCES:.cpp=.o)))
DEPENDS = $(OBJECTS:.o=d)
$(TARGET): $(OBJECTS) $(LIBS)
@[ -d $(TARDIR) ] || mkdir -p $(TARDIR)
$(COMPILER) -o $@ $^ $(LDFLAGS)
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
@[ -d $(OBJDIR) ] || mkdir -p $(OBJDIR)
$(COMPILER) $(CPPFLAGS) $(INCLUDE) -o $@ -c $<
all: clean $(TARGET)
clean:
rm -f $(OBJECTS) $(DEPENDS) $(TARGET)
install:$(TARGET)
install -s $(TARGET) $(DEST)
-include $(DEPENDS)