]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - build/Makefile.linux
Updated OCDB entries taken from 2009 RAW OCDB. The Pb-Pb entry is put temporarely...
[u/mrichter/AliRoot.git] / build / Makefile.linux
index 8a0632ab82052079f967e47ded1e7cd6c2483f63..849fa6f4ec504195e643f7cde19ac7f9aa108a17 100644 (file)
@@ -1,13 +1,10 @@
+# -*- mode: makefile -*-
 # Makefile to build AliRoot for Linux
 
 # System dependent commands
 
 XARGS = xargs -r
 
-# The compilers
-CXX           = g++ 
-F77          = g77
-CC           = gcc
 CCMAJORV      = $(shell $(CC) -dumpversion | cut -d. -f1)
 CCMINORV      = $(shell $(CC) -dumpversion | cut -d. -f2)
 
@@ -35,26 +32,57 @@ ifeq ($(CCMAJORV),3)
 CXXFLAGS       = $(OPT) -W -Wall -Weffc++ -Woverloaded-virtual -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi -Dlinux
 CXXFLAGSNO     = $(NOOPT) -W -Wall -Weffc++ -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi
 else
+ifeq ($(CCMAJORV),4)
+CXXFLAGS       = $(OPT) -W -Wall -Weffc++ -Woverloaded-virtual -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi -Dlinux
+CXXFLAGSNO     = $(NOOPT) -W -Wall -Weffc++ -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi
+else
 CXXFLAGS       = $(OPT) -W -Wall -Woverloaded-virtual -fPIC -pipe -fmessage-length=0 -Wno-long-long -ansi -Dlinux
 CXXFLAGSNO     = $(NOOPT) -W -Wall -Weffc++ -fPIC -pipe -fmessage-length=0 -Wno-long-long -ansi
 endif
 endif
+endif
 CFLAGS        = $(OPT) -Wall -Werror -fPIC -pipe -Wno-long-long -pedantic-errors -ansi
-FFLAGS         = $(CLIBFOPT) $(FOPT) -fno-second-underscore
+FFLAGS         = $(CLIBFOPT) $(FOPT) -fPIC -fno-second-underscore
+
+ifneq (,$(findstring g95,$(F77)))
+FFLAGS       +=-DFORTRAN_G95
+else
+ifneq (,$(findstring gfortran,$(F77)))
+FFLAGS       +=-DFORTRAN_GFORTRAN
+else
+FFLAGS       +=
+endif
+endif
+
 # rmkdepend flags for building dependencies of FORTRAN files
 DEPENDFFLAGS   = $(FFLAGS)
 
 # rootcint flags
 CINTFLAGS     = 
 
-LD            = g++
+LD            = $(shell root-config --ld) 
 LDFLAGS       = $(OPT) 
 
 SHLD         = $(LD)
 SOFLAGS       = $(OPT) -shared -Wl 
-SHLIB         = -lg2c
 SOEXT        = so
 
+#System libraries
+SYSLIBS      := -ldl -lcrypt -L/usr/X11R6/lib -lX11
+
+ifneq (,$(findstring g95,$(F77)))
+SHLIB += -L$(shell $(F77) --print-search-dirs | sed -n -e 's/install: //p') -lf95
+else
+ifneq (,$(findstring gfortran,$(F77)))
+SHLIB := $(shell $(F77) -m32 -print-file-name=libgfortran.so)
+SHLIB += $(shell $(F77) -m32 -print-file-name=libgfortranbegin.a)
+SYSLIBS += $(SHLIB)
+else
+SHLIB         = -lg2c
+SYSLIBS +=  -lg2c
+endif
+endif
+
 ALLD         = ar
 ALFLAGS       = cr
 ALLIB         = 
@@ -62,8 +90,6 @@ AEXT        = a
 
 # additional ROOT libraries
 
-#System libraries
-SYSLIBS      := -ldl -lg2c -lcrypt -L/usr/X11R6/lib -lX11