# Makefile for AliRoot for MacOS X with gcc
+XARGS = xargs
+
# OS version
MACOSX_MAJOR := $(strip $(shell sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 1))
MACOSX_MINOR := $(strip $(shell sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2))
# Global optimisation
OPT = -O -g
-NOOPT = -g
+NOOPT = -O0 -g
CXXOPT = $(OPT)
CXXNOOPT = $(NOOPT)
CLIBCOPT =
CLIBFOPT = $(CLIBDEFS)
+CXXSTF = -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
+
# Compiler flags
-CXXFLAGS = $(CXXOPT) -Wall -W -Wno-long-double -pipe -fbounds-check -fsigned-char -fno-common -fmessage-length=0 -I$(FINK_ROOT)/include #-Weffc++ -Woverloaded-virtual
+CXXFLAGS = $(CXXOPT) $(CXXSTF) -Weffc++
ifeq (g95,$(findstring g95,$(ROOTBUILD)))
CXXFLAGS+=-DFORTRAN_G95
endif
-CXXFLAGSNO = $(CXXNOOPT) -Wall -W -pipe -fsigned-char -fno-common -fmessage-length=0 -I$(FINK_ROOT)/include -Wno-long-double
+CXXFLAGSNO = $(CXXNOOPT) $(CXXSTF)
CFLAGS = $(COPT) -Wall -W -fno-common -pipe -I$(FINK_ROOT)/include
-FFLAGS = $(CLIBFOPT) $(FOPT)
+FFLAGS = $(CLIBFOPT) $(FOPT) -ftrace=full
# rmkdepend flags for building dependencies of FORTRAN files
DEPENDFFLAGS = $(FFLAGS)
#System libraries
ifeq (g95,$(findstring g95,$(ROOTBUILD)))
-SYSLIBS += -L$(dir $(shell find $(FINK_ROOT) -name libf95.a)) -lf95
+SYSLIBS += -L$(shell g95 --print-search-dirs | sed -n -e 's/install: //p') -lf95
else
-SYSLIBS += -ldl -L$(dir $(shell find $(FINK_ROOT) -name libgfortran.dylib)) -lgfortranbegin -lgfortran
+SYSLIBS += -ldl -L$(shell gfortran --print-search-dirs | sed -n -e 's/install: //p') -lgfortranbegin -lgfortran
endif