]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - build/Makefile.linux
New mapping in agreement with the new instructions from Paolo and Giacinto
[u/mrichter/AliRoot.git] / build / Makefile.linux
index 6d1eb7f0505402642775a6393c8bc15cb51c6a31..f7af375068bd8cad3e61e0a90f108fbe2458e7de 100644 (file)
@@ -6,11 +6,20 @@ 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)
 
+ifneq (,$(findstring g95,$(ROOTBUILD)))
+F77      = g95
+else
+ifneq (,$(findstring gfortran,$(ROOTBUILD)))
+F77      = gfortran
+else
+F77      = g77
+endif
+endif
+
 # Global optimisation
 OPT           = -O -g
 NOOPT         = -g
@@ -32,15 +41,31 @@ CXXFLAGS       = $(OPT) -W -Wall -fPIC -pipe
 CXXFLAGSNO     = $(NOOPT) -W -Wall -fPIC -pipe
 else
 ifeq ($(CCMAJORV),3)
-CXXFLAGS       = $(OPT) -W -Wall -Werror -Woverloaded-virtual -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi -Dlinux
-CXXFLAGSNO     = $(NOOPT) -W -Wall -Werror -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi
+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 -Werror -fPIC -pipe -fmessage-length=0 -Wno-long-long -ansi
+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
+
+ifneq (,$(findstring g95,$(ROOTBUILD)))
+FFLAGS       +=-DFORTRAN_G95
+else
+ifneq (,$(findstring gfortran,$(ROOTBUILD)))
+FFLAGS       +=-DFORTRAN_GFORTRAN
+else
+FFLAGS       +=
+endif
+endif
+
 # rmkdepend flags for building dependencies of FORTRAN files
 DEPENDFFLAGS   = $(FFLAGS)
 
@@ -52,9 +77,23 @@ 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,$(ROOTBUILD)))
+SHLIB += -L$(shell g95 --print-search-dirs | sed -n -e 's/install: //p') -lf95
+else
+ifneq (,$(findstring gfortran,$(ROOTBUILD)))
+SHLIB := $(shell gfortran -print-file-name=libgfortran.so)
+SHLIB += $(shell gfortran -print-file-name=libgfortranbegin.a)
+else
+SHLIB         = -lg2c
+SYSLIBS +=  -lg2c
+endif
+endif
+
 ALLD         = ar
 ALFLAGS       = cr
 ALLIB         = 
@@ -62,10 +101,6 @@ AEXT              = a
 
 # additional ROOT libraries
 
-LIBNOVER      = `find /lib -name 'libNoVersion*.so' | xargs --replace basename {} .so | sed -e 's/lib/ -l/'`
-
-#System libraries
-SYSLIBS      := -ldl -lg2c -lcrypt -L/usr/X11R6/lib -lX11  $(LIBNOVER)