1 # Makefile for the ROOT test programs.
2 # This Makefile shows nicely how to compile and link applications
3 # using the ROOT libraries on all supported platforms.
5 # Copyright (c) 2000 Rene Brun and Fons Rademakers
7 # Author: Fons Rademakers, 29/2/2000
10 # ARCH = linuxalphaegcs
21 ROOTCFLAGS := $(shell root-config --cflags)
22 ROOTLIBS := $(shell root-config --libs)
23 ROOTGLIBS := $(shell root-config --glibs)
36 ifeq ($(ARCH),hpuxacc)
45 ifeq ($(ARCH),hpuxegcs)
51 SOFLAGS = -fPIC -shared
63 ifeq ($(ARCH),aixegcs)
72 ifeq ($(ARCH),solaris)
74 CXX = /opt/SUNWspro/bin/CC
76 LD = /opt/SUNWspro/bin/CC
81 ifeq ($(ARCH),solarisCC5)
84 CXXFLAGS = -O -KPIC -D__SunOS_5_6 -library=iostream,no%Cstd
86 LDFLAGS = -O -library=iostream,no%Cstd -o
90 ifeq ($(ARCH),solarisegcs)
99 ifeq ($(ARCH),solarisgcc)
108 ifeq ($(ARCH),solariskcc)
117 ifeq ($(ARCH),solarisx86)
118 # Solaris CC on Intel
128 CXX = CC -n32 -I/usr/include/CC.sgi
130 LD = CC -n32 -I/usr/include/CC.sgi
135 ifeq ($(ARCH),sgiegcs)
138 CXXFLAGS = -O -Wall -fPIC
140 LDFLAGS = -O -Wl,-u,__builtin_new -Wl,-u,__builtin_delete -Wl,-u,__nw__FUiPv
144 ifeq ($(ARCH),sgin32egcs)
145 # SGI 6.x with EGCS for n32 ABI
147 CXXFLAGS = -O -Wall -fPIC
149 LDFLAGS = -O -L/usr/lib32 -Wl,-woff,134
153 ifeq ($(ARCH),sgigcc)
156 CXXFLAGS = -O -Wall -fPIC
158 LDFLAGS = -O -Wl,-u,__builtin_new -Wl,-u,__builtin_delete -Wl,-u,__nw__FUiPv
162 ifeq ($(ARCH),sgikcc)
164 CXX = KCC -n32 --no_exceptions
166 LD = KCC -n32 --no_exceptions
171 ifeq ($(ARCH),alphagcc)
174 CXXFLAGS = -O -Wall -fPIC
177 SOFLAGS = -Wl,-expect_unresolved,* -shared
180 ifeq ($(ARCH),alphaegcs)
181 # Alpha/OSF with egcs
183 CXXFLAGS = -O -Wall -fPIC
186 SOFLAGS = -Wl,-expect_unresolved,* -shared
189 ifeq ($(ARCH),alphakcc)
190 # Alpha/OSF with kai compiler (not yet valid)
195 SOFLAGS = -Wl,-expect_unresolved,* -shared
198 ifeq ($(ARCH),alphacxx6)
199 # Alpha/OSF with cxx6
204 SOFLAGS = -Wl,-expect_unresolved,* -shared
207 ifeq ($(ARCH),alphacxx)
208 # Alpha/OSF with cxx5
213 SOFLAGS = -Wl,-expect_unresolved,* -call_shared
217 # Linux with gcc 2.7.2.x
219 CXXFLAGS = -O -Wall -fPIC
225 ifeq ($(ARCH),linuxrh42)
226 # Linux with gcc 2.7.2.x (RedHat 4.2)
228 CXXFLAGS = -O -Wall -fPIC
234 ifeq ($(ARCH),linuxdeb)
235 # Linux with gcc 2.7.2.x
237 CXXFLAGS = -O -Wall -fPIC
243 ifeq ($(ARCH),linuxdeb2)
244 # Linux with gcc 2.7.2.x
246 CXXFLAGS = -O -Wall -fPIC
252 ifeq ($(ARCH),linuxsuse6)
253 # Linux with gcc 2.7.2.x
255 CXXFLAGS = -O -Wall -fPIC
261 ifeq ($(ARCH),linuxegcs)
262 # Linux with egcs (>= RedHat 5.2)
264 CXXFLAGS = -O2 -Wall -fPIC
270 ifeq ($(ARCH),linuxkcc)
271 # Linux with the KAI compiler
279 ifeq ($(ARCH),linuxppcegcs)
280 # MkLinux with egcs/glibc
282 CXXFLAGS = -O -Wall -fPIC
285 SOFLAGS = -shared -Wl,-soname,
288 ifeq ($(ARCH),linuxia64gcc)
289 # Itanium Linux with gcc 2.9x
291 CXXFLAGS = -O -Wall -fPIC
297 ifeq ($(ARCH),linuxalphaegcs)
298 # Alpha Linux with egcs
300 CXXFLAGS = -O2 -Wall -fPIC -mcpu=ev6
303 SOFLAGS = -shared -mcpu=ev6
306 ifeq ($(ARCH),mklinux)
309 CXXFLAGS = -O -Wall -fPIC
312 SOFLAGS = -shared -Wl,-soname,
315 ifeq ($(ARCH),freebsd)
318 CXXFLAGS = -O -pipe -W -Wall -fPIC
321 SOFLAGS = -shared -Wl,-x
324 ifeq ($(ARCH),freebsd4)
327 CXXFLAGS = -O -pipe -W -Wall -fPIC
330 SOFLAGS = -shared -Wl,-x
339 SOFLAGS = -Wl,-b,-E -nostdlib -nostartfiles
344 # Windows with the VC++ compiler
353 CXXFLAGS = $(CXXOPT) -G5 -MD -DWIN32 -D_WINDOWS -nologo \
354 -DVISUAL_CPLUSPLUS -D_X86_=1 -D_DLL
358 LDFLAGS = $(LDOPT) -pdb:none -nologo -nodefaultlib -incremental:no
360 SYSLIBS = msvcrt.lib oldnames.lib kernel32.lib ws2_32.lib mswsock.lib \
361 advapi32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib \
363 EVENTLIB = libEvent.lib
365 ROOTLIBS := $(shell root-config --nonew --libs)
366 ROOTGLIBS := $(shell root-config --nonew --glibs)
370 $(error $(ARCH) invalid architecture)
373 CXXFLAGS += $(ROOTCFLAGS)
374 LIBS = $(ROOTLIBS) $(SYSLIBS)
375 GLIBS = $(ROOTGLIBS) $(SYSLIBS)
377 #------------------------------------------------------------------------------
379 SRCS = AliL3ConfMapper.cxx AliL3ConfMapPoint.cxx AliLevel3.cxx\
380 AliL3ConfMapTrack.cxx AliL3ConfMapFit.cxx AliL3Track.cxx\
381 AliL3Transform.cxx AliL3TrackMerger.cxx AliL3VertexArray.cxx \
382 AliL3Vertex.cxx AliL3VertexFinder.cxx AliL3HoughTrack.cxx\
383 AliL3Merger.cxx AliL3GlobalMerger.cxx AliL3ClustFinder.cxx \
384 AliL3TrackArray.cxx AliL3InterMerger.cxx AliL3Logger.cxx \
385 AliL3MemHandler.cxx AliL3Benchmark.cxx\
387 HDRS = $(SRCS:.cxx=.h) AliL3LinkDef.h
390 DICTH = $(DICT:.cxx=.h)
391 DICTO = $(DICT:.cxx=.o)
393 OBJS = $(SRCS:.cxx=.o) $(DICTO)
395 LEVELSO = libAliL3.$(DllSuf)
397 PROGRAMS = $(LEVELSO)
399 #------------------------------------------------------------------------------
401 .SUFFIXES: .$(SrcSuf) .$(ObjSuf) .$(DllSuf)
408 /usr/ibmcxx/bin/makeC++SharedLib $(OutPutOpt) $(LEVELSO) $(LIBS) -p 0 $(OBJS)
410 ifeq ($(ARCH),alphacxx)
411 # due to a bug in cxx/ld under osf3.xx, one cannot use cxx to generate
412 # a shared library. One must use ld instead.
413 ld -L/usr/lib/cmplrs/cxx -rpath /usr/lib/cmplrs/cxx -expect_unresolved "*" \
414 -g0 -O1 -shared /usr/lib/cmplrs/cc/crt0.o /usr/lib/cmplrs/cxx/_main.o \
415 -o Hello.so Hello.o HelloDict.o -lcxxstd -lcxx -lexc -lots -lc
418 $(LD) $(SOFLAGS) $(LDFLAGS) $^ $(LIBS) $(OutPutOpt)$@
420 $(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@
426 @rm -f $(OBJS) $(DICT) $(DICTH) $(PROGRAMS) core
429 @rm -f $(PROGRAMS) $(EVENTSO) $(EVENTLIB) *Dict.* *.def *.exp \
430 *.root *.ps .def so_locations
432 .SUFFIXES: .$(SrcSuf)
436 #AliL3LinkDef.$(ObjSuf): fwhm.h
439 @echo "Generating dictionary HelloDict..."
440 @rootcint -f $(DICT) -c $(HDRS)
443 .$(SrcSuf).$(ObjSuf):
444 $(CXX) $(CXXFLAGS) -c $<