Makefile

Dear All,
Here I am attaching a Makefile which was running well in root5.02 version. This Makefile consists of 4 classes InoHit.h, InoTriplet.h, InoTrack.h and InoMagField.h .
This Makefile is not running in root 5.16 version.
How to solve this problem ?
Plz. give suggesstion. If possible send me a sample Makefile .
Thanks in advance.
Tapasi

ARCH          = linux

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

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


ifeq ($(ARCH),linux)
# Linux with egcs, gcc 2.9x, gcc 3.x (>= RedHat 5.2)
CXX           = g++
CXXFLAGS      = -O -Wall -fPIC
LD            = g++
LDFLAGS       = -O
SOFLAGS       = -shared
endif


CXXFLAGS     +=  -I. -I$(ROOTSYS)/include
LIBS          = $(ROOTLIBS) $(SYSLIBS)
GLIBS         = $(ROOTGLIBS) $(SYSLIBS)

#------------------------------------------------------------------------------


INOHITO       = InoHit.$(ObjSuf) InoHitDict.$(ObjSuf)
INOHITS       = InoHit.$(SrcSuf) InoHitDict.$(SrcSuf)
INOHITSO      = libInoHit.$(DllSuf)

INOTRIPLETO       = InoTriplet.$(ObjSuf) InoTripletDict.$(ObjSuf)
INOTRIPLETS       = InoTriplet.$(SrcSuf) InoTripletDict.$(SrcSuf)
INOTRIPLETSO      = libInoTriplet.$(DllSuf)

INOTRACKO       = InoTrack.$(ObjSuf) InoTrackDict.$(ObjSuf)
INOTRACKS       = InoTrack.$(SrcSuf) InoTrackDict.$(SrcSuf)
INOTRACKSO      = libInoTrack.$(DllSuf)

INOMAGFIELDO       = InoMagField.$(ObjSuf) InoMagFieldDict.$(ObjSuf)
INOMAGFIELDS       = InoMagField.$(SrcSuf) InoMagFieldDict.$(SrcSuf)
INOMAGFIELDSO      = libInoMagField.$(DllSuf)


OBJS          = $(INOHITO) $(INOTRIPLETO) $(INOTRACKO) $(INOMAGFIELDO)

PROGRAMS      = $(INOHITSO) $(INOTRIPLETSO) $(INOTRACKSO) $(INOMAGFIELDSO)

#------------------------------------------------------------------------------

.SUFFIXES: .$(SrcSuf) .$(ObjSuf) .$(DllSuf)
.PHONY:   InoHit InoTriplet InoTrack InoMagField

all:            $(PROGRAMS)


InoHitContainer:         $(INOHITSO) $(INOTRIPLETSO) $(INOTRACKSO) $(INOMAGFIELDSO)

$(INOHITSO):    $(INOHITO)
		$(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@
$(INOTRIPLETSO):    $(INOTRIPLETO)
		$(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@
$(INOTRACKSO):    $(INOTRACKO)
		$(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@
$(INOMAGFIELDSO):    $(INOMAGFIELDO)
		$(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@

clean:
		@rm -f $(OBJS) core

distclean:      clean
		@rm -f $(PROGRAMS) *Dict.* *.def *.exp \
		   *.root *.ps *.so .def so_locations
		@rm -rf cxx_repository

.SUFFIXES: .$(SrcSuf)

###


InoHit.$(ObjSuf): InoHit.h
InoHitDict.$(SrcSuf): InoHit.h InoHitLinkDef.h
	@echo "Generating dictionary $@..."
	@rootcint -f $@ -c $^

InoTriplet.$(ObjSuf): InoTriplet.h
InoTripletDict.$(SrcSuf): InoTriplet.h InoTripletLinkDef.h
	@echo "Generating dictionary $@..."
	@rootcint -f $@ -c $^

InoTrack.$(ObjSuf): InoTrack.h
InoTrackDict.$(SrcSuf): InoTrack.h InoTrackLinkDef.h
	@echo "Generating dictionary $@..."
	@rootcint -f $@ -c $^

InoMagField.$(ObjSuf): InoMagField.h
InoMagFieldDict.$(SrcSuf): InoMagField.h InoMagFieldLinkDef.h
	@echo "Generating dictionary $@..."
	@rootcint -f $@ -c $^

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

Hi,
what is the error you see?
Axel.

Hi Axel
After rebuilting InoHitDict.h file the following error is coming. Here the error showing is in
InoHitDict.cxx file…but it is automatically generated file…

[color=blue]g++ -O -Wall -fPIC -I. -I/home/vecc/root/include -c InoHitDict.cxx
In file included from InoHitDict.cxx:16:
InoHitDict.h:52: syntax error before ;' token InoHitDict.cxx:28:30: TCollectionProxy.h: No such file or directory InoHitDict.cxx: In function ROOT::TGenericClassInfo*
ROOT::GenerateInitInstance(const InoHit*)‘:[/color]
[color=blue]InoHitDict.cxx:54: invalid conversion from void*(*)(long int)' to
void*()(long int, void)’
InoHitDict.cxx:54: initializing argument 1 of void ROOT::TGenericClassInfo::SetNewArray(void*(*)(long int, void*))' InoHitDict.cxx: In function ROOT::TGenericClassInfo*
ROOT::GenerateInitInstance(const std::vector<InoHit, std::allocator

)':
InoHitDict.cxx:172: invalid conversion from void*(*)(long int)' to
void
()(long int, void)’
InoHitDict.cxx:172: initializing argument 1 of void ROOT::TGenericClassInfo::SetNewArray(void*(*)(long int, void*))' InoHitDict.cxx:176: TCollectionProxy’ undeclared (first use this function)
InoHitDict.cxx:176: (Each undeclared identifier is reported only once for each
function it appears in.)
InoHitDict.cxx:176: syntax error before ::' token InoHitDict.cxx:177: syntax error before ::’ token
make: *** [InoHitDict.o] Error 1[/color][/color]
regards.
tapasi

Hi,

you have been using an old rootcint from one version, and try to build the dictionary using root from another version. That’s not supported. Make sure your $PATH and $ROOTSYS point to the proper version in both cases.

Cheers, Axel.

Hi Axel
Can you tell me how to build the dictionary file? That will be realy helpful for me.
Regards.
Tapasi

Hi,

your Makefile does it for you already:

InoHitDict.$(SrcSuf): InoHit.h InoHitLinkDef.h @echo "Generating dictionary $@..." @rootcint -f $@ -c $^
So just remove InoHitDict.cxx and it should be rebuilt. As in:

rm InoHitDict.cxx echo $ROOTSYS; which rootcint; echo $PATH; echo $LD_LIBRARY_PATH # check for consistent ROOT version make

Cheers, Axel.