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