1 # Makefile for Microsoft Visual C++ 7.0 (or compatible)
2 # Charlie Hull, Lemur Consulting Ltd.
5 # Will build the PHP bindings
7 # Where the core is, relative to the PHP bindings
8 # Change this to match your environment
9 XAPIAN_CORE_REL_PHP
=..\..\xapian-core
$(VERSION_SUFFIX
)
11 OUTLIBDIR
=$(XAPIAN_CORE_REL_PHP
)\win32\
$(XAPIAN_DEBUG_OR_RELEASE
)\libs
13 !INCLUDE
$(XAPIAN_CORE_REL_PHP
)\win32\config.mak
15 LIB_XAPIAN_OBJS
= ".\xapian_wrap.obj" ".\version.res"
19 !if
"$(PHP_VER)" == "52"
20 PHP_EXE_DIR
=$(PHP52_EXE_DIR
)
21 PHP_LIB
= $(PHP52_LIB
)
22 PHP_SRC_DIR
= $(PHP52_SRC_DIR
)
23 PHP_INCLUDE_CPPFLAGS
= $(PHP52_INCLUDE_CPPFLAGS
)
24 PHP_DEBUG_OR_RELEASE
= $(PHP52_DEBUG_OR_RELEASE
)
25 OUTROOT
= $(XAPIAN_CORE_REL_PHP
)\win32\
$(XAPIAN_DEBUG_OR_RELEASE
)\PHP52
26 PHP_EXE
= $(PHP52_EXE
)
27 !else if
"$(PHP_VER)" == "53"
28 PHP_EXE_DIR
= $(PHP53_EXE_DIR
)
29 PHP_LIB
= $(PHP53_LIB
)
30 PHP_SRC_DIR
= $(PHP53_SRC_DIR
)
31 PHP_INCLUDE_CPPFLAGS
= $(PHP53_INCLUDE_CPPFLAGS
)
32 PHP_DEBUG_OR_RELEASE
= $(PHP53_DEBUG_OR_RELEASE
)
33 OUTROOT
= $(XAPIAN_CORE_REL_PHP
)\win32\
$(XAPIAN_DEBUG_OR_RELEASE
)\PHP53
34 PHP_EXE
= $(PHP53_EXE
)
37 OUTDIR
=$(OUTROOT
)\php5
40 ALL
: "$(OUTDIR)\php_xapian.dll" "$(OUTDIR)\xapian.php" \
41 "$(OUTROOT)\smoketest.php"
44 -@erase
"$(OUTDIR)\php_xapian.dll"
45 -@erase
"$(OUTDIR)\php_xapian.exp"
46 -@erase
"$(OUTDIR)\php_xapian.lib"
47 -@erase
$(LIB_XAPIAN_OBJS
)
48 -@erase
"$(OUTDIR)\xapian.php"
49 -@erase
"$(OUTROOT)\smoketest.php"
53 if exist
"php5" rmdir
"php5" /s
/q
57 $(PHP_EXE
) -q
-n
-d safe_mode
=off
-d enable_dl
=on
-d extension_dir
="php5" -d include_path
="php5" smoketest.php
63 if not exist
"$(OUTDIR)\dist/$(NULL)" mkdir
"$(OUTDIR)\dist"
64 if not exist
"$(OUTDIR)\dist\docs/$(NULL)" mkdir
"$(OUTDIR)\dist\docs"
65 if not exist
"$(OUTDIR)\dist\docs\examples/$(NULL)" mkdir
"$(OUTDIR)\dist\docs\examples"
66 copy
"$(OUTDIR)\php_xapian.dll" "$(OUTDIR)\dist"
67 copy
"$(OUTDIR)\xapian.php" "$(OUTDIR)\dist"
68 copy docs\
*.html
"$(OUTDIR)\dist\docs"
69 copy docs\examples\
*.
* "$(OUTDIR)\dist\docs\examples"
72 if not exist
"$(OUTROOT)/$(NULL)" mkdir
"$(OUTROOT)"
75 if not exist
"$(OUTDIR)/$(NULL)" mkdir
"$(OUTDIR)"
78 CPP_PROJ
=$(CPPFLAGS_EXTRA
) /GR \
79 /I
"$(XAPIAN_CORE_REL_PHP)" /I
"$(XAPIAN_CORE_REL_PHP)\include" $(PHP_INCLUDE_CPPFLAGS
) $(PHP_DEBUG_OR_RELEASE
)\
80 /I
"." /Fo
"$(INTDIR)\\" /Tp
$(INPUTNAME
)
81 CPP_OBJS
=$(XAPIAN_CORE_REL_PHP
)\win32\
$(XAPIAN_DEBUG_OR_RELEASE
)\
84 !IF
"$(SWIGBUILD)" == "1"
86 php5
/xapian_wrap.
cc php5
/php_xapian.h php5
/xapian.php
: ..
/xapian.i util.i
89 $(SWIG
) -I
"$(XAPIAN_CORE_REL_PHP)\include" $(SWIG_FLAGS
) -c
++ -php5
-prefix Xapian \
90 -outdir php5
-o php5
/xapian_wrap.
cc $(srcdir)/..
/xapian.i
93 ALL_LINK32_FLAGS
=$(LINK32_FLAGS
) $(XAPIAN_LIBS
) $(PHP_LIB
)
96 "$(OUTDIR)\php_xapian.dll" : "$(OUTDIR)" $(DEF_FILE
) $(LIB_XAPIAN_OBJS
)
99 $(ALL_LINK32_FLAGS
) /DLL
/out
:"$(OUTDIR)\php_xapian.dll" $(DEF_FLAGS
) $(LIB_XAPIAN_OBJS
)
102 "$(OUTDIR)\xapian.php" : php5\xapian.php
103 -copy
$** "$(OUTDIR)\xapian.php"
104 $(MANIFEST
) "$(OUTDIR)\php_xapian.dll.manifest" -outputresource
:"$(OUTDIR)\php_xapian.dll;2"
105 -@erase
"$(OUTDIR)\php_xapian.dll.manifest"
106 "$(OUTROOT)\smoketest.php" : ".\smoketest.php"
107 -copy
$** "$(OUTROOT)\smoketest.php"
112 ".\version.res": version.rc
115 /I
"$(XAPIAN_CORE_REL_PHP)\include" \
116 /I
"$(PHP_SRC_DIR)\main" \
117 /d PHP_MAJOR_VERSION
="\"5\"" \
120 ".\xapian_wrap.obj" : "php5\xapian_wrap.cc"
125 .c
{$(CPP_OBJS
)}.obj
::
130 .
cpp{$(CPP_OBJS
)}.obj
::
135 .
cxx{$(CPP_OBJS
)}.obj
::
140 .c
{$(CPP_SBRS
)}.sbr
::
145 .
cpp{$(CPP_SBRS
)}.sbr
::
150 .
cxx{$(CPP_SBRS
)}.sbr
::