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