]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/src/Makefile_Root
Comments formatted the way THtml likes it.
[u/mrichter/AliRoot.git] / HLT / src / Makefile_Root
CommitLineData
108615fc 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.
4#
5# Copyright (c) 2000 Rene Brun and Fons Rademakers
6#
7# Author: Fons Rademakers, 29/2/2000
8
9ARCH = linuxegcs
10# ARCH = linuxalphaegcs
11
12CXX =
13ObjSuf = o
14SrcSuf = cxx
15ExeSuf =
16DllSuf = so
17OutPutOpt = -o
18
19EVENTLIB = $(EVENTSO)
20
21ROOTCFLAGS := $(shell root-config --cflags)
22ROOTLIBS := $(shell root-config --libs)
23ROOTGLIBS := $(shell root-config --glibs)
24
25
26ifeq ($(ARCH),hpux)
27# HP-UX with CC
28CXX = CC
29CXXFLAGS = -O +Z
30LD = CC
31LDFLAGS = -O +a1 -z
32SOFLAGS = -b
33DllSuf = sl
34endif
35
36ifeq ($(ARCH),hpuxacc)
37# HP-UX 10.x with aCC
38CXX = aCC
39CXXFLAGS = -O +Z
40LD = aCC
41LDFLAGS = -O -z
42SOFLAGS = -b
43endif
44
45ifeq ($(ARCH),hpuxegcs)
46# HP-UX 10.x with g++
47CXXFLAGS = -O -fPIC
48CXX = g++
49LD = g++
50LDFLAGS = -O
51SOFLAGS = -fPIC -shared
52endif
53
54ifeq ($(ARCH),aix)
55# IBM AIX
56CXX = xlC
57CXXFLAGS = -O
58LD = xlC
59LDFLAGS = -O
60SOFLAGS =
61endif
62
63ifeq ($(ARCH),aixegcs)
64# IBM AIX with GCC
65CXX = g++
66CXXFLAGS = -O
67LD = g++
68LDFLAGS = -O
69SOFLAGS = -shared
70endif
71
72ifeq ($(ARCH),solaris)
73# Solaris CC
74CXX = /opt/SUNWspro/bin/CC
75CXXFLAGS = -O -KPIC
76LD = /opt/SUNWspro/bin/CC
77LDFLAGS = -O
78SOFLAGS = -G
79endif
80
81ifeq ($(ARCH),solarisCC5)
82# Solaris CC 5.0
83CXX = CC
84CXXFLAGS = -O -KPIC -D__SunOS_5_6 -library=iostream,no%Cstd
85LD = CC
86LDFLAGS = -O -library=iostream,no%Cstd -o
87SOFLAGS = -G
88endif
89
90ifeq ($(ARCH),solarisegcs)
91# Solaris egcs
92CXX = g++
93CXXFLAGS = -O -fPIC
94LD = CC
95LDFLAGS = -O
96SOFLAGS = -shared
97endif
98
99ifeq ($(ARCH),solarisgcc)
100# Solaris gcc
101CXX = g++
102CXXFLAGS = -O -fPIC
103LD = g++
104LDFLAGS = -O
105SOFLAGS = -shared
106endif
107
108ifeq ($(ARCH),solariskcc)
109# Solaris kcc
110CXX = KCC
111CXXFLAGS = -O4 -KPIC
112LD = KCC
113LDFLAGS = -O4
114SOFLAGS =
115endif
116
117ifeq ($(ARCH),solarisx86)
118# Solaris CC on Intel
119CXX = CC
120CXXFLAGS = -O -KPIC
121LD = CC
122LDFLAGS = -O
123SOFLAGS = -G
124endif
125
126ifeq ($(ARCH),sgicc)
127# SGI
128CXX = CC -n32 -I/usr/include/CC.sgi
129CXXFLAGS = -O
130LD = CC -n32 -I/usr/include/CC.sgi
131LDFLAGS = -O
132SOFLAGS = -shared
133endif
134
135ifeq ($(ARCH),sgiegcs)
136# SGI 6.x with EGCS
137CXX = g++
138CXXFLAGS = -O -Wall -fPIC
139LD = g++
140LDFLAGS = -O -Wl,-u,__builtin_new -Wl,-u,__builtin_delete -Wl,-u,__nw__FUiPv
141SOFLAGS = -shared
142endif
143
144ifeq ($(ARCH),sgin32egcs)
145# SGI 6.x with EGCS for n32 ABI
146CXX = g++
147CXXFLAGS = -O -Wall -fPIC
148LD = g++
149LDFLAGS = -O -L/usr/lib32 -Wl,-woff,134
150SOFLAGS = -shared
151endif
152
153ifeq ($(ARCH),sgigcc)
154# SGI with GCC
155CXX = g++
156CXXFLAGS = -O -Wall -fPIC
157LD = g++
158LDFLAGS = -O -Wl,-u,__builtin_new -Wl,-u,__builtin_delete -Wl,-u,__nw__FUiPv
159SOFLAGS = -shared
160endif
161
162ifeq ($(ARCH),sgikcc)
163# SGI with KCC
164CXX = KCC -n32 --no_exceptions
165CXXFLAGS = -O
166LD = KCC -n32 --no_exceptions
167LDFLAGS = -O
168SOFLAGS =
169endif
170
171ifeq ($(ARCH),alphagcc)
172# Alpha/OSF with g++
173CXX = g++
174CXXFLAGS = -O -Wall -fPIC
175LD = g++
176LDFLAGS = -O
177SOFLAGS = -Wl,-expect_unresolved,* -shared
178endif
179
180ifeq ($(ARCH),alphaegcs)
181# Alpha/OSF with egcs
182CXX = g++
183CXXFLAGS = -O -Wall -fPIC
184LD = g++
185LDFLAGS = -O
186SOFLAGS = -Wl,-expect_unresolved,* -shared
187endif
188
189ifeq ($(ARCH),alphakcc)
190# Alpha/OSF with kai compiler (not yet valid)
191CXX = g++
192CXXFLAGS = -O -fPIC
193LD = g++
194LDFLAGS = -O
195SOFLAGS = -Wl,-expect_unresolved,* -shared
196endif
197
198ifeq ($(ARCH),alphacxx6)
199# Alpha/OSF with cxx6
200CXX = cxx
201CXXFLAGS = -O0
202LD = cxx
203LDFLAGS = -O
204SOFLAGS = -Wl,-expect_unresolved,* -shared
205endif
206
207ifeq ($(ARCH),alphacxx)
208# Alpha/OSF with cxx5
209CXX = cxx
210CXXFLAGS = -O
211LD = cxx
212LDFLAGS = -O
213SOFLAGS = -Wl,-expect_unresolved,* -call_shared
214endif
215
216ifeq ($(ARCH),linux)
217# Linux with gcc 2.7.2.x
218CXX = g++
219CXXFLAGS = -O -Wall -fPIC
220LD = g++
221LDFLAGS = -O
222SOFLAGS = -shared
223endif
224
225ifeq ($(ARCH),linuxrh42)
226# Linux with gcc 2.7.2.x (RedHat 4.2)
227CXX = g++
228CXXFLAGS = -O -Wall -fPIC
229LD = g++
230LDFLAGS = -O
231SOFLAGS = -shared
232endif
233
234ifeq ($(ARCH),linuxdeb)
235# Linux with gcc 2.7.2.x
236CXX = g++
237CXXFLAGS = -O -Wall -fPIC
238LD = g++
239LDFLAGS = -O
240SOFLAGS = -shared
241endif
242
243ifeq ($(ARCH),linuxdeb2)
244# Linux with gcc 2.7.2.x
245CXX = g++
246CXXFLAGS = -O -Wall -fPIC
247LD = g++
248LDFLAGS = -O
249SOFLAGS = -shared
250endif
251
252ifeq ($(ARCH),linuxsuse6)
253# Linux with gcc 2.7.2.x
254CXX = g++
255CXXFLAGS = -O -Wall -fPIC
256LD = g++
257LDFLAGS = -O
258SOFLAGS = -shared
259endif
260
261ifeq ($(ARCH),linuxegcs)
262# Linux with egcs (>= RedHat 5.2)
263CXX = g++
264CXXFLAGS = -O2 -Wall -fPIC
265LD = g++
266LDFLAGS = -O2
267SOFLAGS = -shared
268endif
269
270ifeq ($(ARCH),linuxkcc)
271# Linux with the KAI compiler
272CXX = KCC
273CXXFLAGS = -fPIC +K0
274LD = KCC
275LDFLAGS = -O
276SOFLAGS =
277endif
278
279ifeq ($(ARCH),linuxppcegcs)
280# MkLinux with egcs/glibc
281CXX = g++
282CXXFLAGS = -O -Wall -fPIC
283LD = g++
284LDFLAGS = -O
285SOFLAGS = -shared -Wl,-soname,
286endif
287
288ifeq ($(ARCH),linuxia64gcc)
289# Itanium Linux with gcc 2.9x
290CXX = g++
291CXXFLAGS = -O -Wall -fPIC
292LD = g++
293LDFLAGS = -O
294SOFLAGS = -shared
295endif
296
297ifeq ($(ARCH),linuxalphaegcs)
298# Alpha Linux with egcs
299CXX = g++
300CXXFLAGS = -O2 -Wall -fPIC -mcpu=ev6
301LD = g++
302LDFLAGS = -O2
303SOFLAGS = -shared -mcpu=ev6
304endif
305
306ifeq ($(ARCH),mklinux)
307# MkLinux with libc5
308CXX = g++
309CXXFLAGS = -O -Wall -fPIC
310LD = g++
311LDFLAGS = -O
312SOFLAGS = -shared -Wl,-soname,
313endif
314
315ifeq ($(ARCH),freebsd)
316# FreeBSD with libc5
317CXX = g++
318CXXFLAGS = -O -pipe -W -Wall -fPIC
319LD = g++
320LDFLAGS = -O
321SOFLAGS = -shared -Wl,-x
322endif
323
324ifeq ($(ARCH),freebsd4)
325# FreeBSD with glibc
326CXX = g++
327CXXFLAGS = -O -pipe -W -Wall -fPIC
328LD = g++
329LDFLAGS = -O
330SOFLAGS = -shared -Wl,-x
331endif
332
333ifeq ($(ARCH),hiux)
334# Hitachi HIUX
335CXX = g++
336CXXFLAGS = -O2 -fPIC
337LD = g++
338LDFLAGS = -Wl,+s
339SOFLAGS = -Wl,-b,-E -nostdlib -nostartfiles
340DllSuf = sl
341endif
342
343ifeq ($(ARCH),win32)
344# Windows with the VC++ compiler
345ObjSuf = obj
346SrcSuf = cxx
347ExeSuf = .exe
348DllSuf = dll
349OutPutOpt = -out:
350CXX = cl
351CXXOPT = -O2
352#CXXOPT = -Z7
353CXXFLAGS = $(CXXOPT) -G5 -MD -DWIN32 -D_WINDOWS -nologo \
354 -DVISUAL_CPLUSPLUS -D_X86_=1 -D_DLL
355LD = link
356LDOPT = -opt:ref
357#LDOPT = -debug
358LDFLAGS = $(LDOPT) -pdb:none -nologo -nodefaultlib -incremental:no
359SOFLAGS = -DLL
360SYSLIBS = msvcrt.lib oldnames.lib kernel32.lib ws2_32.lib mswsock.lib \
361 advapi32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib \
362 msvcirt.lib
363EVENTLIB = libEvent.lib
364
365ROOTLIBS := $(shell root-config --nonew --libs)
366ROOTGLIBS := $(shell root-config --nonew --glibs)
367endif
368
369ifeq ($(CXX),)
370$(error $(ARCH) invalid architecture)
371endif
372
373CXXFLAGS += $(ROOTCFLAGS)
374LIBS = $(ROOTLIBS) $(SYSLIBS)
375GLIBS = $(ROOTGLIBS) $(SYSLIBS)
376
377#------------------------------------------------------------------------------
378
2e1fe9ef 379SRCS = AliL3ConfMapper.cxx AliL3ConfMapPoint.cxx AliLevel3.cxx\
108615fc 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\
386
387HDRS = $(SRCS:.cxx=.h) AliL3LinkDef.h
388
389DICT = AliL3Cint.cxx
390DICTH = $(DICT:.cxx=.h)
391DICTO = $(DICT:.cxx=.o)
392
393OBJS = $(SRCS:.cxx=.o) $(DICTO)
394
395LEVELSO = libAliL3.$(DllSuf)
396
397PROGRAMS = $(LEVELSO)
398
399#------------------------------------------------------------------------------
400
401.SUFFIXES: .$(SrcSuf) .$(ObjSuf) .$(DllSuf)
402
403all: $(PROGRAMS)
404
405
406$(LEVELSO): $(OBJS)
407ifeq ($(ARCH),aix)
408 /usr/ibmcxx/bin/makeC++SharedLib $(OutPutOpt) $(LEVELSO) $(LIBS) -p 0 $(OBJS)
409else
410ifeq ($(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
416else
417ifeq ($(ARCH),win32)
418 $(LD) $(SOFLAGS) $(LDFLAGS) $^ $(LIBS) $(OutPutOpt)$@
419else
420 $(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@
421endif
422endif
423endif
424
425clean:
426 @rm -f $(OBJS) $(DICT) $(DICTH) $(PROGRAMS) core
427
428distclean: clean
429 @rm -f $(PROGRAMS) $(EVENTSO) $(EVENTLIB) *Dict.* *.def *.exp \
430 *.root *.ps .def so_locations
1406049c 431mrproper:
432 @rm -f $(OBJS) $(DICT) $(DICTH) core
433
434wipe: clean mrproper
435
108615fc 436
437.SUFFIXES: .$(SrcSuf)
438
439###
440
441#AliL3LinkDef.$(ObjSuf): fwhm.h
442
443$(DICT): $(HDRS)
444 @echo "Generating dictionary HelloDict..."
445 @rootcint -f $(DICT) -c $(HDRS)
446
447
448.$(SrcSuf).$(ObjSuf):
449 $(CXX) $(CXXFLAGS) -c $<