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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
|
# **********************************************************************
#
# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# **********************************************************************
#
# Select an installation base directory. The directory will be created
# if it does not exist.
#
prefix ?= /opt/Ice-$(VERSION)
#
# The default behavior of 'make install' is to install the Ice for .NET
# libraries in the 'bin' directory. If you would prefer to
# install these libraries in the GAC, set GACINSTALL to yes.
#
#GACINSTALL = yes
#
# Ice invokes unmanaged code to implement the following features:
#
# - Protocol compression
# - Signal processing in the Ice.Application class (Windows only)
#
# Enable MANAGED below if you do not require these features and prefer that
# the Ice run time use only managed code.
#
#MANAGED = yes
#
# Enable the UNITY flag to build for the Unity3D Web player. Enabling this
# setting also implies MANAGED. In addition to the features removed by
# MANAGED, this flag removes the following:
#
# - File I/O: property loading, file logger (Ice.LogFile), I/O redirection
# (Ice.StdOut, Ice.StdErr)
# - ICE_CONFIG environment variable
#
#UNITY = yes
#
# Define DEBUG as yes if you want to build with debug information and
# assertions enabled.
#
DEBUG = yes
#
# Define OPTIMIZE as yes if you want to build with optmization.
#
#OPTIMIZE = yes
#
# Set the key file used to sign assemblies.
#
KEYFILE ?= $(top_srcdir)/../config/IceDevKey.snk
# ----------------------------------------------------------------------
# Don't change anything below this line!
# ----------------------------------------------------------------------
#
# Common definitions
#
ice_language = csharp
slice_translator = slice2cs
ifeq ($(shell test -f $(top_srcdir)/config/Make.common.rules && echo 0),0)
include $(top_srcdir)/config/Make.common.rules
else
include $(top_srcdir)/../config/Make.common.rules
endif
DSEP = /
bindir = $(top_srcdir)/bin
assembliesdir = $(top_srcdir)/Assemblies
install_bindir = $(prefix)/bin
ifeq ($(GACINSTALL),yes)
ifeq ($(GAC_ROOT),)
install_assembliesdir = $(prefix)/lib/mono/$(PKG)
else
install_assembliesdir = $(GAC_ROOT)/mono/$(PKG)
endif
else
install_assembliesdir = $(prefix)/Assemblies
endif
install_libdir = $(prefix)/lib
ifndef usr_dir_install
install_mandir := $(prefix)/man/man1
else
install_mandir := $(prefix)/share/man/man1
endif
install_pkgconfigdir = $(prefix)/lib/pkgconfig
ifeq ($(ice_dir), $(usr_dir))
ref = -pkg:$(1)
else
ifdef ice_src_dist
ref = -r:$(assembliesdir)/$(1).dll
else
ifeq ($(shell test -d $(ice_dir)/lib/pkgconfig && echo 0),0)
export PKG_CONFIG_PATH := $(ice_dir)/lib/pkgconfig:$(PKG_CONFIG_PATH)
ref = -pkg:$(1)
else
ref = -r:$(ice_dir)/Assemblies/$(1).dll
endif
endif
endif
GACUTIL = gacutil
# MDB files are generated only for debug builds. For debug, with a GAC
# install gacutil installs the .mdb into the GAC.
installmdb = /bin/true
ifeq ($(GACINSTALL),yes)
ifeq ($(DESTDIR)$(GAC_ROOT),)
installassembly = ([ -n "$(2)" ] && pkgopt="-package $(2)"; $(GACUTIL) -i $(1) -f $$pkgopt
installpolicy = $(GACUTIL) -i $(1).dll
else
ifeq ($(GAC_ROOT),)
GAC_ROOT = $(prefix)/lib
endif
installassembly = ([ -n "$(2)" ] && pkgopt="-package $(2)"; $(GACUTIL) -i $(1) -f $$pkgopt \
-root $(DESTDIR)$(GAC_ROOT))
installpolicy = $(GACUTIL) -i $(1).dll -f -root $(DESTDIR)$(GAC_ROOT)
endif
else
installassembly = $(INSTALL_LIBRARY) $(1) $(DESTDIR)$(install_assembliesdir); \
chmod a+rx $(DESTDIR)$(install_assembliesdir)/$(notdir $(1))
installpolicy = $(INSTALL_LIBRARY) $(1).dll $(install_assembliesdir); \
chmod a+rx $(install_assembliesdir)/$(notdir $(1).dll)
ifeq ($(DEBUG),yes)
installmdb = $(INSTALL_LIBRARY) $(1) $(DESTDIR)$(install_assembliesdir); \
chmod a+rx $(DESTDIR)$(install_assembliesdir)/$(notdir $(1))
endif
endif
#
# Do not generate policy files for beta (x.y.51) or minor (x.y.0) releases.
#
generate_policies = $(shell test $(VERSION_PATCH) -gt 0 -a $(VERSION_PATCH) -lt 51 && echo "yes")
ifneq ($(generate_policies),yes)
installpolicy = /bin/true
endif
MCS = gmcs
MCSFLAGS = -warnaserror
ifeq ($(DEBUG),yes)
MCSFLAGS := $(MCSFLAGS) -debug -define:DEBUG
endif
ifeq ($(OPTIMIZE),yes)
MCSFLAGS := $(MCSFLAGS) -optimize+
endif
ifeq ($(MANAGED),yes)
MCSFLAGS := $(MCSFLAGS) -define:MANAGED
endif
ifeq ($(UNITY),yes)
MCSFLAGS := $(MCSFLAGS) -define:UNITY
endif
ifdef ice_src_dist
SLICE2CS = $(ice_cpp_dir)/$(binsubdir)/slice2cs
SLICEPARSERLIB = $(ice_cpp_dir)/$(libsubdir)/$(call mklibfilename,Slice,$(VERSION))
else
SLICE2CS = $(ice_dir)/$(binsubdir)/slice2cs
SLICEPARSERLIB = $(ice_dir)/$(libsubdir)/$(call mklibfilename,Slice,$(VERSION))
endif
AL = al
POLICY = policy.$(SHORT_VERSION).$(PKG)
ifeq ($(generate_policies),yes)
ifneq ($(PUBLIC_KEY_TOKEN),)
publicKeyToken = $(PUBLIC_KEY_TOKEN)
else
ifneq ($(ice_src_dist),)
publicKeyToken = $(shell sn -q -p $(KEYFILE) tmp.pub; \
sn -q -t tmp.pub | sed 's/^.* //'; \
rm tmp.pub)
else
publicKeyToken = $(shell sn -q -T $(assembliesdir)/Ice.dll >tmp.pub; \
sed 's/^.* //' <tmp.pub; \
rm tmp.pub)
endif
endif
ifneq ($(POLICY_TARGET),)
$(assembliesdir)/$(POLICY_TARGET):
@echo -e " \
<configuration> \n \
<runtime> \n \
<assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\"> \n \
<dependentAssembly> \n \
<assemblyIdentity name=\"$(PKG)\" publicKeyToken=\"$(publicKeyToken)\" culture=\"\"/> \n \
<publisherPolicy apply=\"yes\"/> \n \
<bindingRedirect oldVersion=\"$(SHORT_VERSION).0.0 - $(SHORT_VERSION).1.0\" newVersion=\"$(VERSION).0\"/> \n \
</dependentAssembly> \n \
</assemblyBinding> \n \
</runtime> \n \
</configuration>" >$(POLICY)
$(AL) /link:$(POLICY) /version:0.0.0.0 /out:$(POLICY_TARGET) /keyfile:$(KEYFILE)
chmod a+r $(POLICY)
chmod a+rx $(POLICY_TARGET)
mv $(POLICY) $(POLICY_TARGET) $(assembliesdir)
clean::
-rm -f $(assembliesdir)/$(POLICY) $(assembliesdir)/$(POLICY_TARGET)
endif
endif
GEN_SRCS = $(subst .ice,.cs,$(addprefix $(GDIR)/,$(notdir $(SLICE_SRCS))))
CGEN_SRCS = $(subst .ice,.cs,$(addprefix $(GDIR)/,$(notdir $(SLICE_C_SRCS))))
SGEN_SRCS = $(subst .ice,.cs,$(addprefix $(GDIR)/,$(notdir $(SLICE_S_SRCS))))
GEN_AMD_SRCS = $(subst .ice,.cs,$(addprefix $(GDIR)/,$(notdir $(SLICE_AMD_SRCS))))
SAMD_GEN_SRCS = $(subst .ice,.cs,$(addprefix $(GDIR)/,$(notdir $(SLICE_SAMD_SRCS))))
EVERYTHING = all depend clean install
.SUFFIXES:
.SUFFIXES: .cs .ice
include $(wildcard .depend/*.d)
$(GDIR)/%.cs: $(SDIR)/%.ice
$(SLICE2CS) --output-dir $(GDIR) $(SLICE2CSFLAGS) $<
@mkdir -p .depend
@$(SLICE2CS) --output-dir $(GDIR) $(SLICE2CSFLAGS) --depend $< | sed 's/\(.*: \\\)/generated\/\1/' > .depend/$(*F).ice.d
all:: $(TARGETS)
ifeq ($(generate_policies),yes)
ifneq ($(POLICY_TARGET),)
all:: $(assembliesdir)/$(POLICY_TARGET)
endif
endif
ifneq ($(TARGETS_CONFIG),)
all:: $(TARGETS_CONFIG)
endif
clean::
-rm -f $(TARGETS) $(patsubst %,%.mdb,$(TARGETS)) *.bak *.dll *.pdb *.mdb
ifneq ($(SLICE_SRCS),)
clean::
-rm -f $(GEN_SRCS)
endif
ifneq ($(SLICE_C_SRCS),)
clean::
-rm -f $(CGEN_SRCS)
endif
ifneq ($(SLICE_S_SRCS),)
clean::
-rm -f $(SGEN_SRCS)
endif
ifneq ($(SLICE_AMD_SRCS),)
clean::
-rm -f $(GEN_AMD_SRCS)
endif
ifneq ($(SLICE_SAMD_SRCS),)
clean::
-rm -f $(SAMD_GEN_SRCS)
endif
ifneq ($(TARGETS_CONFIG),)
clean::
-rm -f $(TARGETS_CONFIG)
endif
install::
|