forked from root-project/root
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.macosx
147 lines (130 loc) · 3.95 KB
/
Makefile.macosx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# -*- mode: makefile -*-
#
# Makefile of ROOT for MacOS X, using g++ 32-bit mode
PLATFORM = macosx
DEBUGFLAGS = -g
OPTFLAGS = -O2 -DNDEBUG
ifeq (debug,$(findstring debug,$(ROOTBUILD)))
OPT = $(DEBUGFLAGS)
NOOPT =
else
OPT = $(OPTFLAGS)
NOOPT =
endif
# MacOS X version
MACOSX_MINOR := $(shell sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2)
MACOSX_CPU := $(shell uname -p)
FINK_DIR := $(shell which fink 2>&1 | sed -ne "s/\/bin\/fink//p")
CXX = clang++
CC = clang
ifeq ($(CXX14),yes)
CXX11FLAGS = -std=c++1y
else
CXX11FLAGS = -std=c++11
endif
CXXFLAGS = -m32 $(CXX11FLAGS) -pipe -Wshadow -W -Wall -Woverloaded-virtual \
-fsigned-char -fno-common $(EXTRA_CXXFLAGS) $(FINK_CXXFLAGS) \
$(TARGETFLAGS) $(USERCONF_CXXFLAGS)
CFLAGS = -m32 -pipe -Wshadow -W -Wall -fsigned-char -fno-common \
$(EXTRA_CFLAGS) $(FINK_CFLAGS) $(TARGETFLAGS) $(USERCONF_CFLAGS)
CLINGCXXFLAGS = -m32
COMPILER = gnu
# Linker:
LD = clang++
LDFLAGS = $(OPT) -m32 -mmacosx-version-min=$(MACOSXVERS)
FORCELINK = yes
NEEDFINK = yes
ifeq ($(subst $(MACOSX_MINOR),,1234),1234)
# this is set for 64 but not for 32 bit
CXXFLAGS += -D__DARWIN_UNIX03=1
CFLAGS += -D__DARWIN_UNIX03=1
endif
ifeq ($(subst $(MACOSX_MINOR),,1234),1234)
ifeq ($(USECONFIG),FALSE)
SOFLAGS = -dynamiclib -single_module -Wl,-dead_strip_dylibs \
-install_name @rpath/
else
SOFLAGS = -dynamiclib -single_module -Wl,-dead_strip_dylibs \
-install_name $(LIBDIR)/
endif
FORCELINK = no
NEEDFINK = no
else
ifeq ($(subst $(MACOSX_MINOR),,123),123)
SOFLAGS = -dynamiclib -single_module \
-undefined dynamic_lookup -install_name $(LIBDIR)/
FORCELINK = no
NEEDFINK = no
else
ifeq ($(MACOSX_MINOR),3)
SOFLAGS = -dynamiclib -single_module \
-undefined dynamic_lookup -install_name $(LIBDIR)/
LDFLAGS += -bind_at_load
CXXFLAGS += -Wno-long-double
CFLAGS += -Wno-long-double
else
SOFLAGS = -dynamiclib -single_module \
-undefined suppress -install_name $(LIBDIR)/
LDFLAGS += -bind_at_load
CXXFLAGS += -Wno-long-double
CFLAGS += -Wno-long-double
endif
endif
endif
ifeq ($(subst $(MACOSX_MINOR),,1234),1234)
SOEXT = so
else
SOEXT = dylib
endif
# System libraries:
SYSLIBS = -lm $(EXTRA_LDFLAGS) $(FINK_LDFLAGS) $(OSTHREADLIBDIR) \
$(OSTHREADLIB) -ldl $(ALLOCLIBDIR) $(ALLOCLIB)
XLIBS = $(XPMLIBDIR) $(XPMLIB) $(X11LIBDIR) -lXext -lX11
CILIBS = -lm $(EXTRA_LDFLAGS) $(FINK_LDFLAGS) -ldl
# Fortran:
F77ORG = gfortran
F77FLAGS = -m32 -std=legacy
ifneq ($(F77),)
F77LIBS := $(shell $(F77) -m32 -print-file-name=libgfortran.dylib 2>&1 | grep /)
F77LIBS += $(shell $(F77) -m32 -print-file-name=libgfortran.a 2>&1 | grep /)
F77LIBS += $(shell $(F77) -m32 -print-file-name=libgfortranbegin.a 2>&1 | grep /)
endif
# Override default in Makefile.config
INSTALL := /bin/cp -pPR
INSTALLDATA := /bin/cp -pPR
# Extras
ifeq ($(NEEDFINK),yes)
FINK_CXXFLAGS := $(shell [ -d $(FINK_DIR)/include ] && echo -I$(FINK_DIR)/include)
FINK_CFLAGS := $(shell [ -d $(FINK_DIR)/include ] && echo -I$(FINK_DIR)/include)
FINK_LDFLAGS := $(shell [ -d $(FINK_DIR)/lib ] && echo -L$(FINK_DIR)/lib)
endif
ifeq ($(MACOSX_MINOR),7)
MACOSX_SSL_DEPRECATED = yes
endif
ifeq ($(MACOSX_MINOR),8)
MACOSX_SSL_DEPRECATED = yes
MACOSX_ODBC_DEPRECATED = yes
endif
ifeq ($(MACOSX_MINOR),9)
MACOSX_SSL_DEPRECATED = yes
MACOSX_ODBC_DEPRECATED = yes
MACOSX_GLU_DEPRECATED = yes
MACOSX_KRB5_DEPRECATED = yes
endif
ifeq ($(MACOSX_MINOR),10)
MACOSX_SSL_DEPRECATED = yes
MACOSX_ODBC_DEPRECATED = yes
MACOSX_GLU_DEPRECATED = yes
MACOSX_KRB5_DEPRECATED = yes
MACOSX_LDAP_DEPRECATED = yes
endif
ifeq ($(CONFIGURE),yes)
showcxx:
@echo "$(CXX)"
showcc:
@echo "$(CC)"
showld:
@echo "$(LD)"
showf77:
@echo "$(F77ORG)"
endif