From 894c76029d7176afb3cd8c26ad31808d64b4d545 Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Wed, 26 Sep 2018 12:05:03 +0200 Subject: [PATCH] Adjust Make file --- csaxs/Makefile | 34 ++++++++++++++++++++++++++++++++++ csaxs/conda-recipe/build.sh | 4 ++++ 2 files changed, 38 insertions(+) create mode 100644 csaxs/Makefile create mode 100644 csaxs/conda-recipe/build.sh diff --git a/csaxs/Makefile b/csaxs/Makefile new file mode 100644 index 0000000..3220f19 --- /dev/null +++ b/csaxs/Makefile @@ -0,0 +1,34 @@ +SRC_DIR = . +OBJ_DIR = ./obj +BIN_DIR = ./bin +MKDIR = mkdir -p + +CC = g++ +CFLAGS = -Wall -Wfatal-errors -std=c++11 -I${CONDA_PREFIX}/include -I${CONDA_PREFIX}/include/cpp_h5_writer +LDFLAGS = -L${CONDA_PREFIX}/lib -L/usr/lib64 -lcpp_h5_writer -lzmq -lhdf5 -lhdf5_hl -lhdf5_cpp -lhdf5_hl_cpp -lboost_system -lboost_regex -lboost_thread -lpthread + +HEADERS = $(wildcard $(SRC_DIR)/*.hpp) +SRCS = $(wildcard $(SRC_DIR)/*.cpp) +OBJS = $(patsubst $(SRC_DIR)/%.cpp, $(OBJ_DIR)/%.o, $(SRCS)) + +csaxs_h5_writer: export LD_LIBRARY_PATH=${CONDA_PREFIX}/lib +csaxs_h5_writer: lib build_dirs $(OBJS) + $(CC) $(LDFLAGS) -o $(BIN_DIR)/csaxs_h5_writer $(OBJS) $(LDFLAGS) + +lib: + $(MAKE) -C ../lib deploy + +debug: CFLAGS += -DDEBUG_OUTPUT -g +debug: csaxs_h5_writer + +deploy: csaxs_h5_writer + cp bin/* ${CONDA_PREFIX}/bin + +$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp + $(CC) $(CFLAGS) $(LDFLAGS) -c -o $@ $< + +build_dirs: + $(MKDIR) $(OBJ_DIR) $(BIN_DIR) + +clean: + rm -rf $(OBJ_DIR) $(BIN_DIR) \ No newline at end of file diff --git a/csaxs/conda-recipe/build.sh b/csaxs/conda-recipe/build.sh new file mode 100644 index 0000000..1b7a589 --- /dev/null +++ b/csaxs/conda-recipe/build.sh @@ -0,0 +1,4 @@ +make + +cp bin/* ${PREFIX}/bin +cp ../../bin/* ${PREFIX}/lib \ No newline at end of file