]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - build/Makefile.linuxx8664gcc
Fixes for sub-project submissions. Subprojects can now be submitted by running the...
[u/mrichter/AliRoot.git] / build / Makefile.linuxx8664gcc
index b71be45fc8e2397185e064d5e88058693b40c5a2..5f1ec7732e07e6137df2decbc28c8f6ec7c61273 100644 (file)
@@ -5,15 +5,11 @@
 
 XARGS = xargs -r
 
-# The compilers
-CXX           = $(shell root-config --cxx) 
-CC           = $(shell root-config --cc)
 CCMAJORV      = $(shell $(CC) -dumpversion | cut -d. -f1)
 CCMINORV      = $(shell $(CC) -dumpversion | cut -d. -f2)
-F77          = $(shell root-config --f77)
 
 # Global optimisation
-OPT           = -O -g
+OPT           = -O2 -g
 NOOPT         = -g
 
 CXXOPT        = $(OPT)
@@ -27,26 +23,28 @@ CLIBCXXOPTS   =
 CLIBCOPT      =
 CLIBFOPT      = $(CLIBDEFS)
 
+CXXWARN              = -Wall -Wno-long-long -W -Weffc++ -Wshadow -Woverloaded-virtual -ansi
+
 # Compiler flags
 ifeq ($(CCMAJORV),2)
-CXXFLAGS       = $(OPT) -W -Wall -fPIC -pipe -m64
-CXXFLAGSNO     = $(NOOPT) -W -Wall -fPIC -pipe -m64
+CXXFLAGS       = $(OPT)   -fPIC -pipe
+CXXFLAGSNO     = $(NOOPT) -fPIC -pipe
 else
 ifeq ($(CCMAJORV),3)
-CXXFLAGS       = $(OPT) -W -Wall -Weffc++ -Woverloaded-virtual -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi -Dlinux -m64
-CXXFLAGSNO     = $(NOOPT) -W -Wall -Weffc++ -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi -m64
+CXXFLAGS       = $(OPT)   -fPIC -pipe -fmessage-length=0 -Dlinux
+CXXFLAGSNO     = $(NOOPT) -fPIC -pipe -fmessage-length=0
 else
 ifeq ($(CCMAJORV),4)
-CXXFLAGS       = $(OPT) -W -Wall -Weffc++ -Woverloaded-virtual -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi -Dlinux -m64
-CXXFLAGSNO     = $(NOOPT) -W -Wall -Weffc++ -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi -m64
+CXXFLAGS       = $(OPT)   -fPIC -pipe -fmessage-length=0 -Dlinux
+CXXFLAGSNO     = $(NOOPT) -fPIC -pipe -fmessage-length=0
 else
-CXXFLAGS       = $(OPT) -W -Wall -Woverloaded-virtual -fPIC -pipe -fmessage-length=0 -Wno-long-long -ansi -Dlinux -m64
-CXXFLAGSNO     = $(NOOPT) -W -Wall -Weffc++ -fPIC -pipe -fmessage-length=0 -Wno-long-long -ansi -m64
+CXXFLAGS       = $(OPT)   -fPIC -pipe -fmessage-length=0 -Dlinux
+CXXFLAGSNO     = $(NOOPT) -fPIC -pipe -fmessage-length=0
 endif
 endif
 endif
-CFLAGS        = $(OPT) -Wall -Werror -fPIC -pipe -Wno-long-long -pedantic-errors -ansi -m64 
-FFLAGS         = $(CLIBFOPT) $(FOPT) -fno-second-underscore -fPIC -fno-f2c -m64
+CFLAGS        = $(OPT) -Wall -Werror -fPIC -pipe -Wno-long-long -pedantic-errors -ansi
+FFLAGS         = $(CLIBFOPT) $(FOPT) -fno-second-underscore -fPIC -fno-f2c
 
 ifeq (g95,$(F77))
 FFLAGS       +=-DFORTRAN_G95
@@ -76,12 +74,12 @@ LIBNOVER      = `find /lib64 -name 'libNoVersion*.so' | xargs --replace basename
 
 SYSLIBS      := -ldl -lcrypt -L/usr/X11R6/lib64 -lX11  $(LIBNOVER)
 
-ifeq (g95,$(F77))
-SHLIB += -L$(shell g95 --print-search-dirs | sed -n -e 's/install: //p') -lf95
+ifneq (,$(findstring g95,$(F77)))
+SHLIB += -L$(shell $(F77) --print-search-dirs | sed -n -e 's/install: //p') -lf95
 else
-ifeq (gfortran,$(F77))
-SHLIB := $(shell gfortran -print-file-name=libgfortran.so)
-SHLIB += $(shell gfortran -print-file-name=libgfortranbegin.a)
+ifneq (,$(findstring gfortran,$(F77)))
+SHLIB := $(shell $(F77) -print-file-name=libgfortran.so)
+SHLIB += $(shell $(F77) -print-file-name=libgfortranbegin.a)
 else
 SHLIB         = -lg2c
 SYSLIBS +=  -lg2c