Make.rules.Darwin
4.03 KB
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
#
# Copyright (c) ZeroC, Inc. All rights reserved.
#
supported-platforms = macosx iphoneos iphonesimulator
macosx_ar = libtool
macosx_cppflags = -mmacosx-version-min=10.9 -arch x86_64
macosx_ldflags = $(macosx_cppflags)
macosx_targetdir = $(if $(filter %/build,$5),/macosx)
iphoneos_ar = libtool
iphoneos_cc = xcrun -sdk iphoneos clang
iphoneos_cxx = xcrun -sdk iphoneos clang++
iphoneos_cppflags = -miphoneos-version-min=7.1 -arch armv7 -arch arm64 -fembed-bitcode
iphoneos_ldflags = -miphoneos-version-min=7.1 -arch armv7 -arch arm64
iphoneos_configs = %xcodesdk
iphoneos_targetdir = $(if $(filter %/build,$5),/iphoneos)
iphonesimulator_ar = libtool
iphonesimulator_cc = xcrun -sdk iphonesimulator clang
iphonesimulator_cxx = xcrun -sdk iphonesimulator clang++
iphonesimulator_cppflags = -mios-simulator-version-min=7.1 -arch i386 -arch x86_64
iphonesimulator_ldflags = $(iphonesimulator_cppflags)
iphonesimulator_configs = %xcodesdk
iphonesimulator_targetdir = $(if $(filter %/build,$5),/iphonesimulator)
# If building objects for a shared library, enable fPIC
shared_cppflags = $(if $(filter-out program,$($1_target)),-fPIC) -fvisibility=hidden
cppflags = -Wall -Wextra -Wshadow -Wshadow-all -Wredundant-decls \
-Wdeprecated -Wstrict-prototypes -Werror -pthread \
$(if $(filter yes,$(OPTIMIZE)),-O2 -DNDEBUG,-g)
ifeq ($(MAXWARN),yes)
cppflags += -Wweak-vtables
endif
# -Wshadow issues false warnings with clang 3.x (Apple LLVM 9.0)
ifeq ($(shell clang -v 2>&1 | sed -ne 's/.*version \([0-9]*\)\.\([0-9]*\).*/\1\2/p'),90)
cppflags := $(filter-out -Wshadow -Wshadow-all,$(cppflags))
endif
nodeprecatedwarnings-cppflags := -Wno-deprecated-declarations
nounusedparameter-cppflags := -Wno-unused-parameter
loader_path = @loader_path
# $(call machoversion,$1=version)
machoversion = $(subst b,.6,$(subst a,.5,$1))
# $(call mklib,$1=target,$2=objects,$3=libname,$4=version,$5=soversion,$6=ldflags,$7=platform)
mklib = $(or $($7_ar),$(AR)) -static -no_warning_for_no_symbols -o $1 $2
# $(call mkshlib,$1=target,$2=objects,$3=libname,$4=version,$5=soversion,$6=ldflags,$7=platform)
mkshlib = $(or $($7_cxx),$(CXX)) -dynamiclib $(if $5,-install_name @rpath/$(call mkshlibfilename,$3,$4,$5))\
$(if $4,-current_version $(call machoversion,$4) -compatibility_version \
$(call machoversion,$(if $(filter $4,$(version)),$(compatversion),$4))) \
-o $1 $2 $6
# system install directory
system-install-dir = /usr/local
#
# $(call mkxxx,$1=libname,$2=version,$3=soversion)
#
mkshlibfilename = lib$1$(if $3,.$3).dylib
mkshlibname = lib$1.dylib
mkshlibnametarget = $(mkshlibfilename)
mkpymodulename = $1.so
mkrbmodulename = $1.bundle
mkphpmodulename = $1.so
escape-ldflags = $(subst -framework$(space),-framework+,$1)
unescape-ldflags = $(subst -framework+,-framework$(space),$1)
#
# System libraries
#
Ice_system_libs := -ldl
# Frameworks for macos
IceSSL[macosx]_system_libs := -framework Security -framework CoreFoundation
# Frameworks requires for iphoneos
Ice[iphoneos]_system_libs := -framework CFNetwork -framework UIKit -framework Foundation
IceSSL[iphoneos]_system_libs := -framework Security
IceIAP[iphoneos]_system_libs := -framework ExternalAccessory
# Same frameworks as iphoneos for iphonesimulator
Ice[iphonesimulator]_system_libs := $(Ice[iphoneos]_system_libs)
IceSSL[iphonesimulator]_system_libs := $(IceSSL[iphoneos]_system_libs)
IceIAP[iphonesimulator]_system_libs := $(IceIAP[iphoneos]_system_libs)
Glacier2CryptPermissionsVerifier[macosx]_system_libs := $(IceSSL[macosx]_system_libs)
Glacier2CryptPermissionsVerifier[iphoneos]_system_libs := $(IceSSL[iphoneos]_system_libs)
Glacier2CryptPermissionsVerifier[iphonesimulator]_system_libs := $(IceSSL[iphonesimulator]_system_libs)