# -*-Makefile-*-
# This file is part of rasdaman community.
#
# Rasdaman community is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Rasdaman community 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 Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with rasdaman community.  If not, see <http://www.gnu.org/licenses/>.
#
# Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
# rasdaman GmbH.
#
# For more information please see <http://www.rasdaman.org>
# or contact Peter Baumann via <baumann@rasdaman.com>.
#
# MAKEFILE FOR:
#   query
#
#
# COMMENTS:
#
##################################################################

COMPILER = /usr/bin/c++
LINKER   = /usr/bin/c++
FLAGS    =  -std=c++17 -fPIC -fno-stack-protector -fno-strict-overflow

INCS = -I /opt/rasdaman/include

LIBS = -L/opt/rasdaman/lib \
       -lrasodmg               \
       -lraslib                \
       -lclientcomm            \
       -lrasodmg               \
       -lraslib                \
       -lrasnet                \
       -lcommon_grpc           \
       -lcommon_exceptions     \
       -lcommon_network        \
       -lcommon_logging        \
       -lcommon_string         \
       -leasyloggingpp         \
       -lmymalloc_cln          \
       -lgrpc++_unsecure       \
       -lgrpc_unsecure         \
       -lz                     \
       -lprotobuf              \
       -lpthread               \
       -ldl                    \
       -ldw


DEFS = -DEARLY_TEMPLATE -DELPP_NO_DEFAULT_LOG_FILE -DELPP_FEATURE_CRASH_LOG -DELPP_STACKTRACE \
       -DELPP_FEATURE_CRASH_LOG -DELPP_NO_CHECK_MACROS -DELPP_THREAD_SAFE


all: bin


query.o: query.cc
	$(COMPILER) $(FLAGS) $(DEFS) $(INCS) -c query.cc


bin: query.o
	$(LINKER) $(FLAGS) -o query query.o $(LIBS)


clean:
	-rm -f *.o query
