Changes for Mac OSX
[u/mrichter/AliRoot.git] / build / Makefile.macosx
CommitLineData
b934f194 1# Makefile for AliRoot for MacOS X with gcc
2
f3564e28 3# OS version
4MACOSX_MAJOR := $(strip $(shell sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 1))
5MACOSX_MINOR := $(strip $(shell sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2))
6
7# fink directories
8FINK_ROOT := $(shell which fink | sed -e 's?/bin/fink??')
796dbee6 9ifeq (,$(FINK_ROOT))
10# No fink, build will probably fail, but we try a guess
11FINK_ROOT=/usr/local
12endif
f3564e28 13
02a1d5c1 14# The compilers
15CXX = g++
02a1d5c1 16CC = gcc
17
f3564e28 18ifeq (g95,$(findstring g95,$(ROOTBUILD)))
19F77 = g95
20else
21F77 = gfortran
22endif
f3564e28 23
02a1d5c1 24# Global optimisation
796dbee6 25OPT = -O -g
19ca05d1 26NOOPT = -g
02a1d5c1 27
19ca05d1 28CXXOPT = $(OPT)
29CXXNOOPT = $(NOOPT)
30COPT = $(OPT)
02a1d5c1 31FOPT = $(OPT) -fno-second-underscore
02a1d5c1 32
33# CERNLIB defines
796dbee6 34CLIBDEFS = -DCERNLIB_LINUX -DCERNLIB_BLDLIB -DCERNLIB_CZ -DCERNLIB_PPC
02a1d5c1 35CLIBCXXOPTS =
36CLIBCOPT =
19ca05d1 37CLIBFOPT = $(CLIBDEFS)
38
39# Compiler flags
6c111d79 40CXXFLAGS = $(CXXOPT) -Wall -W -Wno-long-double -pipe -fsigned-char -fno-common -fmessage-length=0 -I$(FINK_ROOT)/include
796dbee6 41
6c111d79 42ifeq (g95,$(findstring g95,$(ROOTBUILD)))
43CXXFLAGS+=-DFORTRAN_G95
44endif
45CXXFLAGSNO = $(CXXNOOPT) -Wall -W -pipe -fsigned-char -fno-common -fmessage-length=0 -I$(FINK_ROOT)/include -Wno-long-double
796dbee6 46
6c111d79 47CFLAGS = $(COPT) -Wall -W -fno-common -pipe -I$(FINK_ROOT)/include
796dbee6 48
19ca05d1 49FFLAGS = $(CLIBFOPT) $(FOPT)
50# rmkdepend flags for building dependencies of FORTRAN files
51DEPENDFFLAGS = $(FFLAGS)
52
53# rootcint flags
54CINTFLAGS =
02a1d5c1 55
f3564e28 56LD = export MACOSX_DEPLOYMENT_TARGET=$(MACOSX_MAJOR).$(MACOSX_MINOR) ; \
02a1d5c1 57 unset LD_PREBIND ; \
58 g++
2bdfa405 59LDFLAGS = $(OPT) $(DICTLOAD)
02a1d5c1 60
61SHLD := $(LD)
2469b598 62SOFLAGS := -bundle -undefined dynamic_lookup
f3564e28 63SHLIB :=
02a1d5c1 64SOEXT := so
65
66DYLD := $(LD)
2469b598 67DYFLAGS = -dynamiclib -undefined dynamic_lookup -single_module
f3564e28 68DYLIB :=
02a1d5c1 69DYEXT := dylib
70
71ALLD = ar
72ALFLAGS = cr
73ALLIB =
74AEXT = a
75
02a1d5c1 76DEPENDCXXFLAGS = $(CXXFLAGS) -I/usr/include/sys
77
78GLIBS = -L/usr/X11R6/lib -lX11
79
f3564e28 80EXEFLAGS += -bind_at_load
81
02a1d5c1 82#System libraries
796dbee6 83
f3564e28 84ifeq (g95,$(findstring g95,$(ROOTBUILD)))
85SYSLIBS := -L$(dir $(shell find $(FINK_ROOT) -name libf95.a)) -lf95
86else
87SYSLIBS := -ldl -L$(dir $(shell find $(FINK_ROOT) -name libgfortran.dylib)) -lgfortranbegin -lgfortran
88endif
02a1d5c1 89
02a1d5c1 90