Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
# Makefile for the ROOT test programs.
# This Makefile shows nicely how to compile and link applications
# using the ROOT libraries on all supported platforms.
#
# Copyright (c) 2000 Rene Brun and Fons Rademakers
#
# Author: Fons Rademakers, 29/2/2000
ROOTCONFIG := root-config
ARCH := $(shell $(ROOTCONFIG) --arch)
PLATFORM := $(shell $(ROOTCONFIG) --platform)
ALTCC := $(shell $(ROOTCONFIG) --cc)
ALTCXX := $(shell $(ROOTCONFIG) --cxx)
ALTF77 := $(shell $(ROOTCONFIG) --f77)
ALTLD := $(shell $(ROOTCONFIG) --ld)
#CXX =
ObjSuf = o
SrcSuf = cxx
ExeSuf =
DllSuf = so
OutPutOpt = -o # keep whitespace after "-o"
ifeq (debug,$(findstring debug,$(ROOTBUILD)))
OPT = -g
OPT2 = -g
else
ifneq ($(findstring debug, $(strip $(shell $(ROOTCONFIG) --config))),)
OPT = -g
OPT2 = -g
else
OPT = -O
OPT2 = -O2
endif
endif
ROOTCFLAGS := $(shell $(ROOTCONFIG) --cflags)
ROOTLDFLAGS := $(shell $(ROOTCONFIG) --ldflags)
ROOTLIBS := $(shell $(ROOTCONFIG) --libs)
ROOTGLIBS := $(shell $(ROOTCONFIG) --glibs)
HASTHREAD := $(shell $(ROOTCONFIG) --has-thread)
ROOTDICTTYPE := $(shell $(ROOTCONFIG) --dicttype)
ROOTCINT := rootcint
ifeq ($(ARCH),linux)
# Linux with egcs, gcc 2.9x, gcc 3.x
CXX = g++
CXXFLAGS = $(OPT2) -Wall -fPIC
LD = g++
LDFLAGS = $(OPT2)
SOFLAGS = -shared
endif
ifeq ($(ARCH),linuxkcc)
# Linux with the KAI compiler
CXX = KCC --one_instantiation_per_object
CXXFLAGS = $(OPT) -fPIC +K0
LD = KCC
LDFLAGS = $(OPT) $(shell $(ROOTCONFIG) --cflags)
SOFLAGS =
endif
ifeq ($(ARCH),linuxicc)
# Linux with Intel icc compiler
ICC_MAJOR := $(shell icc -v 2>&1 | awk '{ if (NR==1) print $$2 }' | \
cut -d'.' -f1)
ICC_MINOR := $(shell icc -v 2>&1 | awk '{ if (NR==1) print $$2 }' | \
cut -d'.' -f2)
CXX = icc
CXXFLAGS = $(OPT) -fPIC -wd1476
LD = icpc
LDFLAGS = $(OPT)
SOFLAGS = -shared
endif
ifeq ($(ARCH),linuxppcgcc)
# PPC Linux with gcc and glibc
CXX = g++
CXXFLAGS = $(OPT2) -Wall -fPIC
LD = g++
LDFLAGS = $(OPT2)
SOFLAGS = -shared
endif
ifeq ($(ARCH),linuxia64gcc)
# Itanium Linux with gcc 2.9x
CXX = g++
CXXFLAGS = $(OPT2) -Wall -fPIC
LD = g++
LDFLAGS = $(OPT2)
SOFLAGS = -shared
endif
ifeq ($(ARCH),linuxia64sgi)
# Itanium Linux with sgiCC
CXX = sgiCC
CXXFLAGS = $(OPT) -Wall -fPIC
LD = gsgiCC
LDFLAGS = $(OPT)
SOFLAGS = -shared
endif
ifeq ($(ARCH),linuxia64ecc)
# Itanium Linux with Intel icc (was ecc)
ICC_MAJOR := $(shell icc -v 2>&1 | awk '{ if (NR==1) print $$2 }' | \
cut -d'.' -f1)
ICC_MINOR := $(shell icc -v 2>&1 | awk '{ if (NR==1) print $$2 }' | \
cut -d'.' -f2)
CXX = icc
CXXFLAGS = $(OPT) -fPIC -wd1476 -ftz
LD = icpc
LDFLAGS = $(OPT)
SOFLAGS = -shared
endif
ifeq ($(ARCH),linuxx8664gcc)
# AMD Opteron and Intel EM64T (64 bit mode) Linux with gcc 3.x
CXX = g++
CXXFLAGS = $(OPT2) -Wall -fPIC
LD = g++
LDFLAGS = $(OPT2)
SOFLAGS = -shared
endif
ifeq ($(ARCH),linuxppc64gcc)
# PPC64 Linux with gcc 3.x
CXX = g++
CXXFLAGS = $(OPT) -Wall -fPIC
LD = g++
LDFLAGS = $(OPT)
SOFLAGS = -shared
endif
ifeq ($(ARCH),linuxx8664icc)
# AMD Opteron and Intel EM64T (64 bit mode) Linux with Intel icc compiler
CXX = icc
CXXFLAGS = $(OPT) -fPIC -wd1476 -wd1572
LD = icpc
LDFLAGS = $(OPT)
SOFLAGS = -shared
endif
ifeq ($(ARCH),linuxalphagcc)
# Alpha Linux with gcc
CXX = g++
CXXFLAGS = $(OPT2) -Wall -fPIC
LD = g++
LDFLAGS = $(OPT2)
SOFLAGS = -shared
endif
ifeq ($(ARCH),linuxmips)
# GNU/Linux on mips (BE/LE, O32/N32/N64) with gcc
CXX = g++
CXXFLAGS = $(OPT2) -Wall -fPIC
LD = g++
LDFLAGS = $(OPT2)
SOFLAGS = -shared
endif
ifeq ($(ARCH),linuxhppa)
# GNU/Linux on hppa with gcc
CXX = g++
CXXFLAGS = $(OPT2) -Wall -fPIC
LD = g++
LDFLAGS = $(OPT2)
SOFLAGS = -shared
endif
ifeq ($(ARCH),linuxarm)
# ARM Linux with egcs
CXX = g++
CXXFLAGS = $(OPT) -Wall -fPIC
LD = g++
LDFLAGS = $(OPT)
SOFLAGS = -shared
endif
ifeq ($(ARCH),macosx)
# MacOS X with cc (GNU cc 2.95.2 and gcc 3.3)
MACOSX_MINOR := $(shell sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2)
MACOSXTARGET := MACOSX_DEPLOYMENT_TARGET=10.$(MACOSX_MINOR)
CXX = g++
CXXFLAGS = $(OPT2) -pipe -Wall -W -Woverloaded-virtual
LD = $(MACOSXTARGET) g++
LDFLAGS = $(OPT2) -bind_at_load
# The SOFLAGS will be used to create the .dylib,
# the .so will be created separately
ifeq ($(subst $(MACOSX_MINOR),,1234),1234)
DllSuf = so
else
DllSuf = dylib
endif
UNDEFOPT = dynamic_lookup
ifneq ($(subst $(MACOSX_MINOR),,12),12)
UNDEFOPT = suppress
LD = g++
endif
SOFLAGS = -dynamiclib -single_module -undefined $(UNDEFOPT)
endif
ifeq ($(ARCH),macosxicc)
# MacOS X with Intel icc compiler
MACOSX_MINOR := $(shell sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2)
MACOSXTARGET := MACOSX_DEPLOYMENT_TARGET=10.$(MACOSX_MINOR)
ifeq ($(MACOSX_MINOR),5)
MACOSX_MINOR := 4
endif
CXX = icc
CXXFLAGS = $(OPT) -fPIC -wd1476
LD = $(MACOSXTARGET) icpc
LDFLAGS = $(OPT)
# The SOFLAGS will be used to create the .dylib,
# the .so will be created separately
ifeq ($(subst $(MACOSX_MINOR),,1234),1234)
DllSuf = so
else
DllSuf = dylib
endif
SOFLAGS = -dynamiclib -single_module -undefined dynamic_lookup
endif
ifeq ($(ARCH),macosx64)
# MacOS X >= 10.4 with gcc 64 bit mode (GNU gcc 4.*)
# Only specific option (-m64) comes from root-config
MACOSX_MINOR := $(shell sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2)
MACOSXTARGET := MACOSX_DEPLOYMENT_TARGET=10.$(MACOSX_MINOR)
CXX = g++
CXXFLAGS = $(OPT2) -pipe -Wall -W -Woverloaded-virtual
LD = $(MACOSXTARGET) g++ -m64
LDFLAGS = $(OPT2) -bind_at_load
# The SOFLAGS will be used to create the .dylib,
# the .so will be created separately
ifeq ($(subst $(MACOSX_MINOR),,1234),1234)
DllSuf = so
else
DllSuf = dylib
endif
SOFLAGS = -m64 -dynamiclib -single_module -undefined dynamic_lookup
endif
ifeq ($(ARCH),macosxxlc)
# MacOS X with IBM xlC compiler
MACOSX_MINOR := $(shell sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2)
MACOSXTARGET := MACOSX_DEPLOYMENT_TARGET=10.$(MACOSX_MINOR)
CXX = xlC
CXXFLAGS = $(OPT)
LD = $(MACOSXTARGET) xlC
LDFLAGS = $(OPT) -Wl,-bind_at_load
# The SOFLAGS will be used to create the .dylib,
# the .so will be created separately
DllSuf = dylib
UNDEFOPT = dynamic_lookup
ifneq ($(subst $(MACOSX_MINOR),,12),12)
UNDEFOPT = suppress
LD = xlC
endif
SOFLAGS = -qmkshrobj -single_module -undefined $(UNDEFOPT)
endif
CXXFLAGS += $(ROOTCFLAGS)
LDFLAGS += $(ROOTLDFLAGS)
LIBS = $(ROOTLIBS) $(SYSLIBS)
GLIBS = $(ROOTGLIBS) $(SYSLIBS)
INCLUDE = -I$(CLHEP_BASE_DIR)/include -I$(NPLIB)/include