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