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