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
|
# **********************************************************************
#
# 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 "root directory" for runpath embedded in executables. Can be set
# to change the runpath added to Ice executables. The default is
# platform dependent (Linux only, on OS X the embedded runpath is always
# based on @loader_path).
#
#embedded_runpath_prefix ?= /opt/Ice-$(VERSION_MAJOR).$(VERSION_MINOR)
#
# Define embedded_runpath as no if you don't want any RPATH added to
# the executables (Linux only, on OS X we always add a runpath).
#
embedded_runpath ?= yes
#
# Define OPTIMIZE as yes if you want to build with optimization.
# Otherwise the Ice extension is built with debug information.
#
#OPTIMIZE = yes
#
# Define LP64 as yes if you want to build in 64 bit mode on a platform
# that supports both 32 and 64 bit.
#
#LP64 := yes
#
# The values below can be overridden by defining them as environment
# variables.
#
#
# If multiple versions of Python are installed and you want a specific
# version used for building the Ice extension, then set PYTHON to
# the specific to the location of the python interpreter.
#
PYTHON ?= python
PYTHON_VERSION ?= python$(shell $(PYTHON) -c "import sys; import distutils.sysconfig as ds; sys.stdout.write(ds.get_python_version())")
PYTHON_BASE_VERSION ?= $(shell $(PYTHON) -c "import sys; import distutils.sysconfig as ds; sys.stdout.write(ds.get_python_version())")
PYTHON_INCLUDE_DIR ?= $(shell $(PYTHON) -c "import sys; import distutils.sysconfig as ds; sys.stdout.write(ds.get_python_inc())")
PYTHON_LIB_DIR ?= $(shell $(PYTHON) -c "import sys; import distutils.sysconfig as ds; sys.stdout.write(ds.get_config_var('LIBPL'))")
PYTHON_LIB_SUFFIX ?= $(shell $(PYTHON) -c "import sys; sys.stdout.write(sys.__dict__['abiflags'] if 'abiflags' in sys.__dict__ else '')")
PYTHON_LIB_NAME ?= $(PYTHON_VERSION)$(PYTHON_LIB_SUFFIX)
PYTHON_FLAGS ?= -I$(PYTHON_INCLUDE_DIR)
PYTHON_LIBS ?= -L$(PYTHON_LIB_DIR) -l$(PYTHON_LIB_NAME)
#
# The build architectures for gcc based builds. The format of these
# build flags are OS dependent. For example, under OS X to build
# binaries which support both i386 and x86_64 you would use "-arch
# i386 -arch x86_64". The default is OS version dependent. Be aware
# that this value may conflict with the setting of LP64 above.
#
#CXXARCHFLAGS = -arch i386 -arch x86_64
# ----------------------------------------------------------------------
# Don't change anything below this line!
# ----------------------------------------------------------------------
#
# Common definitions
#
ice_language = python
ice_require_cpp = yes
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
install_bindir = $(prefix)/$(binsubdir)
#
# Platform specific definitions
#
ifeq ($(shell test -f $(top_srcdir)/config/Make.rules.$(UNAME) && echo 0),0)
include $(top_srcdir)/config/Make.rules.$(UNAME)
else
include $(top_srcdir)/../cpp/config/Make.rules.$(UNAME)
endif
libdir = $(top_srcdir)/python
ifndef usr_dir_install
install_pythondir = $(prefix)/python
install_libdir = $(prefix)/python
else
#
# The install_dir script says where python wants site-packages installed.
#
install_pythondir = $(shell $(PYTHON) $(top_srcdir)/config/install_dir)
install_libdir = $(install_pythondir)
endif
ifeq ($(UNAME),SunOS)
ifeq ($(LP64),yes)
libdir = $(top_srcdir)/python$(lp64suffix)
install_libdir = $(prefix)/python$(lp64suffix)
endif
endif
ifdef ice_src_dist
ICE_LIB_DIR = -L$(ice_cpp_dir)/$(libsubdir)
ICE_FLAGS = -I$(ice_cpp_dir)/include
else
ICE_LIB_DIR = -L$(ice_dir)/$(libsubdir)
ICE_FLAGS = -I$(ice_dir)/include
endif
ICE_LIBS = $(ICE_LIB_DIR) -lIceSSL -lIce -lSlice -lIceUtil
CPPFLAGS =
ICECPPFLAGS = -I$(slicedir)
SLICE2PYFLAGS = $(ICECPPFLAGS)
LDFLAGS = $(LDPLATFORMFLAGS) $(CXXFLAGS) -L$(libdir)
ifdef ice_src_dist
SLICE2PY = $(PYTHON) $(top_srcdir)/config/s2py.py
SLICEPARSERLIB = $(ice_cpp_dir)/$(libsubdir)/$(call mklibfilename,Slice,$(VERSION))
ifeq ($(wildcard $(SLICEPARSERLIB)),)
SLICEPARSERLIB = $(ice_cpp_dir)/$(lib64subdir)/$(call mklibfilename,Slice,$(VERSION))
endif
else
ifeq ($(UNAME),Darwin)
SLICE2PY = /usr/local/bin/slice2py
else
SLICE2PY = $(shell $(PYTHON) -c "import os, sys, slice2py; sys.stdout.write(os.path.normpath(os.path.join(slice2py.__file__, '..', '..', '..', '..', 'bin', 'slice2py')))")
endif
SLICEPARSERLIB =
endif
#
# A Python extension library cannot have a "lib" prefix, so Python-specific
# functions are defined that strip "lib" from the regular library name.
#
mkpylibfilename = $(subst dy,dylib,$(subst lib,,$(call mklibfilename,$(1),$(2))))
mkpysoname = $(subst dy,dylib,$(subst lib,,$(call mksoname,$(1),$(2))))
mkpylibname = $(subst dy,dylib,$(subst lib,,$(call mklibname,$(1))))
EVERYTHING = all depend clean install
.SUFFIXES:
.SUFFIXES: .cpp .o .py
all:: $(SRCS)
%_ice.py: $(slicedir)/%.ice
rm -f $(*F).py
$(SLICE2PY) $(SLICE2PYFLAGS) $<
@mkdir -p .depend
@$(SLICE2PY) $(SLICE2PYFLAGS) $< > .depend/$(*F).ice.d
.cpp.o:
$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $<
@mkdir -p .depend
@$(CXX) -DMAKEDEPEND -MM $(CPPFLAGS) $< > .depend/$(*F).d
clean::
-rm -f $(TARGETS)
-rm -f core *.o *.pyc *.bak
-rm -rf __pycache__
-rm -rf .depend
all:: $(SRCS) $(TARGETS)
include $(wildcard .depend/*.d)
install::
|