forked from microsoft/distributed_word_embedding
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (32 loc) · 1.21 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
WORD_EMBEDDING_HEADERS = $(shell find $(PROJECT)/src -type f -name "*.h")
WORD_EMBEDDING_SRC = $(shell find $(PROJECT)/src -type f -name "*.cpp")
WORD_EMBEDDING_OBJ = $(WORD_EMBEDDING_SRC:.cpp=.o)
BIN_DIR = $(PROJECT)/bin
WORD_EMBEDDING = $(BIN_DIR)/word_embedding
all: path \
word_embedding
path: $(BIN_DIR)
$(BIN_DIR):
mkdir -p $@
$(WORD_EMBEDDING): $(WORD_EMBEDDING_OBJ)
$(CXX) $(WORD_EMBEDDING_OBJ) $(CXXFLAGS) $(INC_FLAGS) $(LD_FLAGS) -o $@
$(WORD_EMBEDDING_OBJ): %.o: %.cpp $(WORD_EMBEDDING_HEADERS) $(MULTIVERSO_INC)
$(CXX) $(CXXFLAGS) $(INC_FLAGS) -c $< -o $@
word_embedding: path $(WORD_EMBEDDING)
clean:
rm -rf $(BIN_DIR) $(WORD_EMBEDDING_OBJ)
.PHONY: all path word_embedding clean