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