-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile~
45 lines (32 loc) · 1.09 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
PROJECT := $(shell readlink $(dir $(lastword $(MAKEFILE_LIST))) -f)
CXX = g++
CXXFLAGS = -O3 \
-std=c++11 \
-Wall \
-Wno-sign-compare \
-fno-omit-frame-pointer
MULTIVERSO_DIR = $(PROJECT)/../multiverso
MULTIVERSO_INC = $(MULTIVERSO_DIR)/include/multiverso
MULTIVERSO_LIB = $(MULTIVERSO_DIR)/lib
THIRD_PARTY_LIB = $(MULTIVERSO_DIR)/third_party/lib
INC_FLAGS = -I$(MULTIVERSO_INC)
LD_FLAGS = -L$(MULTIVERSO_LIB) -lmultiverso
LD_FLAGS += -L$(THIRD_PARTY_LIB) -lzmq -lmpich -lmpl -lpthread
SVRG_HEADERS = $(shell find $(PROJECT)/src -type f -name "*.h")
SVRG_SRC = $(shell find $(PROJECT)/src -type f -name "*.cpp")
SVRG_OBJ = $(WORD_EMBEDDING_SRC:.cpp=.o)
BIN_DIR = $(PROJECT)/bin
SVRG = $(BIN_DIR)/svrg
all: path \
svrg
path: $(BIN_DIR)
$(BIN_DIR):
mkdir -p $@
$(SVRG): $(SVRG_OBJ)
$(CXX) $(SVRG_OBJ) $(CXXFLAGS) $(INC_FLAGS) $(LD_FLAGS) -o $@
$(SVRG_OBJ): %.o: %.cpp $(SVRG_HEADERS) $(MULTIVERSO_INC)
$(CXX) $(CXXFLAGS) $(INC_FLAGS) -c $< -o $@
svrg: path $(SVRG)
clean:
rm -rf $(BIN_DIR) $(SVRG_OBJ)
.PHONY: all path word_embedding clean