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