#-----------configure ROOT-----------# ifdef ROOTSYS include $(ROOTSYS)/etc/Makefile.arch ROOTINC :=$(shell $(ROOTSYS)/bin/root-config --incdir) ROOTLIBDIR :=$(shell $(ROOTSYS)/bin/root-config --libdir) ROOTLDFLAGS :=$(shell $(ROOTSYS)/bin/root-config --ldflags) ROOTCFLAGS :=$(shell $(ROOTSYS)/bin/root-config --cflags) ROOTLIBS := $(shell $(ROOTSYS)/bin/root-config --libs) ROOTLINK = $(ROOTLIBS) $(ROOTCFLAGS) $(ROOTLDFLAGS) -I$(ROOTINC) else @echo "NO ROOTSYS!" endif #--------configure compiler----------# CXX = g++ CXXFLAGS := $(ROOTCFLAGS) CXXFLAGS += -O2 -Wall -Wno-write-strings LIBS = $(ROOTLIBS) -lm -lz -lutil -lnsl -lpthread -L. .SUFFIXES: .$(SrcSuf) .$(ObjSuf) .$(DllSuf) #----------configure the Event class-----------# EVENTO = myClass.$(ObjSuf) EventDict.$(ObjSuf) EVENTS = myClass.$(SrcSuf) EventDict.$(SrcSuf) EVENTSO = myClass.$(DllSuf) EVENTLIB = $(shell pwd)/$(EVENTSO) default: all all: $(EVENTO) $(EVENTSO) myApp $(EVENTSO): $(EVENTO) @echo "compiling $@" $(CXX) $(CXXFLAGS) $(SOFLAGS) $(OutPutOpt) $@ $^ $(EXPLLINKLIBS) $(LIBS) @echo "$@ done" @echo "----------------------------------" myClass.$(ObjSuf): myClass.h EventDict.$(SrcSuf): myClass.h LinkDef.h @echo "Generating dictionary $@..." @rootcint -f $@ -c $^ @echo "$@ done" @echo "-------------------------------" .$(SrcSuf).$(ObjSuf): @echo "Compiling $@" $(CXX) $(CXXFLAGS) $(ROOTLINK) -c $< @echo "-----------------------------------------------------" myApp: myApp.cxx $(EVENTSO) @echo "Compiling myApp" $(CXX) $(CXXFLAGS) -o myApp myApp.cxx $(LIBS) $(EVENTLIB) @echo "--" clean: rm -f *.o *~ \#* @rm -f $(EVENTO) EventDict* core rm -f $(EVENTSO) rm -f myApp