# Copyright (C) 2014 InfiniDB, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 of # the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. # $Id: Makefile 2966 2011-05-12 11:58:33Z dcathey $ include ../../rules.mak include ../build/we_rules.mak .PHONY: install clean test docs coverage leakcheck PROGRAM=libwriteengineclient.so VERSION=1.0.0 LIBRARY=$(PROGRAM).$(VERSION) TLIBS=-L. -lddlpackage -L$(EXPORT_ROOT)/lib -lmessageqcpp -lloggingcpp -lconfigcpp -lxml2 -lcppunit -ldl GLIBS=-L$(EXPORT_ROOT)/lib -lmessageqcpp -lloggingcpp -lconfigcpp -lxml2 -lcppunit -ldl LLIBS=-L$(CALPONT_LIBRARY_PATH) -lbrm -lcacheutils -ldm SRCS=we_clients.cpp \ we_ddlcommandclient.cpp \ we_dmlcommandclient.cpp LINCLUDES=we_clients.h \ we_ddlcommandclient.h \ we_dmlcommandclient.h OBJS=$(SRCS:.cpp=.o) $(LIBRARY): $(OBJS) $(LINK.cpp) -shared -o $(LIBRARY) $(OBJS) rm -f $(PROGRAM) ln -s $(LIBRARY) $(PROGRAM) make install install: bootstrap $(LIBRARY) umask 002; \ mkdir -p $(INSTALL_ROOT_LIB) $(INSTALL_ROOT_INCLUDE); \ pushd $(INSTALL_ROOT_LIB) >/dev/null; \ rm -f $(LIBRARY) $(PROGRAM); \ ln -s $(LIBRARY) $(PROGRAM); \ popd >/dev/null; \ $(INSTALL) $(LIBRARY) $(INSTALL_ROOT_LIB) bootstrap: $(INSTALL) $(LINCLUDES) $(INSTALL_ROOT_INCLUDE) clean: rm -f $(LIBDIR)/tdriver.o $(OBJS) tdriver.o $(PROGRAM) $(LIBRARY) tdriver core *~ *.tag *-gcov.* *.gcov tdriver-gcov *.d *.swp *.dat rm -rf html docs: doxygen $(EXPORT_ROOT)/etc/Doxyfile tdriver: tdriver.o $(LINK.cpp) -o $@ $^ $(TLIBS) test: xtest: $(LIBRARY) tdriver $(IPCS_CLEANUP) LD_LIBRARY_PATH=.:$(EXPORT_ROOT)/lib:/usr/local/lib ./tdriver %-gcov.o: %.cpp $(COMPILE.cpp) -o $@ $^ tdriver-gcov: CXXFLAGS+=-fprofile-arcs -ftest-coverage tdriver-gcov: tdriver-gcov.o $(subst .o,-gcov.o,$(OBJS)) $(LINK.cpp) -o $@ $^ $(GLIBS) coverage: xcoverage: tdriver-gcov $(IPCS_CLEANUP) rm -f *.gcda LD_LIBRARY_PATH=$(EXPORT_ROOT)/lib:/usr/local/lib ./tdriver-gcov for file in $(SRCS); do \ bfile=`basename $$file .cpp`; \ gcov -o $${bfile}-gcov $$file >/dev/null; \ done /usr/local/bin/genCoverage.pl $(SRCS) leakcheck: xleakcheck: $(LIBRARY) tdriver $(IPCS_CLEANUP) LD_LIBRARY_PATH=.:$(EXPORT_ROOT)/lib:/usr/local/lib valgrind --tool=memcheck --leak-check=yes ./tdriver %.d: %.cpp @set -e; rm -f $@; \ $(CC) -MM $(CPPFLAGS) $< > $@.$$$$; \ sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ rm -f $@.$$$$ ifndef BOOTSTRAP -include $(SRCS:.cpp=.d) tdriver.d endif