+# -*- mode: makefile -*-
# Makefile for AliRoot for MacOS X with gcc
XARGS = xargs
# The compilers
CXX = g++
CC = gcc
-
-ifeq (g95,$(findstring g95,$(ROOTBUILD)))
-F77 = g95
-else
-F77 = gfortran
-endif
+F77 = $(shell root-config --f77)
# Global optimisation
OPT = -O -g
CXXNOOPT = $(NOOPT)
COPT = $(OPT)
FOPT = $(OPT) -fno-second-underscore -m64
-ifeq (g95,$(findstring g95,$(ROOTBUILD)))
+ifeq (g95,$(F77))
FOPT += -fbounds-check
endif
# CERNLIB defines
-CLIBDEFS = -DCERNLIB_LINUX -DCERNLIB_BLDLIB -DCERNLIB_CZ -DCERNLIB_PPC
+CLIBDEFS = -DCERNLIB_LXIA64 -DCERNLIB_BLDLIB -DCERNLIB_CZ -DCERNLIB_PPC
CLIBCXXOPTS =
CLIBCOPT =
CLIBFOPT = $(CLIBDEFS)
-CXXSTF = -m64 -pipe -Wall -W -Wno-long-double -pipe -fbounds-check -fsigned-char -fno-common -fmessage-length=0 -Woverloaded-virtual -Weffc++ -Wconversion -fno-default-inline -fno-inline -I/usr/X11R6/include -I$(FINK_ROOT)/include
+CXXSTF = -m64 -pipe -Wall -W -Wno-long-double -pipe -fbounds-check -fsigned-char -fno-common -fmessage-length=0 -Woverloaded-virtual -Weffc++ -Wconversion -Wshadow -fno-default-inline -fno-inline -I/usr/X11R6/include -I$(FINK_ROOT)/include
# Compiler flags
CXXFLAGS = $(CXXOPT) $(CXXSTF)
-ifneq (,$(findstring g95,$(ROOTBUILD)))
-FFLAGS +=-DFORTRAN_G95
-else
-ifneq (,$(findstring gfortran,$(ROOTBUILD)))
-FFLAGS +=-DFORTRAN_GFORTRAN
-else
-FFLAGS +=
-endif
-endif
-
CXXFLAGSNO = $(CXXNOOPT) $(CXXSTF)
CFLAGS = $(COPT) -m64 -Wall -W -fno-common -pipe -I$(FINK_ROOT)/include
FFLAGS = $(CLIBFOPT) $(FOPT)
-ifeq (g95,$(findstring g95,$(ROOTBUILD)))
+ifeq (g95,$(F77))
FFLAGS += -ftrace=full
+FFLAGS +=-DFORTRAN_G95
+else
+FFLAGS +=-DFORTRAN_GFORTRAN
endif
+
# rmkdepend flags for building dependencies of FORTRAN files
DEPENDFFLAGS = $(FFLAGS)
#System libraries
-ifeq (g95,$(findstring g95,$(ROOTBUILD)))
+ifeq (g95,$(F77))
SYSLIBS += -L$(shell g95 --print-search-dirs | sed -n -e 's/install: //p') -lf95
else
SYSLIBS += -ldl $(shell $(F77) -m64 -print-file-name=libgfortran.dylib)