X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=build%2FMakefile.macosx;h=4652c8d919d5a8820c8a9e0a9f882ca4ebed78e6;hb=59f6cc12123bba6112302b7323d0e91d6cf996e1;hp=053ac034a2c8c71f16216904c46dd2e6be5f6042;hpb=587308f87ffaab563ecc75fc077fcddb64e05384;p=u%2Fmrichter%2FAliRoot.git diff --git a/build/Makefile.macosx b/build/Makefile.macosx index 053ac034a2c..4652c8d919d 100644 --- a/build/Makefile.macosx +++ b/build/Makefile.macosx @@ -1,49 +1,78 @@ +# -*- 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++ -F77 = g77 -CC = gcc +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 -pipe -fsigned-char -fno-common -fweak-coalesced -fmessage-length=0 -I/sw/include -Wno-long-double #-Weffc++ -Woverloaded-virtual -CXXFLAGSNO = $(CXXNOOPT) -Wall -W -pipe -fsigned-char -fno-common -fweak-coalesced -fmessage-length=0 -I/sw/include -Wno-long-double -CFLAGS = $(COPT) -Wall -W -fno-common -fweak-coalesced -pipe -I/sw/include +CXXFLAGS = $(CXXOPT) $(CXXSTF) + +CXXFLAGSNO = $(CXXNOOPT) $(CXXSTF) + +CFLAGS = $(COPT) -Wall -W -fno-common -pipe -I$(FINK_ROOT)/include + 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) # rootcint flags CINTFLAGS = -LD = export MACOSX_DEPLOYMENT_TARGET=10.3 ; \ +LD = export MACOSX_DEPLOYMENT_TARGET=$(MACOSX_MAJOR).$(MACOSX_MINOR) ; \ unset LD_PREBIND ; \ - g++ + $(shell root-config --ld) LDFLAGS = $(OPT) $(DICTLOAD) SHLD := $(LD) SOFLAGS := -bundle -undefined dynamic_lookup -SHLIB := -L/sw/lib -lg2c +SHLIB := SOEXT := so DYLD := $(LD) DYFLAGS = -dynamiclib -undefined dynamic_lookup -single_module -DYLIB := -L/sw/lib -lg2c +DYLIB := DYEXT := dylib ALLD = ar @@ -53,10 +82,16 @@ AEXT = a DEPENDCXXFLAGS = $(CXXFLAGS) -I/usr/include/sys -GLIBS = -L/usr/X11R6/lib -lX11 +SYSLIBS := -L/usr/X11R6/lib -lX11 -#System libraries -SYSLIBS = -ldl +EXEFLAGS := -bind_at_load -EXEFLAGS+= -bind_at_load +#System libraries +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 $(shell $(F77) -print-file-name=libgfortran.dylib) +SYSLIBS += $(shell $(F77) -print-file-name=libgfortranbegin.a) +endif