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