Bug spotted by Raphael.
[u/mrichter/AliRoot.git] / build / Makefile.linux
CommitLineData
d95a3ef8 1# -*- mode: makefile -*-
b934f194 2# Makefile to build AliRoot for Linux
3
6a772515 4# System dependent commands
5
6XARGS = xargs -r
7
02a1d5c1 8CCMAJORV = $(shell $(CC) -dumpversion | cut -d. -f1)
19ca05d1 9CCMINORV = $(shell $(CC) -dumpversion | cut -d. -f2)
874112da 10
02a1d5c1 11# Global optimisation
234197c8 12OPT = -O -g
19ca05d1 13NOOPT = -g
02a1d5c1 14
19ca05d1 15CXXOPT = $(OPT)
16CXXNOOPT = $(NOOPT)
02a1d5c1 17COPT = $(OPT)
19ca05d1 18FOPT = $(OPT)
02a1d5c1 19
20# CERNLIB defines
02a1d5c1 21CLIBDEFS = -DCERNLIB_LINUX -DCERNLIB_BLDLIB -DCERNLIB_CZ
22CLIBCXXOPTS =
23CLIBCOPT =
19ca05d1 24CLIBFOPT = $(CLIBDEFS)
25
26# Compiler flags
27ifeq ($(CCMAJORV),2)
28CXXFLAGS = $(OPT) -W -Wall -fPIC -pipe
29CXXFLAGSNO = $(NOOPT) -W -Wall -fPIC -pipe
30else
0038d136 31ifeq ($(CCMAJORV),3)
ec22f7b0 32CXXFLAGS = $(OPT) -W -Wall -Weffc++ -Woverloaded-virtual -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi -Dlinux
33CXXFLAGSNO = $(NOOPT) -W -Wall -Weffc++ -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi
0038d136 34else
3deb9beb 35ifeq ($(CCMAJORV),4)
36CXXFLAGS = $(OPT) -W -Wall -Weffc++ -Woverloaded-virtual -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi -Dlinux
37CXXFLAGSNO = $(NOOPT) -W -Wall -Weffc++ -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi
38else
0038d136 39CXXFLAGS = $(OPT) -W -Wall -Woverloaded-virtual -fPIC -pipe -fmessage-length=0 -Wno-long-long -ansi -Dlinux
ec22f7b0 40CXXFLAGSNO = $(NOOPT) -W -Wall -Weffc++ -fPIC -pipe -fmessage-length=0 -Wno-long-long -ansi
0038d136 41endif
19ca05d1 42endif
3deb9beb 43endif
931c1b8a 44CFLAGS = $(OPT) -Wall -Werror -fPIC -pipe -Wno-long-long -pedantic-errors -ansi
55c0e7ad 45FFLAGS = $(CLIBFOPT) $(FOPT) -fPIC -fno-second-underscore
874112da 46
c9c74649 47ifneq (,$(findstring g95,$(F77)))
874112da 48FFLAGS +=-DFORTRAN_G95
49else
c9c74649 50ifneq (,$(findstring gfortran,$(F77)))
874112da 51FFLAGS +=-DFORTRAN_GFORTRAN
52else
53FFLAGS +=
54endif
55endif
56
19ca05d1 57# rmkdepend flags for building dependencies of FORTRAN files
58DEPENDFFLAGS = $(FFLAGS)
59
60# rootcint flags
61CINTFLAGS =
02a1d5c1 62
5f30d16c 63LD = $(shell root-config --ld)
02a1d5c1 64LDFLAGS = $(OPT)
65
66SHLD = $(LD)
67SOFLAGS = $(OPT) -shared -Wl
02a1d5c1 68SOEXT = so
69
874112da 70#System libraries
71SYSLIBS := -ldl -lcrypt -L/usr/X11R6/lib -lX11
72
c9c74649 73ifneq (,$(findstring g95,$(F77)))
74SHLIB += -L$(shell $(F77) --print-search-dirs | sed -n -e 's/install: //p') -lf95
874112da 75else
c9c74649 76ifneq (,$(findstring gfortran,$(F77)))
975efbc9 77SHLIB := $(shell $(F77) -m32 -print-file-name=libgfortran.so)
78SHLIB += $(shell $(F77) -m32 -print-file-name=libgfortranbegin.a)
c58d9e7d 79SYSLIBS += $(SHLIB)
874112da 80else
81SHLIB = -lg2c
82SYSLIBS += -lg2c
83endif
84endif
85
02a1d5c1 86ALLD = ar
87ALFLAGS = cr
88ALLIB =
89AEXT = a
90
91# additional ROOT libraries
02a1d5c1 92
02a1d5c1 93
02a1d5c1 94
95
96
97