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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
|
#
# Copyright (c) ZeroC, Inc. All rights reserved.
#
# ----------------------------------------------------------------------
# Don't change anything below this line!
# ----------------------------------------------------------------------
#
# Supported configurations
#
supported-configs = shared static cpp11-shared cpp11-static
-include $(lang_srcdir)/config/Make.rules.$(os)
ifeq ($(os),Darwin)
include $(lang_srcdir)/config/Make.xcodesdk.rules
endif
# Validate platforms and configs
$(eval $(call validate-config))
#
# Define which projects to build for the different configurations.
#
coreandstub_components = IceUtil \
Ice \
IceSSL \
IceDiscovery \
IceLocatorDiscovery \
Glacier2 \
IceStorm \
IceGrid \
IceBox \
IcePatch2
# Add the Bluetooth transport if Bluetooth system libraries are available
ifneq ($(IceBT_system_libs),)
coreandstub_components += IceBT
endif
#
# Build all the projects with the shared configuration, except IceUtil and Slice
# that are static-only
#
shared_projects = %
shared_excludes = IceUtil Slice
#
# Build only few components with the static configuration (core and stubs)
#
static_components = $(coreandstub_components)
static_projects = test/Common \
test/Ice/% \
test/IceSSL/% \
test/IceDiscovery/simple \
test/Glacier2/application \
test/IceGrid/simple
static_excludes = test/Ice/library test/Ice/plugin
#
# Components and projects which are built with C++11
#
cpp11_components = $(coreandstub_components) icebox
cpp11_projects = test/Common \
test/IceUtil/% \
test/Slice/% \
test/Ice/% \
test/IceSSL/% \
test/IceDiscovery/% \
test/IceBox/% \
test/Glacier2/application \
test/Glacier2/sessionHelper \
test/IceGrid/simple
cpp11_excludes = IcePatch2 \
test/Ice/gc
#
# If building on a Linux multilib platform, we restrict what we build for
# the 32-bits architecture. We basically, build the same set of components
# as C++11 (libraries and icebox executable).
#
ifeq ($(multilib-platform),yes)
x86_components = $(coreandstub_components) IceDB IceStormService icebox
x86_projects = test/%
endif
#
# C++11 configuration to build the C++11 mapping.
#
# Appends cpp11 to the configuration directory name. If we are building the
# target outside the component build directory, we also append the ++11
# suffix to the targetname. This is for example how icebox is compiled as
# icebox++11 when compiled with the C++11 configuration. We also don't add
# the cpp11 name to the target directory if building outside the build
# directory.
#
cpp11_cppflags = -DICE_CPP11_MAPPING
ifneq ($(shell $(CC) -E config/cplusplus_check.cpp 1> /dev/null 2>&1; echo $$?),0)
ifeq ($(os),Darwin)
# With Xcode 14.3 C++17 deprecations apply when building with -std=c++11, we pass -std=c++17
# to enable C++17 mode conditional code.
cpp11_cppflags := $(cpp11_cppflags) -std=c++17
else
cpp11_cppflags := $(cpp11_cppflags) -std=c++11
endif
endif
cpp11_ldflags = $(cpp11_cppflags)
cpp11_targetname = $(if $(or $(filter-out $($1_target),program),$(filter $(bindir)%,$($4_targetdir))),++11)
cpp11_targetdir = $(if $(filter %/build,$5),cpp11)
#
# $(call make-cpp-src-project,$1=project)
#
define make-cpp-src-project
ifeq ($(filter all cpp,$(ICE_BIN_DIST)),)
$1_slicecompiler := slice2cpp
$1_sliceflags += -I$(slicedir)
$1_cppflags += -Isrc -I$1/generated -I$(includedir) -I$(includedir)/generated -DICE_BUILDING_SRC
$(make-project)
srcs:: $1
endif
endef
#
# $(call make-cpp-test-project,$1=project)
#
define make-cpp-test-project
$1_slicecompiler := slice2cpp
$1_sliceflags += -I$(slicedir)
$1_cppflags += -I$1/generated -I$1 -Itest/include $(ice_cpp_cppflags)
$(make-project)
tests:: $1
endef
#
# $(create-cpp-test-project $1=test)
#
define create-cpp-test-project
$1_srcext := cpp
$1_dependencies := $$(or $$($1_dependencies),TestCommon Ice)
# Also link with IceSSL and IceBT (Debian/Ubuntu/Yocto) when compiling the project with the static configuration
$1[static]_cppflags += $(if $(IceBT_system_libs),-DICE_HAS_BT)
$1[static]_dependencies := IceSSL $(if $(IceBT_system_libs),IceBT)
# Dependencies and target dirs for Xcode SDK test projects
$1[xcodesdk]_dependencies := IceSSL
$1[iphoneos-xcodesdk]_targetdir := test/ios/bundles/Bundles-iphoneos/$(subst /,_,$1)
$1[iphonesimulator-xcodesdk]_targetdir := test/ios/bundles/Bundles-iphonesimulator/$(subst /,_,$1)
$1[iphoneos-cpp11-xcodesdk]_targetdir := test/ios/bundles/Bundles++11-iphoneos/$(subst /,_,$1)
$1[iphonesimulator-cpp11-xcodesdk]_targetdir := test/ios/bundles/Bundles++11-iphonesimulator/$(subst /,_,$1)
$(create-test-project)
endef
#
# Create top-level include/config dir
#
$(DESTDIR)$(install_includedir) $(DESTDIR)$(install_configdir):
$(Q)$(MKDIR) $@
|