1 # **********************************************************************
3 # Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
5 # This copy of Ice is licensed to you under the terms described in the
6 # ICE_LICENSE file included in this distribution.
8 # **********************************************************************
11 # Select an installation base directory. The directory will be created
12 # if it does not exist.
15 prefix
?= /opt
/Ice
-$(VERSION
)
18 # The default behavior of 'make install' is to install the Ice for .NET
19 # libraries in the 'bin' directory. If you would prefer to
20 # install these libraries in the GAC, set GACINSTALL to yes.
26 # Ice invokes unmanaged code to implement the following features:
28 # - Protocol compression
29 # - Signal processing in the Ice.Application class (Windows only)
31 # Enable MANAGED below if you do not require these features and prefer that
32 # the Ice run time use only managed code.
38 # Define DEBUG as yes if you want to build with debug information and
45 # Define OPTIMIZE as yes if you want to build with optmization.
51 # Set the key file used to sign assemblies.
54 KEYFILE
?= $(top_srcdir
)/../config
/IceDevKey
.snk
56 # ----------------------------------------------------------------------
57 # Don't change anything below this line!
58 # ----------------------------------------------------------------------
64 slice_translator = slice2cs
66 ifeq ($(shell test -f $(top_srcdir)/config/Make.common.rules && echo 0),0)
67 include $(top_srcdir)/config/Make.common.rules
69 include $(top_srcdir)/../config/Make.common.rules
74 bindir = $(top_srcdir)/bin
76 install_bindir = $(prefix)/bin
78 install_libdir = $(prefix)/lib
80 install_pkgconfigdir = $(prefix)/lib/pkgconfig
82 ifeq ($(ice_dir),/usr)
86 ref = -r:$(bindir)/$(1).dll
88 ifeq ($(shell test -d $(ice_dir)/lib/pkgconfig && echo 0),0)
89 export PKG_CONFIG_PATH := $(ice_dir)/lib/pkgconfig:$(PKG_CONFIG_PATH)
92 ref = -r:$(ice_dir)/bin/$(1).dll
99 # MDB files are generated only for debug builds. For debug, with a GAC
100 # install gacutil installs the .mdb into the GAC.
101 installmdb = /bin/true
103 ifeq ($(GACINSTALL),yes)
105 installassembly = ([ -n "$(2)" ] && pkgopt="-package $(2)"; $(GACUTIL) -i $(1) -f $$pkgopt)
106 installpolicy = $(GACUTIL) -i $(1).dll -f
108 installassembly = ([ -n "$(2)" ] && pkgopt="-package $(2)"; $(GACUTIL) -i $(1) -f $$pkgopt -root $(GAC_ROOT))
109 installpolicy = $(GACUTIL) -i $(1).dll -f -root $(GAC_ROOT)
112 installassembly = $(INSTALL_LIBRARY) $(1) $(install_bindir); \
113 chmod a+rx $(install_bindir)/$(notdir $(1))
114 installpolicy = $(INSTALL_LIBRARY) $(1).dll $(install_bindir); \
115 $(INSTALL_LIBRARY) $(1) $(install_bindir); \
116 chmod a+rx $(install_bindir)/$(notdir $(1).dll); \
117 chmod a+r $(install_bindir)/$(notdir $(1))
119 installmdb = $(INSTALL_LIBRARY) $(1) $(install_bindir); \
120 chmod a+rx $(install_bindir)/$(notdir $(1))
125 # Do not generate policy files for beta (x.y.51) or minor (x.y.0) releases.
127 generate_policies = $(shell test $(VERSION_PATCH) -gt 0 -a $(VERSION_PATCH) -lt 51 && echo "yes")
129 ifneq ($(generate_policies),yes)
130 installpolicy = /bin/true
135 MCSFLAGS = -warnaserror -d:MAKEFILE_BUILD
137 MCSFLAGS := $(MCSFLAGS) -debug -define:DEBUG
140 ifeq ($(OPTIMIZE),yes)
141 MCSFLAGS := $(MCSFLAGS) -optimize+
145 ifeq ($(ice_cpp_dir), $(ice_dir)/cpp)
146 SLICE2CS = $(ice_cpp_dir)/bin/slice2cs
147 SLICEPARSERLIB = $(ice_cpp_dir)/lib/$(call mklibfilename,Slice,$(VERSION))
149 SLICE2CS = $(ice_cpp_dir)/$(binsubdir)/slice2cs
150 SLICEPARSERLIB = $(ice_cpp_dir)/$(libsubdir)/$(call mklibfilename,Slice,$(VERSION))
153 SLICE2CS = $(ice_dir)/$(binsubdir)/slice2cs
154 SLICEPARSERLIB = $(ice_dir)/$(libsubdir)/$(call mklibfilename,Slice,$(VERSION))
158 POLICY = policy.$(SHORT_VERSION).$(PKG)
160 ifeq ($(generate_policies),yes)
162 ifneq ($(PUBLIC_KEY_TOKEN),)
163 publicKeyToken = $(PUBLIC_KEY_TOKEN)
165 ifneq ($(ice_src_dist),)
166 publicKeyToken = $(shell sn -q -p $(KEYFILE) tmp.pub; \
167 sn -q -t tmp.pub | sed 's/^.* //'; \
170 publicKeyToken
= $(shell sn
-q
-T
$(bindir
)/Ice
.dll
>tmp
.pub
; \
171 sed
's/^.* //' <tmp
.pub
; \
176 ifneq ($(POLICY_TARGET
),)
178 $(bindir
)/$(POLICY_TARGET
):
182 <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\"> \n \
183 <dependentAssembly> \n \
184 <assemblyIdentity name=\"$(PKG)\" publicKeyToken=\"$(publicKeyToken)\" culture=\"\"/> \n \
185 <publisherPolicy apply=\"yes\"/> \n \
186 <bindingRedirect oldVersion=\"$(SHORT_VERSION).0.0 - $(SHORT_VERSION).1.0\" newVersion=\"$(VERSION).0\"/> \n \
187 </dependentAssembly> \n \
188 </assemblyBinding> \n \
190 </configuration>" >$(POLICY
)
191 $(AL
) /link
:$(POLICY
) /version
:0.0.0.0 /out:$(POLICY_TARGET
) /keyfile
:$(KEYFILE
)
193 chmod a
+rx
$(POLICY_TARGET
)
194 mv
$(POLICY
) $(POLICY_TARGET
) $(bindir
)
197 -rm
-f
$(bindir
)/$(POLICY
) $(bindir
)/$(POLICY_TARGET
)
203 GEN_SRCS
= $(subst
.ice
,.cs
,$(addprefix
$(GDIR
)/,$(notdir
$(SLICE_SRCS
))))
204 CGEN_SRCS
= $(subst
.ice
,.cs
,$(addprefix
$(GDIR
)/,$(notdir
$(SLICE_C_SRCS
))))
205 SGEN_SRCS
= $(subst
.ice
,.cs
,$(addprefix
$(GDIR
)/,$(notdir
$(SLICE_S_SRCS
))))
206 GEN_AMD_SRCS
= $(subst
.ice
,.cs
,$(addprefix
$(GDIR
)/,$(notdir
$(SLICE_AMD_SRCS
))))
207 SAMD_GEN_SRCS
= $(subst
.ice
,.cs
,$(addprefix
$(GDIR
)/,$(notdir
$(SLICE_SAMD_SRCS
))))
210 EVERYTHING
= all depend clean install
216 $(SLICE2CS
) $(SLICE2CSFLAGS
) $<
218 $(GDIR
)/%.cs
: $(SDIR
)/%.ice
219 $(SLICE2CS
) --output
-dir
$(GDIR
) $(SLICE2CSFLAGS
) $<
223 ifeq ($(generate_policies
),yes
)
224 ifneq ($(POLICY_TARGET
),)
225 all:: $(bindir
)/$(POLICY_TARGET
)
229 ifneq ($(TARGETS_CONFIG
),)
230 all:: $(TARGETS_CONFIG
)
233 depend:: $(SLICE_SRCS
) $(SLICE_C_SRCS
) $(SLICE_S_SRCS
) $(SLICE_AMD_SRCS
) $(SLICE_SAMD_SRCS
)
234 -rm
-f
.depend
.depend
.mak
235 if test
-n
"$(SLICE_SRCS)" ; then \
236 $(SLICE2CS
) --depend
$(SLICE2CSFLAGS
) $(SLICE_SRCS
) | $(ice_dir
)/config
/makedepend
.py
; \
238 if test
-n
"$(SLICE_C_SRCS)" ; then \
239 $(SLICE2CS
) --depend
$(SLICE2CSFLAGS
) $(SLICE_C_SRCS
) | $(ice_dir
)/config
/makedepend
.py
; \
241 if test
-n
"$(SLICE_S_SRCS)" ; then \
242 $(SLICE2CS
) --depend
$(SLICE2CSFLAGS
) $(SLICE_S_SRCS
) | $(ice_dir
)/config
/makedepend
.py
; \
244 if test
-n
"$(SLICE_AMD_SRCS)" ; then \
245 $(SLICE2CS
) --depend
$(SLICE2CSFLAGS
) $(SLICE_AMD_SRCS
) | $(ice_dir
)/config
/makedepend
.py
; \
247 if test
-n
"$(SLICE_SAMD_SRCS)" ; then \
248 $(SLICE2CS
) --depend
$(SLICE2CSFLAGS
) $(SLICE_SAMD_SRCS
) | $(ice_dir
)/config
/makedepend
.py
; \
252 -rm
-f
$(TARGETS
) $(patsubst
%,%.mdb
,$(TARGETS
)) *.bak
*.dll
*.pdb
*.mdb
254 ifneq ($(SLICE_SRCS
),)
258 ifneq ($(SLICE_C_SRCS
),)
262 ifneq ($(SLICE_S_SRCS
),)
266 ifneq ($(SLICE_AMD_SRCS
),)
268 -rm
-f
$(GEN_AMD_SRCS
)
270 ifneq ($(SLICE_SAMD_SRCS
),)
272 -rm
-f
$(SAMD_GEN_SRCS
)
275 ifneq ($(TARGETS_CONFIG
),)
277 -rm
-f
$(TARGETS_CONFIG
)