Fork me on GitHub

source: git/doc/Makefile.arch@ 3c59f98

Last change on this file since 3c59f98 was 910bd98, checked in by Pavel Demin <pavel.demin@…>, 3 years ago

update genMakefile.tcl and Makefile.arch

  • Property mode set to 100644
File size: 9.8 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
41OPT = -O
42OPT2 = -O2
43endif
44
45ROOTCFLAGS := $(shell $(RC) --cflags)
46ROOTLDFLAGS := $(shell $(RC) --ldflags)
47ROOTLIBS := $(shell $(RC) --libs)
48ROOTGLIBS := $(shell $(RC) --glibs)
49ROOTCLING := rootcling
50
51ifeq ($(PLATFORM),macosx)
52ROOTLIBDIR := $(shell $(RC) --libdir)
53MACOSX_MAJOR := $(strip $(shell sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 1))
54MACOSX_MINOR := $(strip $(shell sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2))
55ifeq ($(MACOSX_DEPLOYMENT_TARGET),)
56MACOSXTARGET := $(MACOSX_MAJOR).$(MACOSX_MINOR)
57else
58MACOSXTARGET := $(MACOSX_DEPLOYMENT_TARGET)
59endif
60endif
61
62ifeq ($(ARCH),hpuxacc)
63# HP-UX 10.x with aCC
64CXX = aCC
65CXXFLAGS = $(OPT) +Z
66LD = aCC
67LDFLAGS = $(OPT) -z
68SOFLAGS = -b
69endif
70
71ifeq ($(ARCH),hpuxia64acc)
72# HP-UX 11i 1.5 (IA-64) with aCC
73CXX = aCC
74CXXFLAGS = +DD64 $(OPT) +Z
75LD = aCC
76LDFLAGS = +DD64 $(OPT) -z
77SOFLAGS = -b
78endif
79
80ifeq ($(ARCH),hpuxgcc)
81# HP-UX 10.x with g++
82CXXFLAGS = $(OPT) -fPIC
83CXX = g++
84LD = g++
85LDFLAGS = $(OPT)
86SOFLAGS = -fPIC -shared
87endif
88
89ifeq ($(ARCH),hurddeb)
90# GNU/Hurd
91CXX = g++
92CXXFLAGS = $(OPT2) -Wall -fPIC
93LD = g++
94LDFLAGS = $(OPT2)
95SOFLAGS = -shared
96endif
97
98ifeq ($(ARCH),aix5)
99# IBM AIX >5.x xlC
100CXX = xlC
101CXXFLAGS = $(OPT)
102LD = xlC
103LDFLAGS = $(OPT)
104SOFLAGS =
105DllSuf = a
106endif
107
108ifeq ($(ARCH),aixgcc)
109# IBM AIX >5.x with GCC
110CXX = g++
111CXXFLAGS = $(OPT)
112LD = g++
113LDFLAGS = $(OPT)
114SOFLAGS = -shared
115DllSuf = a
116EXPLLINKLIBS = $(ROOTGLIBS)
117endif
118
119ifeq ($(ARCH),solaris)
120# Solaris CC
121CXX = /opt/SUNWspro/bin/CC
122CXXFLAGS = $(OPT) -KPIC
123LD = /opt/SUNWspro/bin/CC
124LDFLAGS = $(OPT)
125SOFLAGS = -G
126endif
127
128ifeq ($(ARCH),solarisCC5)
129# Solaris CC 5.0
130CXX = CC
131CXXFLAGS = $(OPT) -KPIC
132LD = CC
133LDFLAGS = $(OPT)
134SOFLAGS = -G
135endif
136
137ifeq ($(ARCH),solaris64CC5)
138# Solaris CC 5.0 64-bit
139CXX = CC
140CXXFLAGS = $(OPT) -KPIC
141LD = CC
142LDFLAGS = $(OPT)
143SOFLAGS = -G
144endif
145
146ifeq ($(ARCH),linux)
147# Linux with egcs, gcc 2.9x, gcc 3.x
148CXX = g++
149CXXFLAGS = $(OPT2) -Wall -fPIC
150LD = g++
151LDFLAGS = $(OPT2)
152SOFLAGS = -shared
153endif
154
155ifeq ($(ARCH),linuxicc)
156# Linux with Intel icc compiler
157ICC_MAJOR := $(shell icc -v 2>&1 | awk '{ if (NR==1) print $$2 }' | \
158 cut -d'.' -f1)
159ICC_MINOR := $(shell icc -v 2>&1 | awk '{ if (NR==1) print $$2 }' | \
160 cut -d'.' -f2)
161CXX = icc
162CXXFLAGS = $(OPT) -fPIC -wd1476
163LD = icpc
164LDFLAGS = $(OPT)
165SOFLAGS = -shared
166endif
167
168ifeq ($(ARCH),linuxppcgcc)
169# PPC Linux with gcc and glibc
170CXX = g++
171CXXFLAGS = $(OPT2) -Wall -fPIC
172LD = g++
173LDFLAGS = $(OPT2)
174SOFLAGS = -shared
175endif
176
177ifeq ($(ARCH),linuxia64gcc)
178# Itanium Linux with gcc 2.9x
179CXX = g++
180CXXFLAGS = $(OPT2) -Wall -fPIC
181LD = g++
182LDFLAGS = $(OPT2)
183SOFLAGS = -shared
184endif
185
186ifeq ($(ARCH),linuxia64ecc)
187# Itanium Linux with Intel icc (was ecc)
188ICC_MAJOR := $(shell icc -v 2>&1 | awk '{ if (NR==1) print $$2 }' | \
189 cut -d'.' -f1)
190ICC_MINOR := $(shell icc -v 2>&1 | awk '{ if (NR==1) print $$2 }' | \
191 cut -d'.' -f2)
192CXX = icc
193CXXFLAGS = $(OPT) -fPIC -wd1476 -ftz
194LD = icpc
195LDFLAGS = $(OPT)
196SOFLAGS = -shared
197endif
198
199ifeq ($(ARCH),linuxx8664gcc)
200# AMD Opteron and Intel EM64T (64 bit mode) Linux with gcc 3.x
201CXX = g++
202CXXFLAGS = $(OPT2) -Wall -fPIC
203LD = g++
204LDFLAGS = $(OPT2)
205SOFLAGS = -shared
206endif
207
208ifeq ($(ARCH),linuxppc64gcc)
209# PPC64 Linux with gcc 3.x
210CXX = g++
211CXXFLAGS = $(OPT) -Wall -fPIC
212LD = g++
213LDFLAGS = $(OPT)
214SOFLAGS = -shared
215endif
216
217ifeq ($(ARCH),linuxx8664icc)
218# AMD Opteron and Intel EM64T (64 bit mode) Linux with Intel icc compiler
219CXX = icc
220CXXFLAGS = $(OPT) -fPIC -wd1476 -wd1572
221LD = icpc
222LDFLAGS = $(OPT)
223SOFLAGS = -shared
224endif
225
226ifeq ($(ARCH),linuxhppa)
227# GNU/Linux on hppa with gcc
228CXX = g++
229CXXFLAGS = $(OPT2) -Wall -fPIC
230LD = g++
231LDFLAGS = $(OPT2)
232SOFLAGS = -shared
233endif
234
235ifeq ($(ARCH),linuxarm)
236# ARM Linux with egcs
237CXX = g++
238CXXFLAGS = $(OPT) -Wall -fPIC
239LD = g++
240LDFLAGS = $(OPT)
241SOFLAGS = -shared
242endif
243
244ifeq ($(ARCH),linuxarm64)
245# ARMv8-A (AArch64) Linux with gcc and glibc
246CXX = g++
247CXXFLAGS = $(OPT) -Wall -fPIC
248LD = g++
249LDFLAGS = $(OPT)
250SOFLAGS = -shared
251endif
252
253ifeq ($(ARCH),freebsd4)
254# FreeBSD with glibc
255CXX = g++
256CXXFLAGS = $(OPT) -W -Wall -fPIC
257LD = $(CXX)
258LDFLAGS = $(OPT)
259SOFLAGS = -shared -Wl,-x
260endif
261
262ifeq ($(ARCH),freebsd5)
263# FreeBSD with glibc
264CXX = g++
265CXXFLAGS = $(OPT) -W -Wall -fPIC
266LD = $(CXX)
267LDFLAGS = $(OPT)
268SOFLAGS = -shared -Wl,-x
269endif
270
271ifeq ($(ARCH),freebsd7)
272# FreeBSD with libc
273CXX = g++
274CXXFLAGS = $(OPT) -W -Wall -fPIC
275LD = $(CXX)
276LDFLAGS = $(OPT)
277SOFLAGS = -shared -Wl,-x
278endif
279
280ifeq ($(ARCH),openbsd)
281# OpenBSD with libc
282CXX = g++
283CXXFLAGS = $(OPT) -pipe -W -Wall -fPIC
284LD = g++
285LDFLAGS = $(OPT)
286SOFLAGS = -shared -Wl,-x
287endif
288
289ifeq ($(ARCH),macosx)
290# MacOS X with cc (GNU cc 2.95.2 and gcc 3.3)
291CXX = g++
292CXXFLAGS = $(OPT2) -pipe -Wall -W -Woverloaded-virtual
293LD = g++
294LDFLAGS = $(OPT2) -mmacosx-version-min=$(MACOSXTARGET)
295EXPLLINKLIBS = $(ROOTGLIBS)
296DllSuf = so
297SOFLAGS = -dynamiclib -single_module -install_name $(CURDIR)/
298endif
299
300ifeq ($(ARCH),macosxicc)
301# MacOS X with Intel icc compiler
302CXX = icc
303CXXFLAGS = $(OPT) -fPIC -wd1476
304LD = icpc
305LDFLAGS = $(OPT2) -mmacosx-version-min=$(MACOSXTARGET)
306EXPLLINKLIBS = $(ROOTGLIBS)
307DllSuf = so
308SOFLAGS = -dynamiclib -single_module -install_name $(CURDIR)/
309endif
310
311ifeq ($(ARCH),macosx64)
312# MacOS X >= 10.4 with gcc 64 bit mode (GNU gcc 4.*)
313# Only specific option (-m64) comes from root-config
314CXX = g++
315CXXFLAGS = $(OPT2) -pipe -Wall -W -Woverloaded-virtual
316LD = g++
317LDFLAGS = $(OPT2) -mmacosx-version-min=$(MACOSXTARGET) -Wl,-rpath,$(ROOTLIBDIR)
318EXPLLINKLIBS = $(ROOTGLIBS)
319DllSuf = so
320SOFLAGS = -dynamiclib -single_module -install_name $(CURDIR)/
321endif
322
323ifeq ($(ARCH),macosxarm64)
324# Apple Silicon running macOS 11.x.
325CXX = g++
326CXXFLAGS = $(OPT2) -pipe -Wall -W -Woverloaded-virtual
327LD = g++
328LDFLAGS = $(OPT2) -mmacosx-version-min=$(MACOSXTARGET) -Wl,-rpath,$(ROOTLIBDIR)
329EXPLLINKLIBS = $(ROOTGLIBS)
330DllSuf = so
331SOFLAGS = -dynamiclib -single_module -install_name $(CURDIR)/
332endif
333
334ifeq ($(ARCH),win32)
335# Windows with the VC++ compiler
336VC_MAJOR := $(shell unset VS_UNICODE_OUTPUT; cl.exe 2>&1 | awk '{ if (NR==1) print $$(NF-2) }' | \
337 cut -d'.' -f1)
338ObjSuf = obj
339SrcSuf = cxx
340ExeSuf = .exe
341DllSuf = dll
342OutPutOpt = -out:
343CXX = cl
344ifeq (debug,$(findstring debug,$(ROOTBUILD)))
345CXXOPT = -Z7
346LDOPT = -debug
347else
348CXXOPT = -O2
349LDOPT = -opt:ref
350endif
351ROOTINCDIR := -I$(shell cygpath -m `$(RC) --incdir`)
352CXXFLAGS = $(CXXOPT) -nologo $(ROOTINCDIR) -FIw32pragma.h
353LD = link
354LDFLAGS = $(LDOPT) -nologo
355SOFLAGS = -DLL
356
357EXPLLINKLIBS = $(ROOTGLIBS)
358ifneq (,$(findstring $(VC_MAJOR),14 15))
359MT_EXE = mt -nologo -manifest $@.manifest -outputresource:$@\;1; rm -f $@.manifest
360MT_DLL = mt -nologo -manifest $@.manifest -outputresource:$@\;2; rm -f $@.manifest
361else
362MT_EXE =
363MT_DLL =
364endif
365endif
366
367ifeq ($(ARCH),win32gcc)
368# Windows with gcc
369DllSuf = dll
370ExeSuf = .exe
371CXX = g++
372CXXFLAGS = $(OPT) -pipe -Wall -Woverloaded-virtual -I/usr/X11R6/include
373LD = g++
374LDFLAGS = $(OPT) -Wl,--enable-auto-import \
375 -Wl,--enable-runtime-pseudo-reloc \
376 -L/usr/X11R6/lib
377SOFLAGS = -shared -Wl,--enable-auto-image-base \
378 -Wl,--export-all-symbols
379EXPLLINKLIBS = $(ROOTGLIBS)
380endif
381
382ifeq ($(CXX),)
383$(error $(ARCH) invalid architecture)
384endif
385
386CXXFLAGS += $(ROOTCFLAGS)
387LDFLAGS += $(ROOTLDFLAGS)
388LIBS = $(ROOTLIBS)
389GLIBS = $(ROOTGLIBS)
390
391ifneq ($(ALTCC),)
392 CC = $(ALTCC)
393endif
394ifneq ($(ALTCXX),)
395 CXX = $(ALTCXX)
396endif
397ifneq ($(ALTF77),)
398 F77 = $(ALTF77)
399endif
400ifneq ($(ALTLD),)
401 LD = $(ALTLD)
402endif
403
404ifneq ($(findstring g++, $(CXX)),)
405GCC_MAJOR := $(shell $(CXX) -dumpversion 2>&1 | cut -d'.' -f1)
406GCC_MINOR := $(shell $(CXX) -dumpversion 2>&1 | cut -d'.' -f2)
407endif
Note: See TracBrowser for help on using the repository browser.