Build tests in Makefile

This commit is contained in:
2018-07-03 17:10:29 +02:00
parent 651895860d
commit e7ac6ac702
+6 -1
View File
@@ -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)
rm -rf $(OBJ_DIR) $(BIN_DIR)
build_test: $(OBJS)
$(CPP) $(CPPFLAGS) test/test_main.cpp $(OBJS) $(LDLIBS) $(LDLIBS_TEST) -o $(BIN_DIR)/execute_tests