-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
98 lines (81 loc) · 2.65 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
UNAME := $(shell uname -s)
OBJDIRR=.build-release
OBJDIRD=.build-debug
ifeq ($(UNAME),Linux)
PLATFORM=Linux
PKG =pkg-config
MOC =moc
CUDA_DIR := /usr/local/cuda
LIBS = -L/usr/lib64 -L$(CUDA_DIR)/lib64 -lhdf5_hl -lm -lopenblas
INC = -I/usr/include -I$(CUDA_DIR)/include
A =.a
LIB_PREFIX =lib
endif
ifeq ($(UNAME),Darwin)
PLATFORM=Darwin
PKG =/usr/local/bin/pkg-config
MOC =/usr/local/Cellar/qt/4.8.6/bin/moc
LIBS = -framework Accelerate
INC += -I/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Headers/
endif
CC=gcc
LINK=gcc
AR=ar r
AR_OUT=
LINK_OUT= -o
LINK_OPT=
MINUS_O = -o
INC += -Iinclude
CFLAGS = -std=c++11 -Wall -DUSE_OPENCV -Wno-unused-variable -Wno-unused-function -fPIC -g -O3 $(INC)
CFLAGSD = -std=c++11 -Wall -DUSE_OPENCV -Wno-unused-variable -Wno-unused-function -fPIC -g -DDEBUG $(INC)
LIBS += -lstdc++ -llmdb -lboost_system-mt -lboost_thread-mt -lboost_filesystem -lboost_regex -lboost_iostreams-mt -ljsoncpp -lGL -lGLU
LIBS += `$(PKG) --libs libglog`
LIBSQT += `$(PKG) --libs QtGui QtOpenGL`
LIBSD = $(LIBS)
LIBSQTD = $(LIBSQT)
DEPENDS= -MMD -MF [email protected]
EVERY_BIN=viz-r$(EXE) viz-d$(EXE)
UTIL = viz/miniutils.cpp
VIZ = viz/viz.cpp viz/viz-progress.cpp viz/viz-qnet3d.cpp
TSNE = t-sne/tsne.cpp t-sne/sptree.cpp
UTIL_R = $(patsubst %.cpp, $(OBJDIRR)/%.o, $(UTIL))
UTIL_D = $(patsubst %.cpp, $(OBJDIRD)/%.o, $(UTIL))
VIZ_R = $(patsubst %.cpp, $(OBJDIRR)/%.o, $(VIZ))
VIZ_D = $(patsubst %.cpp, $(OBJDIRD)/%.o, $(VIZ))
TSNE_R = $(patsubst %.cpp, $(OBJDIRR)/%.o, $(TSNE))
TSNE_D = $(patsubst %.cpp, $(OBJDIRD)/%.o, $(TSNE))
EVERY_OBJ = $(VIZ_R) $(VIZ_D) $(UTIL_R) $(UTIL_D) $(TSNE_R) $(TSNE_D)
DEP = $(patsubst %.o,%.o.dep, $(EVERY_OBJ))
all: dirs $(EVERY_BIN)
$(OBJDIRR)/viz/viz.o: viz/../.generated/viz.moc
viz/../.generated/viz.moc: viz/viz.cpp
$(MOC) -o $@ $<
viz-r$(EXE): $(VIZ_R) $(UTIL_R) $(TSNE_R)
$(LINK) $(LINK_OPT) $(LINK_OUT)$@ $^ $(LIBS) $(LIBSQT)
viz-d$(EXE): $(VIZ_D) $(UTIL_D) $(TSNE_D)
$(LINK) $(LINK_OPT) $(LINK_OUT)$@ $^ $(LIBSD) $(LIBSQTD)
$(OBJDIRR)/%.o: %.cpp
$(CC) $(CFLAGS) -c $< $(MINUS_O)$@ $(DEPENDS)
$(OBJDIRD)/%.o: %.cpp
$(CC) $(CFLAGSD) -c $< $(MINUS_O)$@ $(DEPENDS)
.PHONY: depend clean dirs
clean:
$(RM) $(EVERY_BIN) $(EVERY_OBJ) .generated/*.moc *.ilk *.pdb $(DEP)
rm -rf .generated
rm -rf $(OBJDIRD)
rm -rf $(OBJDIRR)
depends:
cat $(DEP) > Makefile.dep
# build directories
.generated:
mkdir -p .generated
$(OBJDIRR)/viz:
mkdir -p $@
$(OBJDIRD)/viz:
mkdir -p $@
$(OBJDIRR)/t-sne:
mkdir -p $@
$(OBJDIRD)/t-sne:
mkdir -p $@
dirs: .generated $(OBJDIRR)/viz $(OBJDIRD)/viz $(OBJDIRR)/t-sne $(OBJDIRD)/t-sne
-include Makefile.dep