Chose the Fortran compiler after ROOT
[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# The compilers
18CXX = g++
02a1d5c1 19CC = gcc
d95a3ef8 20F77 = $(root-config --f77)
f3564e28 21
02a1d5c1 22# Global optimisation
796dbee6 23OPT = -O -g
b5417bd7 24NOOPT = -O0 -g
02a1d5c1 25
19ca05d1 26CXXOPT = $(OPT)
27CXXNOOPT = $(NOOPT)
28COPT = $(OPT)
02a1d5c1 29FOPT = $(OPT) -fno-second-underscore
d95a3ef8 30ifeq (g95,$(F77))
de6c7cfd 31FOPT += -fbounds-check
32endif
02a1d5c1 33
34# CERNLIB defines
796dbee6 35CLIBDEFS = -DCERNLIB_LINUX -DCERNLIB_BLDLIB -DCERNLIB_CZ -DCERNLIB_PPC
02a1d5c1 36CLIBCXXOPTS =
37CLIBCOPT =
19ca05d1 38CLIBFOPT = $(CLIBDEFS)
39
8ac4fa64 40CXXSTF = -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
b5417bd7 41
19ca05d1 42# Compiler flags
7da87db6 43CXXFLAGS = $(CXXOPT) $(CXXSTF)
796dbee6 44
b5417bd7 45CXXFLAGSNO = $(CXXNOOPT) $(CXXSTF)
796dbee6 46
6c111d79 47CFLAGS = $(COPT) -Wall -W -fno-common -pipe -I$(FINK_ROOT)/include
796dbee6 48
25d9678b 49FFLAGS = $(CLIBFOPT) $(FOPT)
d95a3ef8 50ifeq (g95,$(F77))
25d9678b 51FFLAGS += -ftrace=full
7da87db6 52FFLAGS +=-DFORTRAN_G95
53else
54FFLAGS +=-DFORTRAN_GFORTRAN
25d9678b 55endif
7da87db6 56
19ca05d1 57# rmkdepend flags for building dependencies of FORTRAN files
58DEPENDFFLAGS = $(FFLAGS)
59
60# rootcint flags
61CINTFLAGS =
02a1d5c1 62
f3564e28 63LD = export MACOSX_DEPLOYMENT_TARGET=$(MACOSX_MAJOR).$(MACOSX_MINOR) ; \
02a1d5c1 64 unset LD_PREBIND ; \
65 g++
2bdfa405 66LDFLAGS = $(OPT) $(DICTLOAD)
02a1d5c1 67
68SHLD := $(LD)
2469b598 69SOFLAGS := -bundle -undefined dynamic_lookup
f3564e28 70SHLIB :=
02a1d5c1 71SOEXT := so
72
73DYLD := $(LD)
2469b598 74DYFLAGS = -dynamiclib -undefined dynamic_lookup -single_module
f3564e28 75DYLIB :=
02a1d5c1 76DYEXT := dylib
77
78ALLD = ar
79ALFLAGS = cr
80ALLIB =
81AEXT = a
82
02a1d5c1 83DEPENDCXXFLAGS = $(CXXFLAGS) -I/usr/include/sys
84
de6c7cfd 85SYSLIBS := -L/usr/X11R6/lib -lX11
02a1d5c1 86
de6c7cfd 87EXEFLAGS := -bind_at_load
f3564e28 88
02a1d5c1 89#System libraries
796dbee6 90
d95a3ef8 91ifeq (g95,$(F77))
21cf279e 92SYSLIBS += -L$(shell g95 --print-search-dirs | sed -n -e 's/install: //p') -lf95
b0724f32 93DYLIB += -L$(shell g95 --print-search-dirs | sed -n -e 's/install: //p') -lf95
f3564e28 94else
626d87b0 95SYSLIBS += -ldl $(shell $(F77) -print-file-name=libgfortran.dylib)
96SYSLIBS += $(shell $(F77) -print-file-name=libgfortranbegin.a)
f3564e28 97endif