##CXXFLAGS      = -g -fPIC -I$(ROOTSYS)/include -L../../libmars.so
CXXFLAGS      = -g -fPIC -I$(ROOTSYS)/include 
LDFLAGS       = -g -shared 
LD    = g++ -fPIC

TTT	= ../libmars.so

HDRS  = MMCComp.h mclib.h

SRCS  = MMCComp.cpp mclib.cpp

OBJS  = MMCComp.o mclib.o 

ROOTLIB	= $(shell root-config --glibs)

PROGRAM       = mclib.so

all:    $(PROGRAM)

$(PROGRAM):     $(OBJS)
		@echo "Linking $(PROGRAM) ..."
		@/bin/rm -f $(PROGRAM)
		@$(LD) $(LDFLAGS) $(OBJS) $(ROOTLIB) $(TTT) -o $(PROGRAM)
		@chmod 555 $(PROGRAM)
		@echo "done"

clean:;	@rm -f $(OBJS) core

###
MMCComp.o: MMCComp.h

mclib.cpp:	MMCComp.h
		@echo "Generating dictionary ..."
		@rootcint mclib.cpp -c MMCComp.h
