########                    Definitions

OPT =  -DARCPC  -O2 




ROOTSYS    = software/root/pro/
#ROOTLIB	   = $(shell root-config --libs)

#ROOTLIB	   = -L/software/root/lib -lCore -lCint -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lm -ldl -rdynamic
ROOTLIB = -L/disk01/software/root/root//lib -lCore -lCint -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lm -ldl -rdynamic

ROOTFLAGS   = $(shell root-config --cflags)
OFFLINE = offline/



MILAGROLIB = $(OFFLINE)/lib
MILAGROINC = $(OFFLINE)/include

MON = grb_finder_plotter
CD  = checkdata

MONOBJS   = grb_finder_plotter.o
CDOBJS    = checkdata.o

########			Unix compile and link

COMPILE = g++ $(OPT) $(ROOTFLAGS) -c  $*.c -I$(MILAGROINC) -I$(ROOTSYS)/include
COMPILECC = g++ $(OPT) $(ROOTFLAGS) -c $*.cc -I$(MILAGROINC) -I$(ROOTSYS)/include

LINK_MON = g++ $(OPT) -o $(MON) $(MONOBJS) -L$(MILAGROLIB) \
		 $(ROOTLIB) -loffline_pc++  -lg2c -lm -lnsl  -lz
LINK_CD = g++ $(OPT) -o $(CD) $(CDOBJS) -L$(MILAGROLIB) \
		 $(ROOTLIB) -loffline_pc++  -lg2c -lm -lnsl  -lz


########                 Default Rules

.SUFFIXES:
.SUFFIXES: .cc .c .o

.c.o:; $(COMPILE) -o $@
.cc.o:; $(COMPILECC) -o $@

########                     Targets

$(MON): $(MONOBJS)
	$(LINK_MON)

$(CD): $(CDOBJS)
	$(LINK_CD)

########                 Dependencies

grb_finder_plotter.o: 	 grb_finder_plotter.cc $(MILAGROLIB) 
checkdata.o:             checkdata.cc $(MILAGROLIB)








