summaryrefslogtreecommitdiff
path: root/php/config/Make.rules.mak.php
blob: e07ef4939d07cc5cde31be37b9c5d8a929e86294 (plain)
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
# **********************************************************************
#
# 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.
#

!if "$(PREFIX)" == ""
prefix			= C:\Ice-$(VERSION)
!else
prefix			= $(PREFIX)
!endif

#
# Define OPTIMIZE as yes if you want to build with optimization.
# Otherwise the Ice extension is built with debug information.
#

OPTIMIZE		= yes

#
# Specify your C++ compiler. The only value currently supported to
# build IcePHP is VC110. Leave unset for auto-detection.
#
#CPP_COMPILER		= VCxxx

#
# Determines whether the extension uses PHP namespaces (requires
# PHP 5.3 or later).
#
!if "$(USE_NAMESPACES)" == ""
USE_NAMESPACES		= no
!endif

#
# Set PHP_HOME to your PHP source directory.
#
!if "$(PHP_HOME)" == ""
PHP_HOME		= C:\php-7.0.3
!endif

#
# Set PHP_BIN_HOME to your PHP binary installation directory.
#
!if "$(PHP_BIN_HOME)" == ""
!if "$(PROCESSOR_ARCHITECTURE)" == "AMD64"
PHP_BIN_HOME	 = $(PROGRAMFILES) (x86)\PHP
!else
PHP_BIN_HOME	 = $(PROGRAMFILES)\PHP
!endif
!endif

#
# Set PHP_ZTS to "no" (or comment it out) to disable Zend Thread Safety.
#
!if "$(PHP_ZTS)" == ""
PHP_ZTS			= yes
!endif

#
# If third party libraries are not installed in the default location
# or THIRDPARTY_HOME is not set in your environment variables then
# change the following setting to reflect the installation location.
#
!if "$(THIRDPARTY_HOME)" == ""
!if "$(PROCESSOR_ARCHITECTURE)" == "AMD64"
THIRDPARTY_HOME	 = $(PROGRAMFILES) (x86)\ZeroC\Ice-$(VERSION)-ThirdParty
!else
THIRDPARTY_HOME	 = $(PROGRAMFILES)\ZeroC\Ice-$(VERSION)-ThirdParty
!endif
!endif


# ----------------------------------------------------------------------
# Don't change anything below this line!
# ----------------------------------------------------------------------

#
# Common definitions
#
ice_language     = php
ice_require_cpp  = yes
slice_translator = slice2php.exe

!if exist ($(top_srcdir)\..\config\Make.common.rules.mak)
!include $(top_srcdir)\..\config\Make.common.rules.mak
!else
!include $(top_srcdir)\config\Make.common.rules.mak
!endif

libdir		= $(top_srcdir)\lib
install_phpdir	= $(prefix)\php
install_libdir	= $(prefix)\php

!if exist ($(top_srcdir)\..\cpp\config\Make.rules.msvc)
!include $(top_srcdir)\..\cpp\config\Make.rules.msvc
!else
!include $(top_srcdir)\config\Make.rules.msvc
!endif

libsuff         = $(x64suffix)

!if "$(OPTIMIZE)" != "yes"
LIBSUFFIX       = $(LIBSUFFIX)d
RCFLAGS		= -D_DEBUG
!endif

#
# Import libraries are located automatically
#
ICE_LIBS	=

!if "$(ice_src_dist)" != ""
ICE_CPPFLAGS    = -I"$(ice_cpp_dir)\include"
!if "$(ice_cpp_dir)" == "$(ice_dir)\cpp"
ICE_LDFLAGS	= /LIBPATH:"$(ice_cpp_dir)\lib"
!else
ICE_LDFLAGS	= /LIBPATH:"$(ice_cpp_dir)\lib$(libsuff)"
!endif
!else
ICE_CPPFLAGS    = -I"$(ice_dir)\include"
ICE_LDFLAGS     = /LIBPATH:"$(ice_dir)\lib$(libsuff)"
!endif

slicedir        = $(ice_dir)\slice

!if "$(PHP_ZTS)" == "yes"
PHP_LIB_PREFIX	= php7ts
!else
PHP_LIB_PREFIX	= php7
!endif

