diff --git a/Makefile b/Makefile index 92df9c6..3bd8026 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ MKDIR = mkdir -p CPP = g++ CPPFLAGS = -Wall -fPIC -pthread -std=c++1y -I./include -I${CONDA_PREFIX}/include LDLIBS = -L/usr/lib64 -L${CONDA_PREFIX}/lib -lzmq -lhdf5 -lhdf5_hl -lhdf5_cpp -lhdf5_hl_cpp -lboost_system -lboost_regex -lboost_thread -lpthread +LDLIBS_TEST = -lgtest_main -lgtest LDFLAGS = -shared UNAME := $(shell uname) @@ -21,6 +22,7 @@ SRCS = $(wildcard $(SRC_DIR)/*.cpp) OBJS = $(patsubst $(SRC_DIR)/%.cpp, $(OBJ_DIR)/%.o, $(SRCS)) all: build_dirs libcpp_h5_writer +test: build_dirs build_test debug: CPPFLAGS += -DDEBUG_OUTPUT -g debug: all @@ -35,4 +37,7 @@ build_dirs: $(MKDIR) $(OBJ_DIR) $(BIN_DIR) clean: - rm -rf $(OBJ_DIR) $(BIN_DIR) \ No newline at end of file + rm -rf $(OBJ_DIR) $(BIN_DIR) + +build_test: $(OBJS) + $(CPP) $(CPPFLAGS) test/test_main.cpp $(OBJS) $(LDLIBS) $(LDLIBS_TEST) -o $(BIN_DIR)/execute_tests \ No newline at end of file