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