X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=build%2FMakefile.macosx;h=e36d3e9432548efb34da4573da9c66969c305fd4;hb=10add0d41eeb1259be17f98f2352fc342388701d;hp=043a42f7ef9dd9156a6c50726cfb59ad583fa9d3;hpb=10a7343b1d13824c2abcf8cd47ebf778f99b1779;p=u%2Fmrichter%2FAliRoot.git diff --git a/build/Makefile.macosx b/build/Makefile.macosx index 043a42f7ef9..e36d3e94325 100644 --- a/build/Makefile.macosx +++ b/build/Makefile.macosx @@ -1,44 +1,82 @@ +# 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 +ifeq (g95,$(findstring g95,$(ROOTBUILD))) +F77 = g95 +else +F77 = gfortran +endif + # Global optimisation OPT = -O -g +NOOPT = -O0 -g -CXXOPTS = $(OPT) -Wall -W -pipe -fsigned-char -fno-common -fweak-coalesced -fmessage-length=0 -COPT = $(OPT) -Wall -W -fno-common -fweak-coalesced +CXXOPT = $(OPT) +CXXNOOPT = $(NOOPT) +COPT = $(OPT) FOPT = $(OPT) -fno-second-underscore -CXXFLAGS = $(CXXOPTS) -I/sw/include -CFLAGS = -Wall -pipe -I/sw/include - -# rootcint flags -CINTFLAGS = +ifeq (g95,$(findstring g95,$(ROOTBUILD))) +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 = +CLIBFOPT = $(CLIBDEFS) + +CXXSTF = -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) + +CXXFLAGSNO = $(CXXNOOPT) $(CXXSTF) + +CFLAGS = $(COPT) -Wall -W -fno-common -pipe -I$(FINK_ROOT)/include + +FFLAGS = $(CLIBFOPT) $(FOPT) +ifeq (g95,$(findstring g95,$(ROOTBUILD))) +FFLAGS += -ftrace=full +FFLAGS +=-DFORTRAN_G95 +else +FFLAGS +=-DFORTRAN_GFORTRAN +endif -# Common Fortran compilation flags -FFLAGS = $(CLIBFOPT) $(CLIBDEFS) $(FOPT) - -LD = export MACOSX_DEPLOYMENT_TARGET=10.3 ; \ +# rmkdepend flags for building dependencies of FORTRAN files +DEPENDFFLAGS = $(FFLAGS) + +# rootcint flags +CINTFLAGS = + +LD = export MACOSX_DEPLOYMENT_TARGET=$(MACOSX_MAJOR).$(MACOSX_MINOR) ; \ unset LD_PREBIND ; \ g++ -LDFLAGS = $(OPT) +LDFLAGS = $(OPT) $(DICTLOAD) SHLD := $(LD) -SOFLAGS := -bundle -flat_namespace -undefined dynamic_lookup -#SHLIB := -lg2c -SHLIB := +SOFLAGS := -bundle -undefined dynamic_lookup +SHLIB := SOEXT := so DYLD := $(LD) -DYFLAGS = -dynamiclib -flat_namespace -undefined dynamic_lookup -single_module -DYLIB := +DYFLAGS = -dynamiclib -undefined dynamic_lookup -single_module +DYLIB := DYEXT := dylib ALLD = ar @@ -46,19 +84,18 @@ ALFLAGS = cr ALLIB = AEXT = a - -# rmkdepend flags for building dependencies of FORTRAN files -DEPENDFFLAGS = $(FFLAGS) - DEPENDCXXFLAGS = $(CXXFLAGS) -I/usr/include/sys -GLIBS = -L/usr/X11R6/lib -lX11 - -#System libraries -SYSLIBS = -ldl - -EXEFLAGS+= -Xlinker -bind_at_load -Xlinker -m #-lg2c - +SYSLIBS := -L/usr/X11R6/lib -lX11 +EXEFLAGS := -bind_at_load +#System libraries +ifeq (g95,$(findstring g95,$(ROOTBUILD))) +SYSLIBS += -L$(shell g95 --print-search-dirs | sed -n -e 's/install: //p') -lf95 +DYLIB += -L$(shell g95 --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