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