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