Correcting names
[u/mrichter/AliRoot.git] / cmake / modules / ALICEMacros.cmake
CommitLineData
e969a926 1# -*- mode: cmake -*-
2#_______________________________________________________________________________
3Macro(CHANGE_FILE_EXTENSION OLD_EXT NEW_EXT RESULT LIST)
4
5# This is probably an obsolete Macro
6
7 If (${OLD_EXT} MATCHES "^[*][.]+.*$")
8 String(REGEX REPLACE "^[*]+([.].*)$" "\\1" OLD_EXT1 ${OLD_EXT})
9 Endif (${OLD_EXT} MATCHES "^[*][.]+.*$")
10
11 If (${NEW_EXT} MATCHES "^[*][.]+.*$")
12 String(REGEX REPLACE "^[*]+([.].*)" "\\1" NEW_EXT1 ${NEW_EXT})
13 Endif (${NEW_EXT} MATCHES "^[*][.]+.*$")
14
15 Set(FLIST)
16 Foreach (_current_FILE ${LIST})
17
18 String(REGEX REPLACE "^(.*)${OLD_EXT1}$" "\\1${NEW_EXT1}" res ${_current_FILE})
19 Set (FLIST ${FLIST} ${res})
20
21 Endforeach (_current_FILE ${LIST})
22 Set(${RESULT} ${FLIST})
23
24Endmacro (CHANGE_FILE_EXTENSION)
25
26#_______________________________________________________________________________
27Macro (CHECK_OUT_OF_SOURCE_BUILD)
28
29# Checks that the binary is built outside the source
30
31 String(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" insource)
32 If(insource)
33 File(REMOVE_RECURSE ${CMAKE_SOURCE_DIR}/Testing)
34 File(REMOVE ${CMAKE_SOURCE_DIR}/DartConfiguration.tcl)
35 Message(FATAL_ERROR "ALIROOT should be installed as an out of source build, to keep the source directory clean. Please create a extra build directory and run the command 'cmake path_to_source_dir' in this newly created directory. You have also to delete the directory CMakeFiles and the file CMakeCache.txt in the source directory. Otherwise cmake will complain even if you run it from an out-of-source directory.")
36 Endif(insource)
37
38EndMacro (CHECK_OUT_OF_SOURCE_BUILD)
39
40#_______________________________________________________________________________
41Function (AddLibrary LIB SRCS DHDRS)
42
43# Adds an AliRoot library as a target
44
45 Set(LDEF "${LIB}LinkDef.h")
46 Set(DICT)
47 If(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LDEF})
48# even with no cxx files, one may want to build an empty lib as a placeholder
49# in AliRoot this is signalled by the existence of an (empty) ${LIB}LinkDef.h
50 Set(DICT "G__${LIB}.cxx")
51 Set(ASRCS ${SRCS} ${DICT})
52 Root_Generate_Dictionary("${DHDRS}" "${LDEF}" "${DICT}" "${INCLUDE_DIRECTORIES}")
53 Else(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LDEF})
84641bd5 54 Message(STATUS "${LDEF} not found... probably building empty lib")
e969a926 55 Set(ASRCS ${SRCS})
56 Endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LDEF})
57
58 Add_Library(${LIB} SHARED ${ASRCS})
59 Target_Link_Libraries(${LIB} ${ALIROOT_LIBRARIES})
60 Set_Target_Properties(${LIB} PROPERTIES ${ALIROOT_LIBRARY_PROPERTIES})
61
62 Install(TARGETS ${LIB} DESTINATION ${ALIROOT_INSTALL_DIR}/lib
63 COMPONENT shared)
64
65 If(ALICE_STATIC_BUILD)
66 Add_Library(${LIB}_a STATIC ${ASRCS})
67 Install(TARGETS ${LIB}_a DESTINATION ${ALIROOT_INSTALL_DIR}/lib/static)
68 EndIf(ALICE_STATIC_BUILD)
69
70 If(ARGV3)
71 Install(FILES ${ARGV3} DESTINATION ${ALIROOT_INSTALL_DIR}/include)
72 Endif(ARGV3)
73
74 CheckViols(${LIB} "${SRCS}")
75
76EndFunction (AddLibrary)
77
78#_______________________________________________________________________________
79Macro (SetModule)
80
81String(REGEX REPLACE "${ALICE_ROOT}/?([^/]*)/?$" "\\1" ALIROOT_MODULE "${CMAKE_CURRENT_SOURCE_DIR}")
82Add_Definitions(-D_MODULE_=\"${ALIROOT_MODULE}\")
83
84EndMacro(SetModule)
85
86
87#_______________________________________________________________________________
88Function (AddExecutable BIN SRCS LIBS)
89
90# Adds an AliRoot executable as a target
91
92 Add_Executable(${BIN} ${SRCS})
93 Target_Link_Libraries(${BIN} ${ROOT_LIBRARIES} ${LIBS})
94 Install(TARGETS ${BIN} DESTINATION ${ALIROOT_INSTALL_DIR}/bin)
95
96 If(ALICE_STATIC_BUILD)
97 Add_Executable(${BIN}_a ${SRCS})
98 Set(_ar_libs)
99 Foreach(_lib ${LIBS})
100 Set(_ar_libs ${_ar_libs} ${_lib}_a)
101 EndForeach(_lib ${LIBS})
102 Foreach(_lib ${LIBS})
103 Set(_ar_libs ${_ar_libs} ${_lib}_a)
104 EndForeach(_lib ${LIBS})
105 Target_Link_Libraries(${BIN}_a ${ROOT_LIBRARIES} ${_ar_libs})
106 Install(TARGETS ${BIN}_a DESTINATION ${ALIROOT_INSTALL_DIR}/bin)
107 EndIf(ALICE_STATIC_BUILD)
108
109 CheckViols(${BIN} "${SRCS}")
110
111EndFunction (AddExecutable)
112
113#_______________________________________________________________________________
114Macro (SetupSystem)
115
116# Set up all system dependencies of AliRoot
117
118Message(STATUS "Setting up system dependent parameters for ${ALICE_TARGET}" )
119
120If(ALICE_TARGET STREQUAL macosx64)
121
122 Execute_process(
123 COMMAND sw_vers -productVersion
124 OUTPUT_VARIABLE MACOSX
125 OUTPUT_STRIP_TRAILING_WHITESPACE)
126
127 String(REGEX REPLACE "^(.*)[.](.*)[.](.*)$" "\\1" MACOSX_MAJOR "${MACOSX}")
128 String(REGEX REPLACE "^(.*)[.](.*)[.](.*)$" "\\2" MACOSX_MINOR "${MACOSX}")
129
130 Message(STATUS "Mac OS X ${MACOSX_MAJOR}.${MACOSX_MINOR}")
131
132 Find_Package(fink)
133
84641bd5 134# Set(CMAKE_CXX_COMPILER g++)
135# Set(CMAKE_C_COMPILER gcc)
e969a926 136# I found no way to make this work...
137# Set(CMAKE_CXX_LINK_EXECUTABLE
138# "MACOSX_DEPLOYMENT_TARGET=${MACOSX_MAJOR}.${MACOSX_MINOR} ${CMAKE_CXX_LINK_EXECUTABLE}")
139
140 Set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS} -flat_namespace -single_module -undefined dynamic_lookup -m64")
141
142 Set(CMAKE_Fortran_FLAGS "-fno-second-underscore -m64")
143
144 Set(CLIBDEFS "-DCERNLIB_LXIA64 -DCERNLIB_BLDLIB -DCERNLIB_CZ -DCERNLIB_PPC")
145
146 Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -pipe -Wall -W -Wno-long-double -pipe -fbounds-check -fsigned-char -fno-common -fmessage-length=0 -Woverloaded-virtual -Weffc++ -Wconversion -Wshadow -fno-default-inline -fno-inline -I/usr/X11R6/include -I${FINK_ROOT}/include")
147 Set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64 -Wall -W -fno-common -pipe -I${FINK_ROOT}/include")
148
149 If(CMAKE_Fortran_COMPILER MATCHES g95)
150 Set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fbounds-check -ftrace=full -DFORTRAN_G95")
151 Execute_process(COMMAND svn info $ENV{ALICE_ROOT}
152 COMMAND g95 --print-search-dirs
153 OUTPUT_VARIABLE _out)
154 String(REGEX REPLACE "^.*install: *([^\n]*)/\n.*$" "\\1" _libdir ${_out})
155 Set(ROOT_LIBRARIES "${ROOT_LIBRARIES} -L${_libdir} -lf95")
156 Else(CMAKE_Fortran_COMPILER MATCHES g95)
157 Set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DFORTRAN_GFORTRAN")
158 Execute_process(
159 COMMAND gfortran -m64 -print-file-name=libgfortran.dylib
160 OUTPUT_VARIABLE FLIB
161 OUTPUT_STRIP_TRAILING_WHITESPACE)
162 Set(ROOT_LIBRARIES "${ROOT_LIBRARIES} ${FLIB}")
163 Execute_process(
164 COMMAND gfortran -m64 -print-file-name=libgfortranbegin.a
165 OUTPUT_VARIABLE FLIB
166 OUTPUT_STRIP_TRAILING_WHITESPACE)
167 Set(ROOT_LIBRARIES "${ROOT_LIBRARIES} ${FLIB}")
168 Endif(CMAKE_Fortran_COMPILER MATCHES g95)
169
170 Set(LINK_FLAGS "${LINK_FLAGS} -m64")
171
172# I think this is useless
173# Set(ALIROOT_LIBRARIES "${ROOT_LIBRARIES} -L/usr/X11R6/lib -lX11")
174 Set(ALIROOT_LIBRARIES "${ROOT_LIBRARIES}")
175
176# Would like to use this, but did not manage on the Mac
177#Include(FindOpenGL)
178#Set(ROOT_LIBRARIES ${ROOT_LIBRARIES} ${OPENGL_LIBRARIES})
179#Set(ROOT_INCLUDE_DIR ${ROOT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR})
180# Poor man's version of the above
181 Set(ALIROOT_INCLUDE_DIR ${ROOT_INCLUDE_DIR} /usr/X11/include)
182
183 Set(LINK_FLAGS "${LINK_FLAGS} -bind_at_load")
184
185#
186# LD = export MACOSX_DEPLOYMENT_TARGET=$(MACOSX_MAJOR).$(MACOSX_MINOR) ; \
187# unset LD_PREBIND ; \
188# g++
189# ALLD = ar
190# ALFLAGS = cr
191# ALLIB =
192# AEXT = a
193#
194
195Endif(ALICE_TARGET STREQUAL macosx64)
196
197EndMacro (SetupSystem)
198
199# ../build/Makefile.alphacxx6
200# # -*- mode: makefile -*-
201# # Makefile to build AliRoot for Alpha OSF1
202#
203# # System dependent commands
204#
205# XARGS = xargs
206#
207# # The compilers
208# CXX = cxx
209# F77 = f77
210#
211# # Global optimisation
212# OPT = -O
213# NOOPT = -O0
214#
215# CXXOPT = $(OPT)
216# CXXNOOPT = $(NOOPT)
217# COPT = $(OPT)
218# FOPT = $(OPT)
219#
220# # CERNLIB defines
221# CLIBDEFS = -DCERNLIB_DECS -DCERNLIB_BLDLIB -DCERNLIB_CZ
222# CLIBCXXOPTS =
223# CLIBCOPT =
224# CLIBFOPT = -I. $(CLIBDEFS)
225#
226# # Compiler flags
227# CXXFLAGS = $(CXXOPT) -nostdnew -rtti -taso
228# CXXFLAGSNO = $(CXXNOOPT) -nostdnew -rtti -taso
229# CFLAGS = $(COPT) -fPIC -pipe -mcpu=ev5 -D__osf__ -D__alpha
230# FFLAGS = $(FOPT) -nofor_main -warn noinformational -taso $(CLIBFOPT)
231# # rmkdepend flags for building dependencies of FORTRAN files
232# DEPENDFFLAGS = $(filter-out -warn noinformational,$(FFLAGS))
233#
234# # rootcint flags
235# CINTFLAGS = -D__DECCXX
236#
237# LD = cxx
238# LDFLAGS =
239#
240# SHLD = ld
241# SOFLAGS = -L/usr/lib/cmplrs/cxx -rpath /usr/lib/cmplrs/cxx \
242# -expect_unresolved "*" -msym -shared -taso \
243# /usr/lib/cmplrs/cc/crt0.o /usr/lib/cmplrs/cxx/_main.o
244#
245# SHLIB = -lUfor -lfor -lFutil
246# SOEXT = so
247#
248# #System libraries
249#
250# # Flags for static libraries
251# AFLAGS = $(filter-out -rpath /usr/lib/cmplrs/cxx -msym -shared /usr/lib/cmplrs/cc/crt0.o,$(SOFLAGS))
252# AFLAGS += $(SHLIB)
253#
254# # Additional flags and libraries for building aliroot executable
255# SYSLIBS := -lXm -lXt -lX11 -lPW -lUfor -lfor -lFutil -lots -taso -lbsd
256#
257# # Cure funny problem
258# # sometimes in dependencies system include files of the sort
259# # /usr/.../filename AND /usr/.../filename.cc are present
260# # DEC believes that /usr/.../filename is the executable to be
261# # built from /usr/.../filename.cc
262# # Just avoid this to happen
263#
264# % : %.cc
265# @;
266#
267#
268#
269#
270#
271#
272#
273#
274#
275# ../build/Makefile.hpuxacc
276# # -*- mode: makefile -*-
277# # Makefile to build AliRoot on HP-UX
278#
279# # System dependent commands
280#
281# XARGS = xargs
282#
283# # The compilers
284# CXX = aCC
285# F77 = f77
286# CC = cc
287#
288# # Global optimisation
289# OPT = -g -O
290# NOOPT = -g
291#
292# CXXOPT = $(OPT)
293# CXXNOOPT = $(NOOPT)
294# COPT = $(OPT)
295# FOPT = $(OPT)
296#
297# # CERNLIB defines
298# CLIBDEFS = -DCERNLIB_HPUX -DCERNLIB_BLDLIB -DCERNLIB_CZ
299# CLIBCXXOPTS =
300# CLIBCOPT = +z -Ae
301# CLIBFOPT = $(CLIBDEFS) -WF,-P
302#
303# CXXFLAGS = $(CXXOPT) -Wc,-ansi_for_scope,on +Z -z +W70,495,740,749,823,829 -Dextname
304# CXXFLAGSNO = $(CXXNOOPT) -Wc,-ansi_for_scope,on +Z -z +W70,495,740,749,823,829 -Dextname
305# CFLAGS = $(COPT) +Z -Ae
306# FFLAGS = $(CLIBFOPT) $(FOPT) +ppu +Z
307# # rmkdepend flags for building dependencies of FORTRAN files
308# DEPENDFFLAGS = $(FFLAGS)
309#
310# # rootcint flags
311# CINTFLAGS =
312#
313# LD = aCC
314# LDFLAGS = $(OPT) -z -Wl,+s -Wl,-E
315#
316# SHLD = $(LD)
317# SOFLAGS = -b /usr/lib/libm.sl
318#
319# SOEXT = sl
320#
321# # additional ROOT libraries
322# SYSLIBS := -lcrypt -L/usr/lib/X11R6 -lX11
323#
324#
325#
326#
327#
328# ../build/Makefile.linux
329# # -*- mode: makefile -*-
330# # Makefile to build AliRoot for Linux
331#
332# # System dependent commands
333#
334# XARGS = xargs -r
335#
336# # The compilers
337# CXX = g++
338# CC = gcc
339# CCMAJORV = $(shell $(CC) -dumpversion | cut -d. -f1)
340# CCMINORV = $(shell $(CC) -dumpversion | cut -d. -f2)
341# F77 = $(shell root-config --f77)
342#
343# # Global optimisation
344# OPT = -O -g
345# NOOPT = -g
346#
347# CXXOPT = $(OPT)
348# CXXNOOPT = $(NOOPT)
349# COPT = $(OPT)
350# FOPT = $(OPT)
351#
352# # CERNLIB defines
353# CLIBDEFS = -DCERNLIB_LINUX -DCERNLIB_BLDLIB -DCERNLIB_CZ
354# CLIBCXXOPTS =
355# CLIBCOPT =
356# CLIBFOPT = $(CLIBDEFS)
357#
358# # Compiler flags
359# ifeq ($(CCMAJORV),2)
360# CXXFLAGS = $(OPT) -W -Wall -fPIC -pipe
361# CXXFLAGSNO = $(NOOPT) -W -Wall -fPIC -pipe
362# else
363# ifeq ($(CCMAJORV),3)
364# CXXFLAGS = $(OPT) -W -Wall -Weffc++ -Woverloaded-virtual -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi -Dlinux
365# CXXFLAGSNO = $(NOOPT) -W -Wall -Weffc++ -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi
366# else
367# ifeq ($(CCMAJORV),4)
368# CXXFLAGS = $(OPT) -W -Wall -Weffc++ -Woverloaded-virtual -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi -Dlinux
369# CXXFLAGSNO = $(NOOPT) -W -Wall -Weffc++ -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi
370# else
371# CXXFLAGS = $(OPT) -W -Wall -Woverloaded-virtual -fPIC -pipe -fmessage-length=0 -Wno-long-long -ansi -Dlinux
372# CXXFLAGSNO = $(NOOPT) -W -Wall -Weffc++ -fPIC -pipe -fmessage-length=0 -Wno-long-long -ansi
373# endif
374# endif
375# endif
376# CFLAGS = $(OPT) -Wall -Werror -fPIC -pipe -Wno-long-long -pedantic-errors -ansi
377# FFLAGS = $(CLIBFOPT) $(FOPT) -fno-second-underscore
378#
379# ifeq (g95,$(F77))
380# FFLAGS +=-DFORTRAN_G95
381# else
382# ifeq (gfortran,$(F77))
383# FFLAGS +=-DFORTRAN_GFORTRAN
384# else
385# FFLAGS +=
386# endif
387# endif
388#
389# # rmkdepend flags for building dependencies of FORTRAN files
390# DEPENDFFLAGS = $(FFLAGS)
391#
392# # rootcint flags
393# CINTFLAGS =
394#
395# LD = g++
396# LDFLAGS = $(OPT)
397#
398# SHLD = $(LD)
399# SOFLAGS = $(OPT) -shared -Wl
400# SOEXT = so
401#
402# #System libraries
403# SYSLIBS := -ldl -lcrypt -L/usr/X11R6/lib -lX11
404#
405# ifeq (g95,$(F77))
406# SHLIB += -L$(shell g95 --print-search-dirs | sed -n -e 's/install: //p') -lf95
407# else
408# ifeq (gfortran,$(F77))
409# SHLIB := $(shell gfortran -print-file-name=libgfortran.so)
410# SHLIB += $(shell gfortran -print-file-name=libgfortranbegin.a)
411# SYSLIBS += $(SHLIB)
412# else
413# SHLIB = -lg2c
414# SYSLIBS += -lg2c
415# endif
416# endif
417#
418# ALLD = ar
419# ALFLAGS = cr
420# ALLIB =
421# AEXT = a
422#
423# # additional ROOT libraries
424#
425#
426#
427#
428#
429#
430# ../build/Makefile.linuxalphagcc
431# # -*- mode: makefile -*-
432# # Makefile to build AliRoot for Linux on alpha
433#
434# # System dependent commands
435#
436# XARGS = xargs -r
437#
438# # The compilers
439# CXX = g++
440# F77 = g77
441# CC = gcc
442# CCMAJORV = $(shell $(CC) -dumpversion | cut -d. -f1)
443# CCMINORV = $(shell $(CC) -dumpversion | cut -d. -f2)
444#
445# # Global optimisation
446# OPT = -O -g -mieee -mno-soft-float
447# NOOPT = -g -mieee -mno-soft-float
448#
449# CXXOPT = $(OPT)
450# CXXNOOPT = $(NOOPT)
451# COPT = $(OPT)
452# FOPT = $(OPT)
453#
454# # CERNLIB defines
455# CLIBDEFS = -DCERNLIB_UNIX -DCERNLIB_DECS -DCERNLIB_BLDLIB -DCERNLIB_CZ
456# CLIBCXXOPTS =
457# CLIBCOPT =
458# CLIBFOPT = $(CLIBDEFS)
459#
460# # Compiler flags
461#
462# CXXFLAGS = $(OPT) -Wall -fPIC -pipe
463# CXXFLAGSNO = $(NOOPT) -Wall -fPIC -pipe
464# CFLAGS = $(OPT) -Wall -fPIC -pipe -ansi
465# FFLAGS = $(CLIBFOPT) $(FOPT) -Wall -fPIC -pipe -fno-second-underscore
466# # rmkdepend flags for building dependencies of FORTRAN files
467# DEPENDFFLAGS = $(FFLAGS)
468#
469# # rootcint flags
470# CINTFLAGS =
471#
472# LD = g++
473# LDFLAGS = $(OPT)
474#
475# SHLD = $(LD)
476# SOFLAGS = $(OPT) -Wall -fPIC -pipe -shared -Wl
477# SHLIB = -lg2c
478# SOEXT = so
479#
480# ALLD = ar
481# ALFLAGS = cr
482# ALLIB =
483# AEXT = a
484#
485# #System libraries
486# SYSLIBS := -ldl -lg2c -lcrypt -L/usr/X11R6/lib -lX11
487#
488#
489#
490#
491#
492# ../build/Makefile.linuxia64ecc
493# # -*- mode: makefile -*-
494# # Makefile for AliRoot for Itanium/Linux with Intel icc compiler
495#
496# # System dependent commands
497#
498# XARGS = xargs -r
499#
500# # The compilers
501# CXX = icc
502# F77 = ifort
503# CC = icc
504#
505# # Global optimisation
506# OPT = -g #-O
507# NOOPT = -g
508#
509# CXXOPT = $(OPT)
510# CXXNOOPT = $(OPT)
511# COPT = $(OPT)
512# FOPT = $(OPT)
513#
514# # CERNLIB defines
515# CLIBDEFS = -DCERNLIB_LXIA64 -DCERNLIB_BLDLIB -DCERNLIB_CZ
516# CLIBCXXOPTS =
517# CLIBCOPT =
518# CLIBFOPT = $(CLIBDEFS)
519#
520# # Compiler flags
521# CXXFLAGS = $(CXXOPT)
522# CXXFLAGSNO = $(CXXNOOPT)
523# CFLAGS = $(COPT)
524# FFLAGS = $(CLIBFOPT) $(FOPT)
525# # rmkdepend flags for building dependencies of FORTRAN files
526# DEPENDFFLAGS = $(FFLAGS)
527#
528# # rootcint flags
529# CINTFLAGS =
530#
531# LD = icpc
532# LDFLAGS = $(OPT)
533#
534# SHLD = $(LD)
535# SOFLAGS = -Wl,-soname,$$TMPLIB -shared -O
536# SHLIB =
537# SOEXT = so
538#
539# ALLD = ar
540# ALFLAGS = cr
541# ALLIB =
542# AEXT = a
543#
544# # additional ROOT libraries
545#
546# LIBNOVER = `find /lib -name 'libNoVersion*.so' | xargs --replace basename {} .so | sed -e 's/lib/ -l/'`
547#
548# SYSLIBS := $(LIBNOVER) -lcrypt -L/usr/local/lib -lXt -lCEPCF90 -lF90 \
549# -lPEPCF90 -lintrins -L/usr/X11R6/lib -lX11
550# ../build/Makefile.linuxia64gcc
551# # -*- mode: makefile -*-
552# # Makefile for AliRoot for Itanium/Linux with gcc
553#
554# # System dependent commands
555#
556# XARGS = xargs -r
557#
558# # The compilers
559# CXX = g++
560# F77 = g77
561# CC = gcc
562#
563# # Global optimisation
564# OPT = -g -O
565# NOOPT = -g
566#
567# CXXOPT = $(OPT)
568# CXXNOOPT = $(NOOPT)
569# COPT = $(OPT)
570# FOPT = $(OPT)
571#
572# # CERNLIB defines
573# CLIBDEFS = -DCERNLIB_LXIA64 -DCERNLIB_BLDLIB -DCERNLIB_CZ
574# CLIBCXXOPTS =
575# CLIBCOPT =
576# CLIBFOPT = $(CLIBDEFS)
577#
578# # Compiler flags
579# CXXFLAGS = $(CXXOPT) -Wall -Weffc++ -fPIC -pipe
580# CXXFLAGSNO = $(CXXNOOPT) -Wall -Weffc++ -fPIC -pipe
581# CFLAGS = -Wall -fPIC -pipe
582# FFLAGS = $(CLIBFOPT) $(FOPT) -fno-second-underscore
583# # rmkdepend flags for building dependencies of FORTRAN files
584# DEPENDFFLAGS = $(FFLAGS)
585#
586# # rootcint flags
587# CINTFLAGS =
588#
589# LD = g++
590# LDFLAGS = $(OPT) -Wl,-Map -Wl,$@.map
591#
592# SHLD = $(LD)
593# SOFLAGS = -shared -Wl -O2
594# SOEXT = so
595#
596# ALLD = ar
597# ALFLAGS = cr
598# ALLIB =
599# AEXT = a
600#
601# # additional ROOT libraries
602#
603# LIBNOVER = `find /lib -name 'libNoVersion*.so' | xargs --replace basename {} .so | sed -e 's/lib/ -l/'`
604#
605# #System libraries
606# SYSLIBS := -ldl -lbsd -lg2c -L/usr/X11R6/lib -lX11 $(LIBNOVER)
607#
608#
609#
610#
611#
612# ../build/Makefile.linuxicc
613# # -*- mode: makefile -*-
614# # Makefile for AliRoot for Linux with the Intel icc compiler
615#
616# # System dependent commands
617#
618# XARGS = xargs -r
619#
620# # The compilers
621# CXX = icc
622# CC = icc
623#
624# # Compiler version:
625# ICC_MAJOR := $(shell $(CXX) -V 2>&1 | awk '{ if (NR==1) print $$8 }' | \
626# cut -d'.' -f1)
627# ICC_MINOR := $(shell $(CXX) -V 2>&1 | awk '{ if (NR==1) print $$8 }' | \
628# cut -d'.' -f2)
629#
630# F77 = ifort
631#
632# # Global optimisation
633# OPT = -O -ip
634# NOOPT = -O0
635#
636# CXXOPT = $(OPT)
637# CXXNOOPT = $(NOOPT)
638# COPT = $(OPT)
639# FOPT = $(OPT)
640#
641# # CERNLIB defines
642# CLIBDEFS = -DCERNLIB_LINUX -DCERNLIB_BLDLIB -DCERNLIB_CZ
643# CLIBCXXOPTS =
644# CLIBCOPT =
645# CLIBFOPT = $(CLIBDEFS)
646#
647# # Compiler flags
648# CXXFLAGS = $(CXXOPT)
649# CXXFLAGSNO = $(CXXNOOPT)
650# CFLAGS = $(COPT)
651# FFLAGS = $(CLIBFOPT) $(FOPT)
652# # rmkdepend flags for building dependencies of FORTRAN files
653# DEPENDFFLAGS = $(FFLAGS)
654#
655# # rootcint flags
656# CINTFLAGS =
657#
658# LD = icpc
659# LDFLAGS = $(OPT)
660#
661# SHLD = $(LD)
662# SOFLAGS = -Wl,-soname,$$TMPLIB -shared $(OPT)
663# SHLIB =
664# SOEXT = so
665#
666# ALLD = ar
667# ALFLAGS = cr
668# ALLIB =
669# AEXT = a
670#
671# # additional ROOT libraries
672#
673# LIBNOVER = `find /lib -name 'libNoVersion*.so' | xargs --replace basename {} .so | sed -e 's/lib/ -l/'`
674#
675# #System libraries
676# SYSLIBS := -lcrypt -L/usr/X11R6/lib -lX11 $(LIBNOVER) -L/usr/local/lib \
677# -lXt -L$(shell which ifort | sed -e 's|bin/ifort|lib|') \
678# -lifcore -lifport
679# ../build/Makefile.linuxx8664gcc
680# # -*- mode: makefile -*-
681# # Makefile to build AliRoot for Linux
682#
683# # System dependent commands
684#
685# XARGS = xargs -r
686#
687# # The compilers
688# CXX = g++
689# CC = gcc
690# CCMAJORV = $(shell $(CC) -dumpversion | cut -d. -f1)
691# CCMINORV = $(shell $(CC) -dumpversion | cut -d. -f2)
692# F77 = $(shell root-config --f77)
693#
694# # Global optimisation
695# OPT = -O0 -g
696# NOOPT = -g
697#
698# CXXOPT = $(OPT)
699# CXXNOOPT = $(NOOPT)
700# COPT = $(OPT)
701# FOPT = $(OPT)
702#
703# # CERNLIB defines
704# CLIBDEFS = -DCERNLIB_LXIA64 -DCERNLIB_BLDLIB -DCERNLIB_CZ
705# CLIBCXXOPTS =
706# CLIBCOPT =
707# CLIBFOPT = $(CLIBDEFS)
708#
709# # Compiler flags
710# ifeq ($(CCMAJORV),2)
711# CXXFLAGS = $(OPT) -W -Wall -fPIC -pipe -m64
712# CXXFLAGSNO = $(NOOPT) -W -Wall -fPIC -pipe -m64
713# else
714# ifeq ($(CCMAJORV),3)
715# CXXFLAGS = $(OPT) -W -Wall -Weffc++ -Woverloaded-virtual -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi -Dlinux -m64
716# CXXFLAGSNO = $(NOOPT) -W -Wall -Weffc++ -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi -m64
717# else
718# ifeq ($(CCMAJORV),4)
719# CXXFLAGS = $(OPT) -W -Wall -Weffc++ -Woverloaded-virtual -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi -Dlinux -m64
720# CXXFLAGSNO = $(NOOPT) -W -Wall -Weffc++ -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi -m64
721# else
722# CXXFLAGS = $(OPT) -W -Wall -Woverloaded-virtual -fPIC -pipe -fmessage-length=0 -Wno-long-long -ansi -Dlinux -m64
723# CXXFLAGSNO = $(NOOPT) -W -Wall -Weffc++ -fPIC -pipe -fmessage-length=0 -Wno-long-long -ansi -m64
724# endif
725# endif
726# endif
727# CFLAGS = $(OPT) -Wall -Werror -fPIC -pipe -Wno-long-long -pedantic-errors -ansi -m64
728# FFLAGS = $(CLIBFOPT) $(FOPT) -fno-second-underscore -fPIC -fno-f2c -m64
729#
730# ifeq (g95,$(F77))
731# FFLAGS +=-DFORTRAN_G95
732# else
733# ifeq (gfortran,$(F77))
734# FFLAGS +=-DFORTRAN_GFORTRAN
735# else
736# FFLAGS +=
737# endif
738# endif
739#
740# # rmkdepend flags for building dependencies of FORTRAN files
741# DEPENDFFLAGS = $(FFLAGS)
742#
743# # rootcint flags
744# CINTFLAGS =
745#
746# LD = g++
747# LDFLAGS = $(OPT)
748#
749# SHLD = $(LD)
750# SOFLAGS = $(OPT) -shared -Wl
751# SOEXT = so
752#
753# #System libraries
754# LIBNOVER = `find /lib64 -name 'libNoVersion*.so' | xargs --replace basename {} .so | sed -e 's/lib64/ -l/'`
755#
756# SYSLIBS := -ldl -lcrypt -L/usr/X11R6/lib64 -lX11 $(LIBNOVER)
757#
758# ifeq (g95,$(F77))
759# SHLIB += -L$(shell g95 --print-search-dirs | sed -n -e 's/install: //p') -lf95
760# else
761# ifeq (gfortran,$(F77))
762# SHLIB := $(shell gfortran -print-file-name=libgfortran.so)
763# SHLIB += $(shell gfortran -print-file-name=libgfortranbegin.a)
764# else
765# SHLIB = -lg2c
766# SYSLIBS += -lg2c
767# endif
768# endif
769#
770# ALLD = ar
771# ALFLAGS = cr
772# ALLIB =
773# AEXT = a
774#
775#
776#
777#
778#
779#
780#
781#
782#
783# ../build/Makefile.macosx
784# # -*- mode: makefile -*-
785# # Makefile for AliRoot for MacOS X with gcc
786#
787# XARGS = xargs
788#
789# # OS version
790# MACOSX_MAJOR := $(strip $(shell sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 1))
791# MACOSX_MINOR := $(strip $(shell sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2))
792#
793# # fink directories
794# FINK_ROOT := $(shell which fink | sed -e 's?/bin/fink??')
795# ifeq (,$(FINK_ROOT))
796# # No fink, build will probably fail, but we try a guess
797# FINK_ROOT=/usr/local
798# endif
799#
800# # The compilers
801# CXX = g++
802# CC = gcc
803# F77 = $(shell root-config --f77)
804#
805# # Global optimisation
806# OPT = -O -g
807# NOOPT = -O0 -g
808#
809# CXXOPT = $(OPT)
810# CXXNOOPT = $(NOOPT)
811# COPT = $(OPT)
812# FOPT = $(OPT) -fno-second-underscore
813# ifeq (g95,$(F77))
814# FOPT += -fbounds-check
815# endif
816#
817# # CERNLIB defines
818# CLIBDEFS = -DCERNLIB_LINUX -DCERNLIB_BLDLIB -DCERNLIB_CZ -DCERNLIB_PPC
819# CLIBCXXOPTS =
820# CLIBCOPT =
821# CLIBFOPT = $(CLIBDEFS)
822#
823# CXXSTF = -pipe -Wall -W -Wno-long-double -pipe -fbounds-check -fsigned-char -fno-common -fmessage-length=0 -Woverloaded-virtual -Weffc++ -Wconversion -Wshadow -fno-default-inline -fno-inline -I/usr/X11R6/include -I$(FINK_ROOT)/include
824#
825# # Compiler flags
826# CXXFLAGS = $(CXXOPT) $(CXXSTF)
827#
828# CXXFLAGSNO = $(CXXNOOPT) $(CXXSTF)
829#
830# CFLAGS = $(COPT) -Wall -W -fno-common -pipe -I$(FINK_ROOT)/include
831#
832# FFLAGS = $(CLIBFOPT) $(FOPT)
833# ifeq (g95,$(F77))
834# FFLAGS += -ftrace=full
835# FFLAGS +=-DFORTRAN_G95
836# else
837# FFLAGS +=-DFORTRAN_GFORTRAN
838# endif
839#
840# # rmkdepend flags for building dependencies of FORTRAN files
841# DEPENDFFLAGS = $(FFLAGS)
842#
843# # rootcint flags
844# CINTFLAGS =
845#
846# LD = export MACOSX_DEPLOYMENT_TARGET=$(MACOSX_MAJOR).$(MACOSX_MINOR) ; \
847# unset LD_PREBIND ; \
848# g++
849# LDFLAGS = $(OPT) $(DICTLOAD)
850#
851# SHLD := $(LD)
852# SOFLAGS := -bundle -undefined dynamic_lookup
853# SHLIB :=
854# SOEXT := so
855#
856# DYLD := $(LD)
857# DYFLAGS = -dynamiclib -undefined dynamic_lookup -single_module
858# DYLIB :=
859# DYEXT := dylib
860#
861# ALLD = ar
862# ALFLAGS = cr
863# ALLIB =
864# AEXT = a
865#
866# DEPENDCXXFLAGS = $(CXXFLAGS) -I/usr/include/sys
867#
868# SYSLIBS := -L/usr/X11R6/lib -lX11
869#
870# EXEFLAGS := -bind_at_load
871#
872# #System libraries
873#
874# ifeq (g95,$(F77))
875# SYSLIBS += -L$(shell g95 --print-search-dirs | sed -n -e 's/install: //p') -lf95
876# DYLIB += -L$(shell g95 --print-search-dirs | sed -n -e 's/install: //p') -lf95
877# else
878# SYSLIBS += -ldl $(shell $(F77) -print-file-name=libgfortran.dylib)
879# SYSLIBS += $(shell $(F77) -print-file-name=libgfortranbegin.a)
880# endif
881# ../build/Makefile.macosxicc
882# # -*- mode: makefile -*-
883# # Makefile for AliRoot for MacOS X with gcc
884#
885# XARGS = xargs
886#
887# # fink directories
888# FINK_ROOT := $(shell which fink | sed -e 's?/bin/fink??')
889# ifeq (,$(FINK_ROOT))
890# # No fink, build will probably fail, but we try a guess
891# FINK_ROOT=/usr/local
892# endif
893#
894# # The compilers
895# CXX = icc
896# CC = icc
897#
898# F77 = ifort
899#
900# # Global optimisation
901# OPT = -O -g
902# NOOPT = -g
903#
904# CXXOPT = $(OPT)
905# CXXNOOPT = $(NOOPT)
906# COPT = $(OPT)
907# FOPT = $(OPT)
908#
909# # CERNLIB defines
910# CLIBDEFS = -DCERNLIB_LINUX -DCERNLIB_BLDLIB -DCERNLIB_CZ -DCERNLIB_PPC
911# CLIBCXXOPTS =
912# CLIBCOPT =
913# CLIBFOPT = $(CLIBDEFS)
914#
915# # Compiler flags
916# CXXFLAGS = $(CXXOPT) -fPIC -wd1476 -I/usr/X11R6/include -I$(FINK_ROOT)/include
917#
918# CXXFLAGSNO = $(CXXNOOPT)
919#
920# CFLAGS = $(COPT) -fPIC -restrict -I$(FINK_ROOT)/include
921#
922# FFLAGS = $(CLIBFOPT) $(FOPT)
923# # rmkdepend flags for building dependencies of FORTRAN files
924# DEPENDFFLAGS = $(FFLAGS)
925#
926# # rootcint flags
927# CINTFLAGS =
928#
929# LD = icpc
930# LDFLAGS = $(OPT) $(DICTLOAD)
931#
932# SHLD := $(LD)
933# SOFLAGS := $(OPT) -dynamiclib -undefined dynamic_lookup -single_module
934# SHLIB :=
935# SOEXT := so
936#
937# DYLD := $(LD)
938# DYFLAGS = -dynamiclib -undefined dynamic_lookup -single_module
939# DYLIB :=
940# DYEXT := dylib
941#
942# ALLD = ar
943# ALFLAGS = cr
944# ALLIB =
945# AEXT = a
946#
947# DEPENDCXXFLAGS = $(CXXFLAGS) -I/usr/include/sys
948#
949# EXEFLAGS := -bind_at_load
950#
951# #System libraries
952#
953# SYSLIBS := -L/usr/X11R6/lib -lX11 -lGL $(LIBNOVER) -L/usr/local/lib \
954# -lXt -L$(shell which ifort | sed -e 's|bin/ifort|lib|') \
955# -lifcore -lifport
956#
957#
958# ../build/Makefile.macosxxlc
959# # -*- mode: makefile -*-
960# # Makefile for AliRoot for MacOS X using the IBM xlc compiler
961#
962# # The compilers
963# CXX = xlC
964# F77 = xlf
965# CC = xlc
966#
967# # Global optimisation
968# OPT = -qnoopt #-O3 -g
969# NOOPT = -qnoopt
970#
971# CXXOPT = $(OPT)
972# CXXNOOPT = $(NOOPT)
973# COPT = $(OPT)
974# FOPT = $(OPT)
975#
976# # CERNLIB defines
977# CLIBDEFS = -DCERNLIB_LINUX -DCERNLIB_BLDLIB -DCERNLIB_CZ
978# CLIBCXXOPTS =
979# CLIBCOPT =
980# CLIBFOPT = $(shell echo $(CLIBDEFS) | sed -e's/-D/-WF,-D/g')
981#
982# # Compiler flags
983# CXXFLAGS = $(CXXOPT) -qpic -I/sw/include \
984# -qflttrap=overflow:zerodivide:invalid:inexact:enable
985# CXXFLAGSNO = $(CXXNOOPT) -qpic -I/sw/include \
986# -qflttrap=overflow:zerodivide:invalid:inexact:enable
987# CFLAGS = -qpic -qextname -I/sw/include \
988# -qflttrap=overflow:zerodivide:invalid:inexact:enable
989# FFLAGS = $(CLIBFOPT) $(FOPT) -qpic \
990# -qflttrap=overflow:zerodivide:invalid:inexact:enable
991# # rmkdepend flags for building dependencies
992# DEPENDFFLAGS = $(FFLAGS)
993# DEPENDCXXFLAGS = $(CXXFLAGS) -I/usr/include/sys
994#
995# # rootcint flags
996# CINTFLAGS =
997#
998# LD = xlC
999# LDFLAGS = $(OPT)
1000#
1001# SHLD := export MACOSX_DEPLOYMENT_TARGET=10.3 ; \
1002# unset LD_PREBIND ; \
1003# xlC
1004# SOFLAGS := -bundle -undefined dynamic_lookup
1005# #SHLIB := -lg2c
1006# SHLIB :=
1007# SOEXT := so
1008#
1009# DYLD := export MACOSX_DEPLOYMENT_TARGET=10.3 ; \
1010# unset LD_PREBIND ; \
1011# xlC
1012# DYFLAGS = -qmkshrobj -undefined dynamic_lookup -single_module
1013# DYLIB :=
1014# DYEXT := dylib
1015#
1016# ALLD = ar
1017# ALFLAGS = cr
1018# ALLIB =
1019# AEXT = a
1020#
1021#
1022# #System libraries
1023# SYSLIBS := -ldl -L/usr/X11R6/lib -lX11
1024#
1025# EXEFLAGS := -Wl,-bind_at_load
1026#
1027#
1028#
1029#
1030# ../build/Makefile.solarisCC5
1031# # -*- mode: makefile -*-
1032# # Makefile to build ALIROOT for SunOS
1033#
1034# # System dependent commands
1035#
1036# XARGS = xargs
1037#
1038# # The compilers
1039# CXX = /opt/SUNWspro/bin/CC
1040# CC = /opt/SUNWspro/bin/cc
1041# F77 = /opt/SUNWspro/bin/f77
1042#
1043# # Global optimisation
1044# OPT = -g -O
1045# NOOPT = -g
1046#
1047# CXXOPT = $(OPT)
1048# CXXNOOPT = $(NOOPT)
1049# COPT = $(OPT)
1050# FOPT = $(OPT)
1051#
1052# # CERNLIB defines
1053# CLIBDEFS = -DCERNLIB_SUN -DCERNLIB_BLDLIB -DCERNLIB_CZ
1054# CLIBCXXOPTS =
1055# CLIBCOPT =
1056# CLIBFOPT = $(CLIBDEFS) -xpp=cpp
1057#
1058# # Compiler flags
1059# CXXFLAGS = $(CXXOPT) +w -KPIC -features=rtti -D_XOPEN_SOURCE -D_XOPEN_VERSION=4 -D__EXTENSIONS__
1060# CXXFLAGSNO = $(CXXNOOPT) +w -KPIC -features=rtti
1061# CFLAGS = $(COPT) -KPIC -erroff=%none
1062# FFLAGS = $(FOPT) $(CLIBFOPT) $(CLIBDEFS) -KPIC
1063# # rmkdepend flags for building dependencies of FORTRAN files
1064# DEPENDFFLAGS = $(FFLAGS)
1065#
1066# # rootcint flags
1067# CINTFLAGS =
1068#
1069# SHLIB =
1070# SOEXT = so
1071#
1072# LD = /opt/SUNWspro/bin/CC
1073# LDFLAGS = $(OPT) -Qoption ld -t
1074#
1075# SHLD = $(LD)
1076# SOFLAGS = -G $(LDFLAGS) $(SHLIB)
1077#
1078# SYSLIBS := -L/usr/dt/lib -L/usr/openwin/lib -L/usr/ccs/lib -lXm -lXt \
1079# -lX11 -lm -lgen -ldl -lsocket -lsunmath -lfsu -lfui -lnsl
1080#
1081# # Additional flags and libraries for building aliroot executable
1082#
1083# EXEFLAGS := -O -Qoption ld -t
1084#
1085#
1086#
1087#
1088#
1089# ../build/Makefile.win32gcc
1090# # -*- mode: makefile -*-
1091# # Makefile to build AliRoot for Linux
1092#
1093# # System dependent commands
1094#
1095# XARGS = xargs -r
1096#
1097# # The compilers
1098# CXX = g++
1099# F77 = g77
1100# CC = gcc
1101# CCMAJORV = $(shell $(CC) -dumpversion | cut -d. -f1)
1102# CCMINORV = $(shell $(CC) -dumpversion | cut -d. -f2)
1103#
1104# # Global optimisation
1105# OPT = -O -g
1106# NOOPT = -g
1107#
1108# CXXOPT = $(OPT)
1109# CXXNOOPT = $(NOOPT)
1110# COPT = $(OPT)
1111# FOPT = $(OPT)
1112#
1113# # CERNLIB defines
1114# CLIBDEFS = -DCERNLIB_LINUX -DCERNLIB_BLDLIB -DCERNLIB_CZ
1115# CLIBCXXOPTS =
1116# CLIBCOPT =
1117# CLIBFOPT = $(CLIBDEFS)
1118#
1119# # Compiler flags
1120# CXXFLAGS = $(OPT) -Wall -pipe -Woverloaded-virtual -Weffc++ -D_DLL
1121# CXXFLAGSNO = $(NOOPT) -Wall -pipe -Woverloaded-virtual -Weffc++ -D_DLL
1122# CFLAGS = $(OPT) -Wall -D_DLL
1123# FFLAGS = $(CLIBFOPT) $(FOPT) -fno-second-underscore
1124# # rmkdepend flags for building dependencies of FORTRAN files
1125# DEPENDFFLAGS = $(FFLAGS)
1126#
1127# # rootcint flags
1128# CINTFLAGS =
1129#
1130# LD = g++
1131# LDFLAGS = $(OPT)
1132#
1133# SHLD = $(LD)
1134# SOFLAGS = $(OPT) -shared -Wl,--export-all-symbols -Wl,-soname=$$TMPLIB -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc
1135# SHLIB = $(shell root-config --libs) -lg2c
1136# SOEXT = dll
1137#
1138# ALLD = ar
1139# ALFLAGS = cr
1140# ALLIB =
1141# AEXT = a
1142#
1143# # additional ROOT libraries
1144#
1145# #System libraries
1146# SYSLIBS := -ldl -lg2c -lcrypt -L/usr/X11R6/lib -lX11
1147#
1148#
1149#
1150#
1151#
1152
1153
1154
1155
1156
1157