- Implementing functions for the GRP preprocessor to retrieve DA output files from...
[u/mrichter/AliRoot.git] / SHUTTLE / DCSClient / Makefile.arch
1 # -*- mode: makefile -*-
2 #
3 # Makefile containing platform dependencies for ROOT based projects.
4 #
5 # Copyright (c) 2000 Rene Brun and Fons Rademakers
6 #
7 # Author: Fons Rademakers, 29/2/2000
8
9 ARCH         := $(shell root-config --arch)
10 PLATFORM     := $(shell root-config --platform)
11
12 CXX           =
13 ObjSuf        = o
14 SrcSuf        = cxx
15 ExeSuf        =
16 DllSuf        = so
17 OutPutOpt     = -o # keep whitespace after "-o"
18
19 ROOTCFLAGS   := $(shell root-config --cflags)
20 ROOTLDFLAGS  := $(shell root-config --ldflags)
21 ROOTLIBS     := $(shell root-config --libs)
22 ROOTGLIBS    := $(shell root-config --glibs)
23 HASTHREAD    := $(shell root-config --has-thread)
24
25 ifeq ($(ARCH),hpuxacc)
26 # HP-UX 10.x with aCC
27 CXX           = aCC
28 CXXFLAGS      = -O +Z
29 LD            = aCC
30 LDFLAGS       = -O -z
31 SOFLAGS       = -b
32 endif
33
34 ifeq ($(ARCH),hpuxia64acc)
35 # HP-UX 11i 1.5 (IA-64) with aCC
36 CXX           = aCC
37 CXXFLAGS      = +DD64 -O +Z
38 LD            = aCC
39 LDFLAGS       = +DD64 -O -z
40 SOFLAGS       = -b
41 endif
42
43 ifeq ($(ARCH),hpuxegcs)
44 # HP-UX 10.x with g++
45 CXXFLAGS      = -O -fPIC
46 CXX           = g++
47 LD            = g++
48 LDFLAGS       = -O
49 SOFLAGS       = -fPIC -shared
50 endif
51
52 ifeq ($(ARCH),hurddeb)
53 # GNU/Hurd
54 CXX           = g++
55 CXXFLAGS      = -O2 -Wall -fPIC
56 LD            = g++
57 LDFLAGS       = -O2
58 SOFLAGS       = -shared
59 endif
60
61 ifeq ($(ARCH),aix)
62 # IBM AIX xlC 4.x
63 CXX           = xlC
64 CXXFLAGS      = -O
65 LD            = xlC
66 LDFLAGS       = -O
67 SOFLAGS       =
68 ROOTLIBS     := $(shell root-config --nonew --libs)
69 ROOTGLIBS    := $(shell root-config --nonew --glibs)
70 endif
71
72 ifeq ($(ARCH),aix5)
73 # IBM AIX xlC 5.x
74 CXX           = xlC
75 CXXFLAGS      = -O
76 LD            = xlC
77 LDFLAGS       = -O
78 SOFLAGS       =
79 ROOTLIBS     := $(shell root-config --nonew --libs)
80 ROOTGLIBS    := $(shell root-config --nonew --glibs)
81 endif
82
83 ifeq ($(ARCH),aixegcs)
84 # IBM AIX with GCC
85 CXX           = g++
86 CXXFLAGS      = -O
87 LD            = g++
88 LDFLAGS       = -O
89 SOFLAGS       = -shared
90 endif
91
92 ifeq ($(ARCH),solaris)
93 # Solaris CC
94 CXX           = /opt/SUNWspro/bin/CC
95 CXXFLAGS      = -O -KPIC
96 LD            = /opt/SUNWspro/bin/CC
97 LDFLAGS       = -O
98 SOFLAGS       = -G
99 endif
100
101 ifeq ($(ARCH),solarisCC5)
102 # Solaris CC 5.0
103 CXX           = CC
104 CXXFLAGS      = -O -KPIC
105 LD            = CC
106 LDFLAGS       = -O
107 SOFLAGS       = -G
108 endif
109
110 ifeq ($(ARCH),solarisgcc)
111 # Solaris gcc
112 CXX           = g++
113 CXXFLAGS      = -O -fPIC
114 LD            = g++
115 LDFLAGS       = -O
116 SOFLAGS       = -shared
117 endif
118
119 ifeq ($(ARCH),solariskcc)
120 # Solaris kcc
121 CXX           = KCC --one_instantiation_per_object
122 CXXFLAGS      = -O4 -KPIC
123 LD            = KCC
124 LDFLAGS       = -O4
125 SOFLAGS       =
126 endif
127
128 ifeq ($(ARCH),solarisx86)
129 # Solaris CC on Intel
130 CXX           = CC
131 CXXFLAGS      = -O -KPIC
132 LD            = CC
133 LDFLAGS       = -O
134 SOFLAGS       = -G
135 endif
136
137 ifeq ($(ARCH),sgicc)
138 # SGI
139 CXX           = CC -n32  -I/usr/include/CC.sgi
140 CXXFLAGS      = -O
141 LD            = CC -n32 -LANG:std  -I/usr/include/CC.sgi
142 LDFLAGS       = -O
143 SOFLAGS       = -shared
144 endif
145
146 ifeq ($(ARCH),sgicc64)
147 # SGI
148 CXX           = CC -64  -I/usr/include/CC.sgi
149 CXXFLAGS      = -O
150 LD            = CC -64 -LANG:std -I/usr/include/CC.sgi
151 LDFLAGS       = -O
152 SOFLAGS       = -shared
153 endif
154
155 ifeq ($(ARCH),sgiegcs)
156 # SGI 6.x with EGCS
157 CXX           = g++
158 CXXFLAGS      = -O -Wall -fPIC
159 LD            = g++
160 LDFLAGS       = -O -Wl,-u,__builtin_new -Wl,-u,__builtin_delete -Wl,-u,__nw__FUiPv
161 SOFLAGS       = -shared
162 endif
163
164 ifeq ($(ARCH),sgin32egcs)
165 # SGI 6.x with EGCS for n32 ABI
166 CXX           = g++
167 CXXFLAGS      = -O -Wall -fPIC
168 LD            = g++
169 LDFLAGS       = -O -L/usr/lib32 -Wl,-woff,134
170 SOFLAGS       = -shared
171 endif
172
173 ifeq ($(ARCH),sgikcc)
174 # SGI with KCC
175 CXX           = KCC -n32 --one_instantiation_per_object
176 CXXFLAGS      = -O
177 LD            = KCC -n32
178 LDFLAGS       = -O
179 SOFLAGS       =
180 endif
181
182 ifeq ($(ARCH),alphaegcs)
183 # Alpha/OSF with egcs
184 CXX           = g++
185 CXXFLAGS      = -O2 -Wall -fPIC
186 LD            = g++
187 LDFLAGS       = -O2
188 SOFLAGS       = -Wl,-expect_unresolved,* -shared
189 endif
190
191 ifeq ($(ARCH),alphakcc)
192 # Alpha/OSF with kai compiler (not yet valid)
193 CXX           = KCC --one_instantiation_per_object
194 CXXFLAGS      = -O -fPIC
195 LD            = KCC
196 LDFLAGS       = -O
197 SOFLAGS       = -Wl,-expect_unresolved,* -shared
198 endif
199
200 ifeq ($(ARCH),alphacxx6)
201 # Alpha/OSF with cxx6
202 CXX           = cxx
203 CXXFLAGS      = -O
204 LD            = cxx
205 LDFLAGS       = -O
206 SOFLAGS       = -shared -nocxxstd -Wl,-expect_unresolved,*,-msym
207 endif
208
209 ifeq ($(ARCH),linuxrh51)
210 # Linux with gcc 2.7.2.x
211 CXX           = g++
212 CXXFLAGS      = -O2 -Wall -fPIC
213 LD            = g++
214 LDFLAGS       = -O2
215 SOFLAGS       = -shared
216 endif
217
218 ifeq ($(ARCH),linuxrh42)
219 # Linux with gcc 2.7.2.x (RedHat 4.2)
220 CXX           = g++
221 CXXFLAGS      = -O2 -Wall -fPIC
222 LD            = g++
223 LDFLAGS       = -O2
224 SOFLAGS       = -shared
225 endif
226
227 ifeq ($(ARCH),linuxdeb)
228 # Linux with gcc 2.7.2.x
229 CXX           = g++
230 CXXFLAGS      = -O1 -Wall -fPIC
231 LD            = g++
232 LDFLAGS       = -O1
233 SOFLAGS       = -shared
234 endif
235
236 ifeq ($(ARCH),linuxdeb2)
237 # Linux with gcc 2.7.2.x
238 CXX           = g++
239 CXXFLAGS      = -O2 -Wall -fPIC
240 LD            = g++
241 LDFLAGS       = -O2
242 SOFLAGS       = -shared
243 endif
244
245 ifeq ($(ARCH),linuxdeb2ppc)
246 # Debian/Linux on the PowerPC
247 CXX           = g++
248 CXXFLAGS      = -O2 -Wall -fPIC
249 LD            = g++
250 LDFLAGS       = -O2
251 SOFLAGS       = -shared
252 endif
253
254 ifeq ($(ARCH),linuxsuse6)
255 # Linux with gcc 2.7.2.x
256 CXX           = g++
257 CXXFLAGS      = -O2 -Wall -fPIC
258 LD            = g++
259 LDFLAGS       = -O2
260 SOFLAGS       = -shared
261 endif
262
263 ifeq ($(ARCH),linux)
264 # Linux with egcs, gcc 2.9x, gcc 3.x (>= RedHat 5.2)
265 CXX           = g++
266 CXXFLAGS      = -O -Wall -fPIC
267 LD            = g++
268 LDFLAGS       = -O
269 SOFLAGS       = -shared
270 endif
271
272 ifeq ($(ARCH),linuxkcc)
273 # Linux with the KAI compiler
274 CXX           = KCC --one_instantiation_per_object
275 CXXFLAGS      = -O -fPIC +K0
276 LD            = KCC
277 LDFLAGS       = -O $(shell root-config --cflags)
278 SOFLAGS       =
279 endif
280
281 ifeq ($(ARCH),linuxicc)
282 # Linux with Intel icc compiler
283 ICC_MAJOR    := $(shell icc -v 2>&1 | awk '{ if (NR==1) print $$2 }' | \
284                 cut -d'.' -f1)
285 ICC_MINOR    := $(shell icc -v 2>&1 | awk '{ if (NR==1) print $$2 }' | \
286                 cut -d'.' -f2)
287 CXX           = icc
288 CXXFLAGS      = -O -fPIC -wd1476
289 LD            = icpc
290 LDFLAGS       = -O
291 SOFLAGS       = -shared
292 ifeq ($(ICC_MAJOR),8)
293 ifneq ($(ICC_MINOR),0)
294 CXXFLAGS     += -wd1572
295 endif
296 endif
297 endif
298
299 ifeq ($(ARCH),linuxppcegcs)
300 # MkLinux with egcs/glibc
301 CXX           = g++
302 CXXFLAGS      = -O2 -Wall -fPIC
303 LD            = g++
304 LDFLAGS       = -O2
305 SOFLAGS       = -shared
306 endif
307
308 ifeq ($(ARCH),linuxia64gcc)
309 # Itanium Linux with gcc 2.9x
310 CXX           = g++
311 CXXFLAGS      = -O2 -Wall -fPIC
312 LD            = g++
313 LDFLAGS       = -O2
314 SOFLAGS       = -shared
315 endif
316
317 ifeq ($(ARCH),linuxia64sgi)
318 # Itanium Linux with sgiCC
319 CXX           = sgiCC
320 CXXFLAGS      = -O -Wall -fPIC
321 LD            = gsgiCC
322 LDFLAGS       = -O
323 SOFLAGS       = -shared
324 endif
325
326 ifeq ($(ARCH),linuxia64ecc)
327 # Itanium Linux with Intel icc (was ecc)
328 ICC_MAJOR    := $(shell icc -v 2>&1 | awk '{ if (NR==1) print $$2 }' | \
329                 cut -d'.' -f1)
330 ICC_MINOR    := $(shell icc -v 2>&1 | awk '{ if (NR==1) print $$2 }' | \
331                 cut -d'.' -f2)
332 CXX           = icc
333 CXXFLAGS      = -O -fPIC -wd1476
334 LD            = icpc
335 LDFLAGS       = -O
336 SOFLAGS       = -shared
337 ifeq ($(ICC_MAJOR),8)
338 ifneq ($(ICC_MINOR),0)
339 CXXFLAGS     += -wd1572
340 endif
341 endif
342 endif
343
344 ifeq ($(ARCH),linuxx8664gcc)
345 # AMD Opteron and Intel EM64T (64 bit mode) Linux with gcc 3.x
346 CXX           = g++
347 CXXFLAGS      = -O2 -Wall -fPIC
348 LD            = g++
349 LDFLAGS       = -O2
350 SOFLAGS       = -shared
351 endif
352
353 ifeq ($(ARCH),linuxppc64gcc)
354 # PPC64 Linux with gcc 3.x
355 CXX           = g++
356 CXXFLAGS      = -O -Wall -fPIC
357 LD            = g++
358 LDFLAGS       = -O
359 SOFLAGS       = -shared
360 endif
361
362 ifeq ($(ARCH),linuxx8664icc)
363 # AMD Opteron and Intel EM64T (64 bit mode) Linux with Intel icc compiler
364 CXX           = icc
365 CXXFLAGS      = -O -fPIC -wd1476 -wd1572
366 LD            = icpc
367 LDFLAGS       = -O
368 SOFLAGS       = -shared
369 endif
370
371 ifeq ($(ARCH),linuxalphaegcs)
372 # Alpha Linux with egcs
373 CXX           = g++
374 CXXFLAGS      = -O2 -Wall -fPIC
375 LD            = g++
376 LDFLAGS       = -O2
377 SOFLAGS       = -shared
378 endif
379
380 ifeq ($(ARCH),linuxarm)
381 # ARM Linux with egcs
382 CXX           = g++
383 CXXFLAGS      = -O -Wall -fPIC
384 LD            = g++
385 LDFLAGS       = -O
386 SOFLAGS       = -shared
387 endif
388
389 ifeq ($(ARCH),mklinux)
390 # MkLinux with libc5
391 CXX           = g++
392 CXXFLAGS      = -O2 -Wall -fPIC
393 LD            = g++
394 LDFLAGS       = -O2
395 SOFLAGS       = -shared
396 endif
397
398 ifeq ($(ARCH),freebsd)
399 # FreeBSD with libc5
400 CXX           = g++
401 CXXFLAGS      = -O -pipe -W -Wall -fPIC
402 LD            = g++
403 LDFLAGS       = -O
404 SOFLAGS       = -shared -Wl,-x
405 endif
406
407 ifeq ($(ARCH),freebsd4)
408 # FreeBSD with glibc
409 CXX           = g++
410 CXXFLAGS      = -O -pipe -W -Wall -fPIC
411 LD            = g++
412 LDFLAGS       = -O
413 SOFLAGS       = -shared -Wl,-x
414 endif
415
416 ifeq ($(ARCH),openbsd)
417 # OpenBSD with libc
418 CXX           = g++
419 CXXFLAGS      = -O -pipe -W -Wall -fPIC
420 LD            = g++
421 LDFLAGS       = -O
422 SOFLAGS       = -shared -Wl,-x
423 endif
424
425 ifeq ($(ARCH),macosx)
426 # MacOS X with cc (GNU cc 2.95.2 and gcc 3.3)
427 MACOSX_MINOR := $(shell sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2)
428 CXX           = c++
429 CXXFLAGS      = -O2 -pipe -Wall -W -Woverloaded-virtual
430 LDFLAGS       = -O2 -bind_at_load
431 # The SOFLAGS will be used to create the .dylib,
432 # the .so will be created separately
433 DllSuf        = dylib
434 ifeq ($(MACOSX_MINOR),4)
435 UNDEFOPT      = dynamic_lookup
436 LD            = MACOSX_DEPLOYMENT_TARGET=10.4 c++
437 else
438 ifeq ($(MACOSX_MINOR),3)
439 UNDEFOPT      = dynamic_lookup
440 LD            = MACOSX_DEPLOYMENT_TARGET=10.3 c++
441 else
442 UNDEFOPT      = suppress
443 LD            = c++
444 endif
445 endif
446 SOFLAGS       = -dynamiclib -single_module -undefined $(UNDEFOPT)
447 endif
448
449 ifeq ($(ARCH),macosx64)
450 # MacOS X >= 10.4 with gcc 64 bit mode (GNU gcc 4.*)
451 MACOSX_MINOR := $(shell sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2)
452 CXX           = c++
453 CXXFLAGS      = -m64 -O2 -pipe -Wall -W -Woverloaded-virtual
454 LDFLAGS       = -m64 -O2 -bind_at_load
455 # The SOFLAGS will be used to create the .dylib,
456 # the .so will be created separately
457 DllSuf        = dylib
458 LD            = MACOSX_DEPLOYMENT_TARGET=10.4 c++
459 SOFLAGS       = -m64 -dynamiclib -single_module -undefined dynamic_lookup
460 endif
461
462 ifeq ($(ARCH),macosxxlc)
463 # MacOS X with IBM xlC compiler
464 MACOSX_MINOR := $(shell sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2)
465 CXX           = xlC
466 CXXFLAGS      = -O
467 LDFLAGS       = -O -Wl,-bind_at_load
468 # The SOFLAGS will be used to create the .dylib,
469 # the .so will be created separately
470 DllSuf        = dylib
471 ifeq ($(MACOSX_MINOR),4)
472 UNDEFOPT      = dynamic_lookup
473 LD            = MACOSX_DEPLOYMENT_TARGET=10.4 xlC
474 else
475 ifeq ($(MACOSX_MINOR),3)
476 UNDEFOPT      = dynamic_lookup
477 LD            = MACOSX_DEPLOYMENT_TARGET=10.3 xlC
478 else
479 UNDEFOPT      = suppress
480 LD            = xlC
481 endif
482 endif
483 SOFLAGS       = -qmkshrobj -single_module -undefined $(UNDEFOPT)
484 endif
485
486 ifeq ($(ARCH),win32)
487 # Windows with the VC++ compiler
488 ObjSuf        = obj
489 SrcSuf        = cxx
490 ExeSuf        = .exe
491 DllSuf        = dll
492 OutPutOpt     = -out:
493 CXX           = cl
494 CXXOPT        = -O2
495 #CXXOPT        = -Z7
496 CXXFLAGS      = $(CXXOPT) -G5 -GR -GX -MD -DWIN32 -D_WINDOWS -nologo \
497                 -DVISUAL_CPLUSPLUS -D_X86_=1 -D_DLL
498 LD            = link
499 LDOPT         = -opt:ref
500 #LDOPT         = -debug
501 LDFLAGS       = $(LDOPT) -pdb:none -nologo
502 SOFLAGS       = -DLL
503
504 ROOTLIBS     := $(shell root-config --nonew --libs)
505 ROOTGLIBS    := $(shell root-config --nonew --glibs)
506 EXPLLINKLIBS  = $(ROOTLIBS) $(ROOTGLIBS)
507 endif
508
509 ifeq ($(ARCH),win32old)
510 # Windows with the VC++ compiler
511 ObjSuf        = obj
512 SrcSuf        = cxx
513 ExeSuf        = .exe
514 DllSuf        = dll
515 OutPutOpt     = -out:
516 CXX           = cl
517 CXXOPT        = -O2
518 #CXXOPT        = -Z7
519 CXXFLAGS      = $(CXXOPT) -G5 -GR -GX -MD -DWIN32 -D_WINDOWS -nologo \
520                 -DVISUAL_CPLUSPLUS -D_X86_=1 -D_DLL
521 LD            = link
522 LDOPT         = -opt:ref
523 #LDOPT         = -debug
524 LDFLAGS       = $(LDOPT) -pdb:none -nologo
525 SOFLAGS       = -DLL
526
527 ROOTLIBS     := $(shell root-config --nonew --libs)
528 ROOTGLIBS    := $(shell root-config --nonew --glibs)
529 EXPLLINKLIBS  = $(ROOTLIBS) $(ROOTGLIBS)
530 endif
531
532 ifeq ($(ARCH),win32gcc)
533 # Windows with gcc
534 DllSuf        = dll
535 ExeSuf        = .exe
536 CXX           = g++
537 CXXFLAGS      = -O -pipe -Wall -Woverloaded-virtual -I/usr/X11R6/include
538 LD            = g++
539 LDFLAGS       = -O -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc \
540                 -L/usr/X11R6/lib 
541 SOFLAGS       = -shared -D_DLL -Wl,--export-all-symbols
542 EXPLLINKLIBS  = $(ROOTLIBS) $(ROOTGLIBS)
543 endif
544
545 ifeq ($(CXX),)
546 $(error $(ARCH) invalid architecture)
547 endif
548
549 CXXFLAGS     += $(ROOTCFLAGS)
550 LDFLAGS      += $(ROOTLDFLAGS)
551 LIBS          = $(ROOTLIBS) $(SYSLIBS)
552 GLIBS         = $(ROOTGLIBS) $(SYSLIBS)