##############################################################
# Generic 
##############################################################

CC = g++
CXX = $(CC)
ASM=$(shell echo "/lib/modules/`uname -r`/build/include")
LDFLAGDET = -L$(LIBDIR) -lSlsDetector -L/usr/lib64/ -lpthread
LDFLAGRXR = -L$(LIBDIR) -lSlsReceiver -L/usr/lib64/ -lpthread
FLAGS= -Wall #-DEIGER_DEBUG2 #-DEIGER_DEBUG  #-DFIFO_DEBUG
# -DVERBOSE 

# Setting up the verbose flags
ifeq ($(DEBUG),1)
     FLAGS = -Wall -DVERBOSE
endif
ifeq ($(DEBUG),2)
     FLAGS = -Wall -DVERYVERBOSE
endif

##############################################################
# EigerSLS specific. Set this to yes, if you want to compile
# EigerSLS code: in this case, you need also POCO and JsonBox 
# libraries
##############################################################   

REST = no

#POCODIR = /afs/psi.ch/user/s/sala/public/poco-slp_5.7-32bit
#JSONBOXDIR = /afs/psi.ch/user/s/sala/public/JsonBox-slp_5.7-32bit
POCODIR = /afs/psi.ch/user/s/sala/public/poco-slp_6.4-64bit
JSONBOXDIR = /afs/psi.ch/user/s/sala/public/JsonBox-slp_6.4-64bit
#POCODIR = /home/sala/Programs/poco-ubuntu_13.10-64bit
#JSONBOXDIR = /home/sala/Programs/JsonBox-ubuntu_13.10-64bit

RESTFLAGS = -L$(POCODIR)/lib -Wl,-rpath=$(POCODIR)/lib  -L$(JSONBOXDIR) -Wl,-rpath=$(JSONBOXDIR)/lib  -lPocoNet -lPocoFoundation -lJsonBox

ifeq ($(REST),yes)
     LDFLAGRXR = -L$(LIBDIR) -lSlsReceiver $(RESTFLAGS) -DREST
     INCLUDESRXR = $(EIGERFLAGS) -I$(POCODIR)/include -I$(JSONBOXDIR)/include
endif


##############################################################
# ROOTSLS specific. Set this to yes, if you want to compile
# ROOTSLS code: in this case, you need also root libraries
##############################################################   

ROOTSLS = no

ROOTFLAGS = $(shell root-config --cflags --glibs) -DMYROOT1   #-DALLFILE_DEBUG #-DMYROOT1 

ifeq ($(ROOTSLS),yes)
     LDFLAGRXR = -L$(LIBDIR) -lSlsReceiver $(ROOTFLAGS) -DROOTSLS
endif






