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
|
# **********************************************************************
#
# Copyright (c) 2003-2015 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.
#
#
# Determines whether the extension uses PHP namespaces (requires
# PHP 5.3 or later).
#
#USE_NAMESPACES ?= yes
# ----------------------------------------------------------------------
# Don't change anything below this line!
# ----------------------------------------------------------------------
#
# Common definitions
#
ice_language = php
ice_require_cpp = yes
slice_translator = slice2php
ifeq ($(shell php-config --libs /dev/null && echo 0),0)
$(error php-config not found review your PHP installation and ensure php-config is in your PATH)
endif
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
libdir = $(top_srcdir)/lib
ifndef usr_dir_install
install_phpdir = $(prefix)/php
install_libdir = $(prefix)/php
else
install_phpdir = $(prefix)/share/php
install_libdir = $(shell php -r "echo(ini_get('extension_dir'));")
endif
ifdef ice_src_dist
RPATH_DIR = $(LOADER_PATH)/../../cpp/$(libsubdir)
else
RPATH_DIR = $(ice_dir)/$(libdir)
endif
install_bindir = $(prefix)/$(binsubdir)
#
# Platform specific definitions
#
ifeq ($(shell test -f $(top_srcdir)/config/Make.rules.$(UNAME) && echo 0),0)
configdir = $(top_srcdir)/config
else
configdir = $(top_srcdir)/../cpp/config
endif
include $(configdir)/Make.rules.$(UNAME)
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)/lib$(lp64suffix)
ICE_FLAGS = -I$(ice_dir)/include
endif
ICE_LIBS = $(ICE_LIB_DIR) -lIce -lIceSSL -lIceDiscovery -lIceLocatorDiscovery -lSlice -lIceUtil
ifneq ($(embedded_runpath_prefix),)
runpath_libdir := $(embedded_runpath_prefix)/lib$(lp64suffix)
endif
CPPFLAGS =
ICECPPFLAGS = -I$(slicedir)
SLICE2PHPFLAGS := $(SLICE2PHPFLAGS) $(ICECPPFLAGS)
LDFLAGS = $(LDPLATFORMFLAGS) $(CXXFLAGS) -L$(libdir)
ifeq ("$(USE_NAMESPACES)","yes")
CPPFLAGS := $(CPPFLAGS) -DICEPHP_USE_NAMESPACES
SLICE2PHPFLAGS := $(SLICE2PHPFLAGS) -n
endif
ifdef ice_src_dist
SLICE2PHP = $(ice_cpp_dir)/$(binsubdir)/slice2php
SLICEPARSERLIB = $(ice_cpp_dir)/$(libsubdir)/$(call mklibfilename,Slice,$(VERSION))
ifeq ($(wildcard $(SLICEPARSERLIB)),)
SLICEPARSERLIB = $(ice_cpp_dir)/$(lib64subdir)/$(call mklibfilename,Slice,$(VERSION))
endif
else
SLICE2PHP = $(ice_dir)/$(binsubdir)/slice2php
SLICEPARSERLIB = $(ice_dir)/$(libsubdir)/$(call mklibfilename,Slice,$(VERSION))
ifeq ($(wildcard $(SLICEPARSERLIB)),)
SLICEPARSERLIB = $(ice_dir)/$(lib64subdir)/$(call mklibfilename,Slice,$(VERSION))
endif
endif
ifeq ($(installphplib),)
installphplib = $(INSTALL) $(1) $(2); \
chmod a+rx $(2)/$(notdir $(1))
endif
#
# We don't need the "lib" prefix.
#
mkphplibname = $(subst lib,,$(call mklibname,$(1)))
EVERYTHING = all clean install
.SUFFIXES:
.SUFFIXES: .cpp .o .ice .php
$(SLICE_SRCS:.ice=.php): $(SLICE2PHP) $(SLICEPARSERLIB)
all:: $(SLICE_SRCS:.ice=.php)
%.php: %.ice
$(SLICE2PHP) $(SLICE2PHPFLAGS) $<
@mkdir -p .depend
@$(SLICE2PHP) $(SLICE2PHPFLAGS) --depend $< > .depend/$(*F).ice.d
.cpp.o:
$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $<
@mkdir -p .depend
@$(CXX) -DMAKEDEPEND -MM $(CXXFLAGS) $(CPPFLAGS) $< > .depend/$(*F).d
clean::
-rm -f $(TARGETS)
-rm -f core *.o *.bak
-rm -rf .depend
ifneq ($(SLICE_SRCS),)
clean::
-rm -f $(SLICE_SRCS:.ice=.php)
endif
all:: $(TARGETS)
include $(wildcard .depend/*.d)
install::
|