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