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