ObjSuf        = o
SrcSuf        = cxx
ExeSuf        =
DllSuf        = so  
OutPutOpt     = -o


ROOTCFLAGS   := $(shell root-config --cflags)
ROOTLIBS     := $(shell root-config --libs)
ROOTGLIBS    := $(shell root-config --glibs)


THREADTST     = -D_THREADLIB_ 

# Linux with egcs
CXX           = g++


CXXFLAGS     = -g -Wall -DR__THREAD -fPIC -D_REENTRANT 
CXXFLAGS     += $(ROOTCFLAGS) -I.

 
LD            = g++
LDFLAGS       = -g
SOFLAGS       = -shared
LIBS          = $(ROOTLIBS) -lm -ldl -rdynamic
GLIBS         = $(ROOTLIBS) $(ROOTGLIBS) -L/usr/X11R6/lib \
                -lXpm -lX11 -lm -ldl -rdynamic


THREADLIBS =  -lpthread -lThread






#------------------------------------------------------------------------------
# shared library containing the test threads:

THREADO        = conditions.$(ObjSuf) \
                conditionsDict.$(ObjSuf) 

THREADS        = conditions.$(SrcSuf) \
                conditionsDict.$(SrcSuf)
THREADSO	= libconditions.$(DllSuf)

$(THREADSO):       $(THREADO)
		$(LD) $(SOFLAGS) $(LDFLAGS) $(THREADO) $(OutPutOpt) $(THREADSO)
		@echo "$(THREADSO) done"







#--------------------------------------------------------------------------------
PROGRAMS =  $(THREADSO)


all:			$(PROGRAMS) 


clean:
		@rm -f $(THREADO) *Dict.* core

clean_targets:

		@rm -f $(PROGRAMS) *Dict.* core


.SUFFIXES: .$(SrcSuf)


##############################################################

conditions.$(ObjSuf): conditions.h

conditionsDict.$(SrcSuf): conditions.h conditionsLinkDef.h
	@echo "Generating dictionary conditionsDict..."
	@$(ROOTSYS)/bin/rootcint -f conditionsDict.$(SrcSuf) -c  -I. conditions.h conditionsLinkDef.h



.$(SrcSuf).$(ObjSuf):
	$(CXX) $(CXXFLAGS) -c $<
