#
# Jan Chrin
# June 2016
#
# Makefile to build a simple C++ cafe client 
#


#CAFE version to link to
CAFE_VERSION=cafez-1.3.0-alpha-1

#PYTHON_INCLUDE=/opt/gfa/python-3.5/latest/include/python3.5m
#PYTHON_LIB=/opt/gfa/python-3.5/latest/lib

EPICS_BASE=${EPICS}/base

#CAFE project base
CAFE_BASE=/opt/gfa/cafe
CAFE_CPP_BASE=${CAFE_BASE}/cpp
BOOST_BASE=${CAFE_BASE}/boost/boost_1_61_0/include

ZEROMQ_BASE=/opt/gfa/zmq/zeromq-4.1.5

INCLUDE_PATH += -I$(CAFE_CPP_BASE)/$(CAFE_VERSION)/include \
 -I$(EPICS_BASE)/include -I$(EPICS_BASE)/include/os/Linux \
 -I$(BOOST_BASE) -I$(ZEROMQ_BASE)/include -I/opt/gfa/zmsglog/json/jsoncpp-src-0.6.0-rc2/include
 #-I$(BOOST_BASE)/boost
 
LIB_DIR += -L$(EPICS_BASE)/lib/${EPICS_HOST_ARCH} \
 -Wl,-rpath,$(EPICS_BASE)/lib/${EPICS_HOST_ARCH} \
 -L$(CAFE_CPP_BASE)/$(CAFE_VERSION)/lib \
 -Wl,-rpath,$(CAFE_CPP_BASE)/$(CAFE_VERSION)/lib \
 -L$(ZEROMQ_BASE)/lib \
 -Wl,-rpath,$(ZEROMQ_BASE)/lib \
 -L/opt/gfa/zmsglog/json/jsoncpp-src-0.6.0-rc2/libs/linux-gcc-4.4.7 \
 -Wl,-rpath,/opt/gfa/zmsglog/json/jsoncpp-src-0.6.0-rc2/libs/linux-gcc-4.4.7

LIBS += -lcafe -lca -lCom -lzmq -ljson_linux-gcc-4.4.7_libmt
 

cafeTest: cafeTest.cc callbacks.h
	g++ cafeTest.cc -o cafeTest \
 	$(INCLUDE_PATH) $(LIB_DIR) $(LIBS)
	

clean:
	rm -f cafeTest.o cafeTest

