]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - build/Makefile.macosx
1. Adding ARVersion.h as a prerequisite for the DA targets, allows to build the DA...
[u/mrichter/AliRoot.git] / build / Makefile.macosx
index 39b8f4bff64dc8387445579b8e10f4417534eba0..4652c8d919d5a8820c8a9e0a9f882ca4ebed78e6 100644 (file)
@@ -1,59 +1,59 @@
+# -*- mode: makefile -*-
 # 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))
 
 # fink directories
 FINK_ROOT := $(shell which fink | sed -e 's?/bin/fink??')
+ifeq (,$(FINK_ROOT))
+# No fink, build will probably fail, but we try a guess
+FINK_ROOT=/usr/local
+endif
 
 # The compilers
-CXX           = g++ 
-CC           = gcc
-
-ifneq ($(MACOSX_MINOR),4)
-F77          = g77
-else
-ifeq (g95,$(findstring g95,$(ROOTBUILD)))
-F77          = g95
-else
-F77          = gfortran
-endif
-endif
+CXX           = $(shell root-config --cxx) 
+CC           = $(shell root-config --cc)
+F77          = $(shell root-config --f77)
 
 # Global optimisation
-OPT           = -O0 -g
-NOOPT         = -g
+OPT           = -O -g
+NOOPT         = -O0 -g
 
 CXXOPT        = $(OPT) 
 CXXNOOPT      = $(NOOPT) 
 COPT         = $(OPT)
 FOPT         = $(OPT) -fno-second-underscore 
-
+ifeq (,$(findstring g95,$(F77)))
+FOPT        += -fbounds-check
+endif
 
 # CERNLIB defines
-CLIBDEFS      = -DCERNLIB_LINUX -DCERNLIB_BLDLIB -DCERNLIB_CZ
+CLIBDEFS      = -DCERNLIB_LINUX -DCERNLIB_BLDLIB -DCERNLIB_CZ -DCERNLIB_PPC
 CLIBCXXOPTS   =
 CLIBCOPT      =
 CLIBFOPT      = $(CLIBDEFS)
 
+CXXSTF        =  -pipe -Wall -W -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)   -Wall -W -Wno-long-double -pipe -fsigned-char -fno-common -fmessage-length=0 -I$(FINK_ROOT)/include 
-ifneq ($(MACOSX_MINOR),4)
-CXXFLAGS+=-fweak-coalesced
-endif
-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
-ifneq ($(MACOSX_MINOR),4)
-CXXFLAGSNO+=-fweak-coalesced
-endif
+CXXFLAGS      = $(CXXOPT) $(CXXSTF)
+
+CXXFLAGSNO    = $(CXXNOOPT) $(CXXSTF) 
+
 CFLAGS       = $(COPT) -Wall -W -fno-common -pipe -I$(FINK_ROOT)/include
-ifneq ($(MACOSX_MINOR),4)
-CFLAGS+=-fweak-coalesced
-endif
+
 FFLAGS        = $(CLIBFOPT) $(FOPT)
+ifneq (,$(findstring g95,$(F77)))
+FFLAGS        += -ftrace=full
+FFLAGS        +=-DFORTRAN_G95
+else
+FFLAGS        +=-DFORTRAN_GFORTRAN
+endif
+
 # rmkdepend flags for building dependencies of FORTRAN files
 DEPENDFFLAGS  = $(FFLAGS)
 
@@ -62,7 +62,7 @@ CINTFLAGS     =
 
 LD            = export MACOSX_DEPLOYMENT_TARGET=$(MACOSX_MAJOR).$(MACOSX_MINOR) ; \
                unset LD_PREBIND ; \
-               g++
+               $(shell root-config --ld)
 LDFLAGS       = $(OPT) $(DICTLOAD)
 
 SHLD        := $(LD)
@@ -82,19 +82,16 @@ AEXT              = a
 
 DEPENDCXXFLAGS = $(CXXFLAGS) -I/usr/include/sys
 
-GLIBS         = -L/usr/X11R6/lib -lX11
+SYSLIBS      := -L/usr/X11R6/lib -lX11
 
-EXEFLAGS     += -bind_at_load 
+EXEFLAGS     := -bind_at_load 
 
 #System libraries
-ifneq ($(MACOSX_MINOR),4)
-SYSLIBS := -lg2c
-else
-ifeq (g95,$(findstring g95,$(ROOTBUILD)))
-SYSLIBS := -L$(dir $(shell find $(FINK_ROOT) -name libf95.a)) -lf95
+
+ifneq (,$(findstring g95,$(F77)))
+SYSLIBS += -L$(shell $(F77) --print-search-dirs | sed -n -e 's/install: //p') -lf95
+DYLIB += -L$(shell $(F77) --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 $(shell $(F77) -print-file-name=libgfortran.dylib)
+SYSLIBS += $(shell $(F77) -print-file-name=libgfortranbegin.a)
 endif
-endif
-
-