###########################################################################
#
# FairCom Corporation makefile for c-treeEDGE python.sql.sqlalchemy API Tutorials
#
###########################################################################

SRCDIR=..
PYEXE=python3
LIBDIR=../../../ctree.drivers/lib
ifeq (, $(shell which $(PYEXE)))
	PYEXE=python
endif
ifeq (, $(shell which $(PYEXE)))
$(error Error. Could not find suitable $(PYEXE). Aborting.)
endif

ALL:
	@echo If you seem to have trouble with this tutorial, the most likely cause is
	@echo that you do not have correctly installed SQLAlchemy in your python installation.
	@echo Make sure you follwed the readme for this API to know how to install SQLAlchemy.
	@echo Make sure your system cover the requirements then execute:
	@echo make build
	@echo to run  the tutorial

build:\
	libctsqlapi.so\
	msg

libctsqlapi.so:
	cp $(LIBDIR)/libctsqlapi.so ..
msg:
	@echo "Now execute make run to run the tutorial"

run:
	cd $(SRCDIR);LD_LIBRARY_PATH=. $(PYEXE) usage.py;cd cmdline

clean:
	rm -f ../libctsqlapi.so