!if "$(OPTIMIZE)" != "yes"
PHP_LDFLAGS	= /LIBPATH:"$(PHP_BIN_HOME)"
PHP_LIBS	= $(PHP_LIB_PREFIX)_debug.lib IceDiscoveryd.lib IceLocatorDiscoveryd.lib
PHP_ZEND_DEBUG	= 1
!else
PHP_LDFLAGS	= /LIBPATH:"$(PHP_BIN_HOME)\dev"
PHP_LIBS	= $(PHP_LIB_PREFIX).lib  IceDiscovery.lib IceLocatorDiscovery.lib
PHP_ZEND_DEBUG	= 0
!endif

PHP_CPPFLAGS	= -I"$(PHP_HOME)" -I"$(PHP_HOME)\main" -I"$(PHP_HOME)\TSRM" -I"$(PHP_HOME)\Zend" -DPHP_WIN32 -DZEND_WIN32 -DZEND_DEBUG=$(PHP_ZEND_DEBUG) -DWIN32 -DZEND_WIN32_KEEP_INLINE
!if "$(PHP_ZTS)" == "yes"
PHP_CPPFLAGS	= $(PHP_CPPFLAGS) -DZTS
!endif

ICECPPFLAGS	= -I"$(slicedir)"
SLICE2PHPFLAGS	= $(ICECPPFLAGS) $(SLICE2PHPFLAGS)

!if "$(USE_NAMESPACES)" == "yes"
CPPFLAGS	= $(CPPFLAGS) -DICEPHP_USE_NAMESPACES
SLICE2PHPFLAGS	= $(SLICE2PHPFLAGS) -n
!endif

!if "$(ice_src_dist)" != ""
!if "$(ice_cpp_dir)" == "$(ice_dir)\cpp"
SLICE2PHP	= $(ice_cpp_dir)\bin\slice2php.exe
SLICEPARSERLIB	= $(ice_cpp_dir)\lib\slice.lib
!if !exist ("$(SLICEPARSERLIB)")
SLICEPARSERLIB	= $(ice_cpp_dir)\lib\sliced.lib
!endif
!else
SLICE2PHP	= $(ice_cpp_dir)\bin$(x64suffix)\slice2php.exe
SLICEPARSERLIB	= $(ice_cpp_dir)\lib$(x64suffix)\slice.lib
!if !exist ("$(SLICEPARSERLIB)")
SLICEPARSERLIB	= $(ice_cpp_dir)\lib$(x64suffix)\sliced.lib
!endif
!endif
!else
SLICE2PHP	= $(ice_dir)\bin\slice2php.exe
SLICEPARSERLIB	= $(ice_dir)\lib\slice.lib
!endif

EVERYTHING	= all clean install depend
EVERYTHING_EXCEPT_INSTALL = all clean depend

.SUFFIXES:
.SUFFIXES:	.cpp .obj .php .res .rc .d .ice

DEPEND_DIR = .depend.mak

depend::

!if exist(.depend.mak)
depend::
	@del /q .depend.mak

!include .depend.mak
!endif

!if "$(OBJS)" != ""

OBJS_DEPEND = $(OBJS:.obj=.d)
OBJS_DEPEND = $(OBJS_DEPEND:.\=.depend.mak\)

depend:: $(OBJS_DEPEND)

!endif

!if "$(SLICE_SRCS)" != ""

depend:: $(SLICE_SRCS:.ice=.d)

$(SLICE_SRCS:.ice=.php): "$(SLICE2PHP)" "$(SLICEPARSERLIB)"

all:: $(SLICE_SRCS:.ice=.php)

clean::
	del /q $(SLICE_SRCS:.ice=.php)

!endif

.ice.php:
	"$(SLICE2PHP)" $(SLICE2PHPFLAGS) $<

.ice.d:
	@echo Generating dependencies for $<
	@"$(SLICE2PHP)" $(SLICE2PHPFLAGS) --depend $< | \
	cscript /NoLogo $(top_srcdir)\..\config\makedepend-slice.vbs $(*F).ice

.cpp{$(DEPEND_DIR)}.d:
	@echo Generating dependencies for $<
	@$(CXX) /E $(CPPFLAGS) $(CXXFLAGS) /showIncludes $< 1>$(*F).i 2>$(*F).d && \
	cscript /NoLogo $(top_srcdir)\..\config\makedepend.vbs $(*F).cpp $(top_srcdir)
	@del /q $(*F).d $(*F).i

.cpp.obj::
	$(CXX) /c $(CPPFLAGS) $(CXXFLAGS) $<

.rc.res:
	rc $(RCFLAGS) $<

clean::
	del /q $(TARGETS) *.obj *.bak

all:: $(TARGETS)

install::