Fork me on GitHub

source: git/doc/Makefile.arch@ 9269f2c

ImprovedOutputFile Timing dual_readout llp
Last change on this file since 9269f2c was 9582d01, checked in by pavel-demin <demin@…>, 10 years ago

adapt make files to the latest ROOT and C++ versions

  • Property mode set to 100644
File size: 11.6 KB
Line 
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
9RC := root-config
10ifneq ($(shell which $(RC) 2>&1 | sed -ne "s@.*/$(RC)@$(RC)@p"),$(RC))
11ifneq ($(ROOTSYS),)
12RC1 := $(ROOTSYS)/bin/root-config
13ifneq ($(shell which $(RC1) 2>&1 | sed -ne "s@.*/$(RC)@$(RC)@p"),$(RC))
14$(error Please make sure $(RC1) can be found in path)
15else
16RC := $(RC1)
17endif
18else
19$(error Please make sure $(RC) can be found in path)
20endif
21endif
22
23ARCH := $(shell $(RC) --arch)
24PLATFORM := $(shell $(RC) --platform)
25ALTCC := $(shell $(RC) --cc)
26ALTCXX := $(shell $(RC) --cxx)
27ALTF77 := $(shell $(RC) --f77)
28ALTLD := $(shell $(RC) --ld)
29
30#CXX =
31ObjSuf = o
32SrcSuf = cxx
33ExeSuf =
34DllSuf = so
35OutPutOpt = -o # keep whitespace after "-o"
36
37ifeq (debug,$(findstring debug,$(ROOTBUILD)))
38OPT = -g
39OPT2 = -g
40else
41ifneq ($(findstring debug, $(strip $(shell $(RC) --config))),)
42OPT = -g
43OPT2 = -g
44else
45OPT = -O
46OPT2 = -O2
47endif
48endif
49
50ROOTCFLAGS := $(shell $(RC) --cflags)
51ROOTLDFLAGS := $(shell $(RC) --ldflags)
52ROOTLIBS := $(shell $(RC) --libs)
53ROOTGLIBS := $(shell $(RC) --glibs)
54HASTHREAD := $(shell $(RC) --has-thread)
55ROOTCINT := rootcint
56
57ifeq ($(PLATFORM),macosx)
58MACOSX_MINOR := $(shell sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2)
59ifeq ($(MACOSX_DEPLOYMENT_TARGET),)
60MACOSXTARGET := 10.$(MACOSX_MINOR)
61else
62MACOSXTARGET := $(MACOSX_DEPLOYMENT_TARGET)
63endif
64endif
65
66ifeq ($(ARCH),hpuxacc)
67# HP-UX 10.x with aCC
68CXX = aCC
69CXXFLAGS = $(OPT) +Z
70LD = aCC
71LDFLAGS = $(OPT) -z
72SOFLAGS = -b
73endif
74
75ifeq ($(ARCH),hpuxia64acc)
76# HP-UX 11i 1.5 (IA-64) with aCC
77CXX = aCC
78CXXFLAGS = +DD64 $(OPT) +Z
79LD = aCC
80LDFLAGS = +DD64 $(OPT) -z
81SOFLAGS = -b
82endif
83
84ifeq ($(ARCH),hpuxgcc)
85# HP-UX 10.x with g++
86CXXFLAGS = $(OPT) -fPIC
87CXX = g++
88LD = g++
89LDFLAGS = $(OPT)
90SOFLAGS = -fPIC -shared
91endif
92
93ifeq ($(ARCH),hurddeb)
94# GNU/Hurd
95CXX = g++
96CXXFLAGS = $(OPT2) -Wall -fPIC
97LD = g++
98LDFLAGS = $(OPT2)
99SOFLAGS = -shared
100endif
101
102ifeq ($(ARCH),aix5)
103# IBM AIX >5.x xlC
104CXX = xlC
105CXXFLAGS = $(OPT)
106LD = xlC
107LDFLAGS = $(OPT)
108SOFLAGS =
109DllSuf = a
110endif
111
112ifeq ($(ARCH),aixgcc)
113# IBM AIX >5.x with GCC
114CXX = g++
115CXXFLAGS = $(OPT)
116LD = g++
117LDFLAGS = $(OPT)
118SOFLAGS = -shared
119DllSuf = a
120EXPLLINKLIBS = $(ROOTLIBS) $(ROOTGLIBS)
121endif
122
123ifeq ($(ARCH),solaris)
124# Solaris CC
125CXX = /opt/SUNWspro/bin/CC
126CXXFLAGS = $(OPT) -KPIC
127LD = /opt/SUNWspro/bin/CC
128LDFLAGS = $(OPT)
129SOFLAGS = -G
130endif
131
132ifeq ($(ARCH),solarisCC5)
133# Solaris CC 5.0
134CXX = CC
135CXXFLAGS = $(OPT) -KPIC
136LD = CC
137LDFLAGS = $(OPT)
138SOFLAGS = -G
139endif
140
141ifeq ($(ARCH),solaris64CC5)
142# Solaris CC 5.0 64-bit
143CXX = CC
144CXXFLAGS = $(OPT) -KPIC
145LD = CC
146LDFLAGS = $(OPT)
147SOFLAGS = -G
148endif
149
150ifeq ($(ARCH),sgicc)
151# SGI
152CXX = CC -n32 -I/usr/include/CC.sgi
153CXXFLAGS = $(OPT)
154LD = CC -n32 -LANG:std -I/usr/include/CC.sgi
155LDFLAGS = $(OPT)
156SOFLAGS = -shared
157endif
158
159ifeq ($(ARCH),sgicc64)
160# SGI
161CXX = CC -64 -I/usr/include/CC.sgi
162CXXFLAGS = $(OPT)
163LD = CC -64 -LANG:std -I/usr/include/CC.sgi
164LDFLAGS = $(OPT)
165SOFLAGS = -shared
166endif
167
168ifeq ($(ARCH),sgigcc)
169# SGI 6.x with gcc
170CXX = g++
171CXXFLAGS = $(OPT) -Wall -fPIC
172LD = g++
173LDFLAGS = $(OPT) -Wl,-u,__builtin_new -Wl,-u,__builtin_delete -Wl,-u,__nw__FUiPv
174SOFLAGS = -shared
175endif
176
177ifeq ($(ARCH),sgin32gcc)
178# SGI 6.x with gcc for n32 ABI
179CXX = g++
180CXXFLAGS = $(OPT) -Wall -fPIC
181LD = g++
182LDFLAGS = $(OPT) -L/usr/lib32 -Wl,-woff,134 -lgen
183SOFLAGS = -shared
184endif
185
186ifeq ($(ARCH),alphagcc)
187# Alpha/OSF with gcc
188CXX = g++
189CXXFLAGS = $(OPT2) -Wall -fPIC
190LD = g++
191LDFLAGS = $(OPT2)
192SOFLAGS = -Wl,-expect_unresolved,* -shared
193endif
194
195ifeq ($(ARCH),alphacxx6)
196# Alpha/OSF with cxx6
197CXX = cxx
198CXXFLAGS = $(OPT)
199LD = cxx
200LDFLAGS = $(OPT)
201SOFLAGS = -shared -nocxxstd -Wl,-expect_unresolved,*,-msym
202endif
203
204ifeq ($(ARCH),linux)
205# Linux with egcs, gcc 2.9x, gcc 3.x
206CXX = g++
207CXXFLAGS = $(OPT2) -Wall -fPIC
208LD = g++
209LDFLAGS = $(OPT2)
210SOFLAGS = -shared
211endif
212
213ifeq ($(ARCH),linuxicc)
214# Linux with Intel icc compiler
215ICC_MAJOR := $(shell icc -v 2>&1 | awk '{ if (NR==1) print $$2 }' | \
216 cut -d'.' -f1)
217ICC_MINOR := $(shell icc -v 2>&1 | awk '{ if (NR==1) print $$2 }' | \
218 cut -d'.' -f2)
219CXX = icc
220CXXFLAGS = $(OPT) -fPIC -wd1476
221LD = icpc
222LDFLAGS = $(OPT)
223SOFLAGS = -shared
224endif
225
226ifeq ($(ARCH),linuxppcgcc)
227# PPC Linux with gcc and glibc
228CXX = g++
229CXXFLAGS = $(OPT2) -Wall -fPIC
230LD = g++
231LDFLAGS = $(OPT2)
232SOFLAGS = -shared
233endif
234
235ifeq ($(ARCH),linuxia64gcc)
236# Itanium Linux with gcc 2.9x
237CXX = g++
238CXXFLAGS = $(OPT2) -Wall -fPIC
239LD = g++
240LDFLAGS = $(OPT2)
241SOFLAGS = -shared
242endif
243
244ifeq ($(ARCH),linuxia64ecc)
245# Itanium Linux with Intel icc (was ecc)
246ICC_MAJOR := $(shell icc -v 2>&1 | awk '{ if (NR==1) print $$2 }' | \
247 cut -d'.' -f1)
248ICC_MINOR := $(shell icc -v 2>&1 | awk '{ if (NR==1) print $$2 }' | \
249 cut -d'.' -f2)
250CXX = icc
251CXXFLAGS = $(OPT) -fPIC -wd1476 -ftz
252LD = icpc
253LDFLAGS = $(OPT)
254SOFLAGS = -shared
255endif
256
257ifeq ($(ARCH),linuxx8664gcc)
258# AMD Opteron and Intel EM64T (64 bit mode) Linux with gcc 3.x
259CXX = g++
260CXXFLAGS = $(OPT2) -Wall -fPIC
261LD = g++
262LDFLAGS = $(OPT2)
263SOFLAGS = -shared
264endif
265
266ifeq ($(ARCH),linuxppc64gcc)
267# PPC64 Linux with gcc 3.x
268CXX = g++
269CXXFLAGS = $(OPT) -Wall -fPIC
270LD = g++
271LDFLAGS = $(OPT)
272SOFLAGS = -shared
273endif
274
275ifeq ($(ARCH),linuxx8664icc)
276# AMD Opteron and Intel EM64T (64 bit mode) Linux with Intel icc compiler
277CXX = icc
278CXXFLAGS = $(OPT) -fPIC -wd1476 -wd1572
279LD = icpc
280LDFLAGS = $(OPT)
281SOFLAGS = -shared
282endif
283
284ifeq ($(ARCH),linuxalphagcc)
285# Alpha Linux with gcc
286CXX = g++
287CXXFLAGS = $(OPT2) -Wall -fPIC
288LD = g++
289LDFLAGS = $(OPT2)
290SOFLAGS = -shared
291endif
292
293ifeq ($(ARCH),linuxmips)
294# GNU/Linux on mips (BE/LE, O32/N32/N64) with gcc
295CXX = g++
296CXXFLAGS = $(OPT2) -Wall -fPIC
297LD = g++
298LDFLAGS = $(OPT2)
299SOFLAGS = -shared
300endif
301
302ifeq ($(ARCH),linuxhppa)
303# GNU/Linux on hppa with gcc
304CXX = g++
305CXXFLAGS = $(OPT2) -Wall -fPIC
306LD = g++
307LDFLAGS = $(OPT2)
308SOFLAGS = -shared
309endif
310
311ifeq ($(ARCH),linuxarm)
312# ARM Linux with egcs
313CXX = g++
314CXXFLAGS = $(OPT) -Wall -fPIC
315LD = g++
316LDFLAGS = $(OPT)
317SOFLAGS = -shared
318endif
319
320ifeq ($(ARCH),freebsd4)
321# FreeBSD with glibc
322CXX = g++
323CXXFLAGS = $(OPT) -W -Wall -fPIC
324LD = $(CXX)
325LDFLAGS = $(OPT)
326SOFLAGS = -shared -Wl,-x
327endif
328
329ifeq ($(ARCH),freebsd5)
330# FreeBSD with glibc
331CXX = g++
332CXXFLAGS = $(OPT) -W -Wall -fPIC
333LD = $(CXX)
334LDFLAGS = $(OPT)
335SOFLAGS = -shared -Wl,-x
336endif
337
338ifeq ($(ARCH),freebsd7)
339# FreeBSD with libc
340CXX = g++
341CXXFLAGS = $(OPT) -W -Wall -fPIC
342LD = $(CXX)
343LDFLAGS = $(OPT)
344SOFLAGS = -shared -Wl,-x
345endif
346
347ifeq ($(ARCH),openbsd)
348# OpenBSD with libc
349CXX = g++
350CXXFLAGS = $(OPT) -pipe -W -Wall -fPIC
351LD = g++
352LDFLAGS = $(OPT)
353SOFLAGS = -shared -Wl,-x
354endif
355
356ifeq ($(ARCH),macosx)
357# MacOS X with cc (GNU cc 2.95.2 and gcc 3.3)
358CXX = g++
359CXXFLAGS = $(OPT2) -pipe -Wall -W -Woverloaded-virtual
360LD = g++
361LDFLAGS = $(OPT2) -mmacosx-version-min=$(MACOSXTARGET)
362EXPLLINKLIBS = $(ROOTLIBS) $(ROOTGLIBS)
363# The SOFLAGS will be used to create the .dylib,
364# the .so will be created separately
365ifeq ($(subst $(MACOSX_MINOR),,1234),1234)
366DllSuf = so
367else
368DllSuf = dylib
369endif
370ifneq ($(subst $(MACOSX_MINOR),,12),12)
371LD = g++
372endif
373SOFLAGS = -dynamiclib -single_module -install_name $(CURDIR)/
374endif
375
376ifeq ($(ARCH),macosxicc)
377# MacOS X with Intel icc compiler
378ifeq ($(MACOSX_MINOR),5)
379MACOSX_MINOR := 4
380endif
381CXX = icc
382CXXFLAGS = $(OPT) -fPIC -wd1476
383LD = icpc
384LDFLAGS = $(OPT2) -mmacosx-version-min=$(MACOSXTARGET)
385EXPLLINKLIBS = $(ROOTLIBS) $(ROOTGLIBS)
386# The SOFLAGS will be used to create the .dylib,
387# the .so will be created separately
388ifeq ($(subst $(MACOSX_MINOR),,1234),1234)
389DllSuf = so
390else
391DllSuf = dylib
392endif
393SOFLAGS = -dynamiclib -single_module -install_name $(CURDIR)/
394endif
395
396ifeq ($(ARCH),macosx64)
397# MacOS X >= 10.4 with gcc 64 bit mode (GNU gcc 4.*)
398# Only specific option (-m64) comes from root-config
399CXX = g++
400CXXFLAGS = $(OPT2) -pipe -Wall -W -Woverloaded-virtual
401LD = g++
402LDFLAGS = $(OPT2) -mmacosx-version-min=$(MACOSXTARGET)
403EXPLLINKLIBS = $(ROOTLIBS) $(ROOTGLIBS)
404# The SOFLAGS will be used to create the .dylib,
405# the .so will be created separately
406ifeq ($(subst $(MACOSX_MINOR),,1234),1234)
407DllSuf = so
408else
409DllSuf = dylib
410endif
411SOFLAGS = -dynamiclib -single_module -install_name $(CURDIR)/
412endif
413
414ifeq ($(ARCH),win32)
415# Windows with the VC++ compiler
416VC_MAJOR := $(shell unset VS_UNICODE_OUTPUT; cl.exe 2>&1 | awk '{ if (NR==1) print $$(NF-2) }' | \
417 cut -d'.' -f1)
418ObjSuf = obj
419SrcSuf = cxx
420ExeSuf = .exe
421DllSuf = dll
422OutPutOpt = -out:
423CXX = cl
424ifeq (debug,$(findstring debug,$(ROOTBUILD)))
425CXXOPT = -Z7
426LDOPT = -debug
427else
428ifneq ($(findstring debug, $(strip $(shell $(RC) --config))),)
429CXXOPT = -Z7
430LDOPT = -debug
431else
432CXXOPT = -O2
433LDOPT = -opt:ref
434endif
435endif
436ROOTINCDIR := -I$(shell cygpath -m `$(RC) --incdir`)
437CXXFLAGS = $(CXXOPT) -nologo $(ROOTINCDIR) -FIw32pragma.h
438LD = link
439LDFLAGS = $(LDOPT) -nologo
440SOFLAGS = -DLL
441
442EXPLLINKLIBS = $(ROOTLIBS) $(ROOTGLIBS)
443ifneq (,$(findstring $(VC_MAJOR),14 15))
444MT_EXE = mt -nologo -manifest $@.manifest -outputresource:$@\;1; rm -f $@.manifest
445MT_DLL = mt -nologo -manifest $@.manifest -outputresource:$@\;2; rm -f $@.manifest
446else
447MT_EXE =
448MT_DLL =
449endif
450endif
451
452ifeq ($(ARCH),win32gcc)
453# Windows with gcc
454DllSuf = dll
455ExeSuf = .exe
456CXX = g++
457CXXFLAGS = $(OPT) -pipe -Wall -Woverloaded-virtual -I/usr/X11R6/include
458LD = g++
459LDFLAGS = $(OPT) -Wl,--enable-auto-import \
460 -Wl,--enable-runtime-pseudo-reloc \
461 -L/usr/X11R6/lib
462SOFLAGS = -shared -Wl,--enable-auto-image-base \
463 -Wl,--export-all-symbols
464EXPLLINKLIBS = $(ROOTLIBS) $(ROOTGLIBS)
465endif
466
467ifeq ($(CXX),)
468$(error $(ARCH) invalid architecture)
469endif
470
471CXXFLAGS += $(ROOTCFLAGS)
472LDFLAGS += $(ROOTLDFLAGS)
473LIBS = $(ROOTLIBS) $(SYSLIBS)
474GLIBS = $(ROOTGLIBS) $(SYSLIBS)
475
476ifneq ($(ALTCC),)
477 CC = $(ALTCC)
478endif
479ifneq ($(ALTCXX),)
480 CXX = $(ALTCXX)
481endif
482ifneq ($(ALTF77),)
483 F77 = $(ALTF77)
484endif
485ifneq ($(ALTLD),)
486 LD = $(ALTLD)
487endif
488
489ifneq ($(findstring g++, $(CXX)),)
490GCC_MAJOR := $(shell $(CXX) -dumpversion 2>&1 | cut -d'.' -f1)
491GCC_MINOR := $(shell $(CXX) -dumpversion 2>&1 | cut -d'.' -f2)
492endif
Note: See TracBrowser for help on using the repository browser.