1 # -*- mode: makefile -*-
2 # Makefile for AliRoot for MacOS X with gcc
7 MACOSX_MAJOR := $(strip $(shell sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 1))
8 MACOSX_MINOR := $(strip $(shell sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2))
11 FINK_ROOT := $(shell which fink | sed -e 's?/bin/fink??')
13 # No fink, build will probably fail, but we try a guess
18 CXX = $(shell root-config --cxx)
19 CC = $(shell root-config --cc)
20 F77 = $(shell root-config --f77)
29 FOPT = $(OPT) -fno-second-underscore -m64
30 ifneq (,$(findstring g95,$(F77)))
31 FOPT += -fbounds-check
35 CLIBDEFS = -DCERNLIB_LXIA64 -DCERNLIB_BLDLIB -DCERNLIB_CZ -DCERNLIB_PPC
38 CLIBFOPT = $(CLIBDEFS)
39 CXXSTF = -m64 -pipe -Wall -W -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
41 CXXSTF = -m64 -pipe -Wall -W -pipe -fbounds-check -fsigned-char -fno-common -fmessage-length=0 -Woverloaded-virtual -Weffc++ -Wshadow -fno-default-inline -fno-inline -I/usr/X11R6/include -I$(FINK_ROOT)/include
44 CXXFLAGS = $(CXXOPT) $(CXXSTF)
46 CXXFLAGSNO = $(CXXNOOPT) $(CXXSTF)
48 CFLAGS = $(COPT) -m64 -Wall -W -fno-common -pipe -I$(FINK_ROOT)/include
50 FFLAGS = $(CLIBFOPT) $(FOPT)
51 ifneq (,$(findstring g95,$(F77)))
52 FFLAGS += -ftrace=full
53 FFLAGS +=-DFORTRAN_G95
55 FFLAGS +=-DFORTRAN_GFORTRAN
58 # rmkdepend flags for building dependencies of FORTRAN files
59 DEPENDFFLAGS = $(FFLAGS)
64 LD = export MACOSX_DEPLOYMENT_TARGET=$(MACOSX_MAJOR).$(MACOSX_MINOR) ; \
66 $(shell root-config --ld)
67 LDFLAGS = $(OPT) -m64 $(DICTLOAD)
70 SOFLAGS := -m64 -bundle -undefined dynamic_lookup
75 DYFLAGS = -m64 -dynamiclib -undefined dynamic_lookup -single_module
84 DEPENDCXXFLAGS = $(CXXFLAGS) -I/usr/include/sys
86 SYSLIBS := -L/usr/X11R6/lib -lX11
88 EXEFLAGS := -bind_at_load
92 ifneq (,$(findstring g95,$(F77)))
93 SYSLIBS += -L$(shell $(F77) --print-search-dirs | sed -n -e 's/install: //p') -lf95
95 SYSLIBS += -ldl $(shell $(F77) -m64 -print-file-name=libgfortran.dylib)
96 SYSLIBS += $(shell $(F77) -m64 -print-file-name=libgfortranbegin.a)