Restored compilation on Windows/Cygwin
[u/mrichter/AliRoot.git] / build / Makefile.macosx64
CommitLineData
f36e7e21 1# Makefile for AliRoot for MacOS X with gcc
ee0345bd 2
3XARGS = xargs
4
5# OS version
6MACOSX_MAJOR := $(strip $(shell sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 1))
7MACOSX_MINOR := $(strip $(shell sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2))
8
9# fink directories
10FINK_ROOT := $(shell which fink | sed -e 's?/bin/fink??')
11ifeq (,$(FINK_ROOT))
12# No fink, build will probably fail, but we try a guess
13FINK_ROOT=/usr/local
14endif
15
16# The compilers
17CXX = g++
18CC = gcc
19
20ifeq (g95,$(findstring g95,$(ROOTBUILD)))
21F77 = g95
22else
23F77 = gfortran
24endif
25
26# Global optimisation
27OPT = -O -g
28NOOPT = -O0 -g
29
30CXXOPT = $(OPT)
31CXXNOOPT = $(NOOPT)
32COPT = $(OPT)
f36e7e21 33FOPT = $(OPT) -fno-second-underscore -m64
ee0345bd 34ifeq (g95,$(findstring g95,$(ROOTBUILD)))
35FOPT += -fbounds-check
36endif
37
38# CERNLIB defines
cb47c659 39CLIBDEFS = -DCERNLIB_LXIA64 -DCERNLIB_BLDLIB -DCERNLIB_CZ -DCERNLIB_PPC
ee0345bd 40CLIBCXXOPTS =
41CLIBCOPT =
42CLIBFOPT = $(CLIBDEFS)
43
1bbe2977 44CXXSTF = -m64 -pipe -Wall -W -Wno-long-double -pipe -fbounds-check -fsigned-char -fno-common -fmessage-length=0 -Woverloaded-virtual -Weffc++ -Wconversion -fno-default-inline -fno-inline -I/usr/X11R6/include -I$(FINK_ROOT)/include
ee0345bd 45
46# Compiler flags
1bbe2977 47CXXFLAGS = $(CXXOPT) $(CXXSTF)
ee0345bd 48
ee0345bd 49CXXFLAGSNO = $(CXXNOOPT) $(CXXSTF)
50
51CFLAGS = $(COPT) -m64 -Wall -W -fno-common -pipe -I$(FINK_ROOT)/include
52
f36e7e21 53FFLAGS = $(CLIBFOPT) $(FOPT)
ee0345bd 54ifeq (g95,$(findstring g95,$(ROOTBUILD)))
55FFLAGS += -ftrace=full
7da87db6 56FFLAGS +=-DFORTRAN_G95
57else
58FFLAGS +=-DFORTRAN_GFORTRAN
ee0345bd 59endif
7da87db6 60
ee0345bd 61# rmkdepend flags for building dependencies of FORTRAN files
62DEPENDFFLAGS = $(FFLAGS)
63
64# rootcint flags
65CINTFLAGS =
66
67LD = export MACOSX_DEPLOYMENT_TARGET=$(MACOSX_MAJOR).$(MACOSX_MINOR) ; \
68 unset LD_PREBIND ; \
69 g++
f36e7e21 70LDFLAGS = $(OPT) -m64 $(DICTLOAD)
ee0345bd 71
72SHLD := $(LD)
73SOFLAGS := -m64 -bundle -undefined dynamic_lookup
74SHLIB :=
75SOEXT := so
76
77DYLD := $(LD)
78DYFLAGS = -m64 -dynamiclib -undefined dynamic_lookup -single_module
79DYLIB :=
80DYEXT := dylib
81
82ALLD = ar
83ALFLAGS = cr
84ALLIB =
85AEXT = a
86
87DEPENDCXXFLAGS = $(CXXFLAGS) -I/usr/include/sys
88
89SYSLIBS := -L/usr/X11R6/lib -lX11
90
91EXEFLAGS := -bind_at_load
92
93#System libraries
94
95ifeq (g95,$(findstring g95,$(ROOTBUILD)))
96SYSLIBS += -L$(shell g95 --print-search-dirs | sed -n -e 's/install: //p') -lf95
97else
1bbe2977 98SYSLIBS += -ldl $(shell $(F77) -m64 -print-file-name=libgfortran.dylib)
99SYSLIBS += $(shell $(F77) -m64 -print-file-name=libgfortranbegin.a)
ee0345bd 100endif