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_LIB = $(MULTIVERSO_DIR)/lib THIRD_PARTY_LIB = $(MULTIVERSO_DIR)/third_party/lib INC_FLAGS = -I$(MULTIVERSO_INC) LD_FLAGS = -L$(MULTIVERSO_LIB) -lmultiverso -lpthread 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)/distributed_skipgram_mixture all: path \ multisense_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 $@ multisense_word_embedding: path $(WORD_EMBEDDING) clean: rm -rf $(BIN_DIR) $(WORD_EMBEDDING_OBJ) .PHONY: all path multisense_word_embedding clean