]> git.uio.no Git - u/mrichter/AliRoot.git/blame - build/Makefile.macosx
1) corrections for Coverity reports
[u/mrichter/AliRoot.git] / build / Makefile.macosx
CommitLineData
d95a3ef8 1# -*- mode: makefile -*-
b934f194 2# Makefile for AliRoot for MacOS X with gcc
3
3a8f99bd 4XARGS = xargs
5
f3564e28 6# OS version
7MACOSX_MAJOR := $(strip $(shell sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 1))
8MACOSX_MINOR := $(strip $(shell sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2))
9
10# fink directories
11FINK_ROOT := $(shell which fink | sed -e 's?/bin/fink??')
796dbee6 12ifeq (,$(FINK_ROOT))
13# No fink, build will probably fail, but we try a guess
14FINK_ROOT=/usr/local
15endif
f3564e28 16
02a1d5c1 17# Global optimisation
796dbee6 18OPT = -O -g
b5417bd7 19NOOPT = -O0 -g
02a1d5c1 20
19ca05d1 21CXXOPT = $(OPT)
22CXXNOOPT = $(NOOPT)
23COPT = $(OPT)
02a1d5c1 24FOPT = $(OPT) -fno-second-underscore
c9c74649 25ifeq (,$(findstring g95,$(F77)))
de6c7cfd 26FOPT += -fbounds-check
27endif
02a1d5c1 28
29# CERNLIB defines
796dbee6 30CLIBDEFS = -DCERNLIB_LINUX -DCERNLIB_BLDLIB -DCERNLIB_CZ -DCERNLIB_PPC
02a1d5c1 31CLIBCXXOPTS =
32CLIBCOPT =
19ca05d1 33CLIBFOPT = $(CLIBDEFS)
34
d76d4136 35CXXWARN = -Wall -Wno-long-long -W -Weffc++ -Wshadow -Woverloaded-virtual -ansi
36
37CXXSTF = -pipe -fbounds-check -fsigned-char -fno-common -fmessage-length=0 -fno-default-inline -fno-inline -I/usr/X11R6/include -I$(FINK_ROOT)/include
b5417bd7 38
19ca05d1 39# Compiler flags
7da87db6 40CXXFLAGS = $(CXXOPT) $(CXXSTF)
796dbee6 41
b5417bd7 42CXXFLAGSNO = $(CXXNOOPT) $(CXXSTF)
796dbee6 43
6c111d79 44CFLAGS = $(COPT) -Wall -W -fno-common -pipe -I$(FINK_ROOT)/include
796dbee6 45
25d9678b 46FFLAGS = $(CLIBFOPT) $(FOPT)
c9c74649 47ifneq (,$(findstring g95,$(F77)))
25d9678b 48FFLAGS += -ftrace=full
7da87db6 49FFLAGS +=-DFORTRAN_G95
50else
51FFLAGS +=-DFORTRAN_GFORTRAN
25d9678b 52endif
7da87db6 53
19ca05d1 54# rmkdepend flags for building dependencies of FORTRAN files
55DEPENDFFLAGS = $(FFLAGS)
56
57# rootcint flags
58CINTFLAGS =
02a1d5c1 59
f3564e28 60LD = export MACOSX_DEPLOYMENT_TARGET=$(MACOSX_MAJOR).$(MACOSX_MINOR) ; \
02a1d5c1 61 unset LD_PREBIND ; \
5f30d16c 62 $(shell root-config --ld)
2bdfa405 63LDFLAGS = $(OPT) $(DICTLOAD)
02a1d5c1 64
65SHLD := $(LD)
8e02d10e 66SOFLAGS := -dynamiclib -undefined dynamic_lookup -single_module
f3564e28 67SHLIB :=
02a1d5c1 68SOEXT := so
69
02a1d5c1 70ALLD = ar
71ALFLAGS = cr
72ALLIB =
73AEXT = a
74
02a1d5c1 75DEPENDCXXFLAGS = $(CXXFLAGS) -I/usr/include/sys
76
de6c7cfd 77SYSLIBS := -L/usr/X11R6/lib -lX11
02a1d5c1 78
de6c7cfd 79EXEFLAGS := -bind_at_load
f3564e28 80
02a1d5c1 81#System libraries
796dbee6 82
c9c74649 83ifneq (,$(findstring g95,$(F77)))
84SYSLIBS += -L$(shell $(F77) --print-search-dirs | sed -n -e 's/install: //p') -lf95
85DYLIB += -L$(shell $(F77) --print-search-dirs | sed -n -e 's/install: //p') -lf95
f3564e28 86else
626d87b0 87SYSLIBS += -ldl $(shell $(F77) -print-file-name=libgfortran.dylib)
88SYSLIBS += $(shell $(F77) -print-file-name=libgfortranbegin.a)
f3564e28 89endif