]>
Commit | Line | Data |
---|---|---|
8371d3e2 | 1 | # Makefile to build AliRoot for Linux |
72b92279 | 2 | |
6a772515 | 3 | # System dependent commands |
4 | ||
5 | XARGS = xargs -r | |
6 | ||
72b92279 | 7 | # The compilers |
8 | CXX = g++ | |
72b92279 | 9 | CC = gcc |
3deb9beb | 10 | CCMAJORV = $(shell $(CC) -dumpversion | cut -d. -f1) |
11 | CCMINORV = $(shell $(CC) -dumpversion | cut -d. -f2) | |
72b92279 | 12 | |
8371d3e2 | 13 | ifneq (,$(findstring g95,$(ROOTBUILD))) |
14 | F77 = g95 | |
15 | else | |
16 | ifneq (,$(findstring gfortran,$(ROOTBUILD))) | |
17 | F77 = gfortran | |
18 | else | |
19 | F77 = g77 | |
20 | endif | |
21 | endif | |
22 | ||
72b92279 | 23 | # Global optimisation |
8371d3e2 | 24 | OPT = -O0 -g |
72b92279 | 25 | NOOPT = -g |
26 | ||
27 | CXXOPT = $(OPT) | |
28 | CXXNOOPT = $(NOOPT) | |
29 | COPT = $(OPT) | |
30 | FOPT = $(OPT) | |
31 | ||
32 | # CERNLIB defines | |
33 | CLIBDEFS = -DCERNLIB_LXIA64 -DCERNLIB_BLDLIB -DCERNLIB_CZ | |
34 | CLIBCXXOPTS = | |
35 | CLIBCOPT = | |
36 | CLIBFOPT = $(CLIBDEFS) | |
37 | ||
38 | # Compiler flags | |
8371d3e2 | 39 | ifeq ($(CCMAJORV),2) |
40 | CXXFLAGS = $(OPT) -W -Wall -fPIC -pipe -m64 | |
41 | CXXFLAGSNO = $(NOOPT) -W -Wall -fPIC -pipe -m64 | |
42 | else | |
43 | ifeq ($(CCMAJORV),3) | |
44 | CXXFLAGS = $(OPT) -W -Wall -Weffc++ -Woverloaded-virtual -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi -Dlinux -m64 | |
45 | CXXFLAGSNO = $(NOOPT) -W -Wall -Weffc++ -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi -m64 | |
46 | else | |
3deb9beb | 47 | ifeq ($(CCMAJORV),4) |
8371d3e2 | 48 | CXXFLAGS = $(OPT) -W -Wall -Weffc++ -Woverloaded-virtual -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi -Dlinux -m64 |
49 | CXXFLAGSNO = $(NOOPT) -W -Wall -Weffc++ -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi -m64 | |
3deb9beb | 50 | else |
8371d3e2 | 51 | CXXFLAGS = $(OPT) -W -Wall -Woverloaded-virtual -fPIC -pipe -fmessage-length=0 -Wno-long-long -ansi -Dlinux -m64 |
52 | CXXFLAGSNO = $(NOOPT) -W -Wall -Weffc++ -fPIC -pipe -fmessage-length=0 -Wno-long-long -ansi -m64 | |
53 | endif | |
3deb9beb | 54 | endif |
8371d3e2 | 55 | endif |
56 | CFLAGS = $(OPT) -Wall -Werror -fPIC -pipe -Wno-long-long -pedantic-errors -ansi -m64 | |
57 | FFLAGS = $(CLIBFOPT) $(FOPT) -fno-second-underscore -fPIC -fno-f2c -m64 | |
58 | ||
59 | ifneq (,$(findstring g95,$(ROOTBUILD))) | |
60 | FFLAGS +=-DFORTRAN_G95 | |
61 | else | |
62 | ifneq (,$(findstring gfortran,$(ROOTBUILD))) | |
63 | FFLAGS +=-DFORTRAN_GFORTRAN | |
64 | else | |
65 | FFLAGS += | |
66 | endif | |
67 | endif | |
68 | ||
72b92279 | 69 | # rmkdepend flags for building dependencies of FORTRAN files |
8371d3e2 | 70 | DEPENDFFLAGS = $(FFLAGS) |
72b92279 | 71 | |
72 | # rootcint flags | |
73 | CINTFLAGS = | |
74 | ||
75 | LD = g++ | |
8371d3e2 | 76 | LDFLAGS = $(OPT) |
72b92279 | 77 | |
8371d3e2 | 78 | SHLD = $(LD) |
79 | SOFLAGS = $(OPT) -shared -Wl | |
72b92279 | 80 | SOEXT = so |
81 | ||
8371d3e2 | 82 | #System libraries |
83 | LIBNOVER = `find /lib64 -name 'libNoVersion*.so' | xargs --replace basename {} .so | sed -e 's/lib64/ -l/'` | |
84 | ||
85 | SYSLIBS := -ldl -lcrypt -L/usr/X11R6/lib64 -lX11 $(LIBNOVER) | |
86 | ||
87 | ifneq (,$(findstring g95,$(ROOTBUILD))) | |
88 | SHLIB += -L$(shell g95 --print-search-dirs | sed -n -e 's/install: //p') -lf95 | |
89 | else | |
90 | ifneq (,$(findstring gfortran,$(ROOTBUILD))) | |
91 | SHLIB := $(shell gfortran -print-file-name=libgfortran.so) | |
92 | SHLIB += $(shell gfortran -print-file-name=libgfortranbegin.a) | |
93 | else | |
94 | SHLIB = -lg2c | |
95 | SYSLIBS += -lg2c | |
96 | endif | |
97 | endif | |
98 | ||
72b92279 | 99 | ALLD = ar |
100 | ALFLAGS = cr | |
101 | ALLIB = | |
102 | AEXT = a | |
103 | ||
72b92279 | 104 | |
72b92279 | 105 | |
72b92279 | 106 | |
8371d3e2 | 107 | |
72b92279 | 108 | |
109 | ||
110 | ||
111 |