Comment tweak
[xapian.git] / xapian-maintainer-tools / win32msvc / config.mak
blob38ae5f62397bf1c9b99590bdcebadcc6b1b57cd7
1 # Makefile configuration for Microsoft Visual C++ 7.0 (or compatible)
2 # Thanks to Ulrik Petersen
3 # Modified by Charlie Hull, Lemur Consulting Ltd.
5 # Modify this file to set any extra Xapian build flags
7 # HINT: Instead of modifying this file, consider passing new values
8 # on the command-line. For example:
9 # % nmake PERL_DIR=c:\perl\bin SWIG=c:\something\swig.exe
10 # would override the variables without requiring you change anything...
12 # Uncomment (or set on command line) for 64-bit build:
13 #MACHINE=-machine:x64
15 # Set VERSION_SUFFIX if building from tarballs, e.g.:
16 # % nmake VERSION_SUFFIX=-1.3.4
17 # If building from git, leave this empty.
18 VERSION_SUFFIX=
20 # Set to empty to skip dependency generation for headers, e.g.:
21 # % name NMAKE_HEADERS=
22 NMAKE_HEADERS=nmake $(MAKEMACRO) /$(MAKEFLAGS) CFG="$(CFG)" DEBUG="$(DEBUG)" HEADERS
24 !IF "$(OS)" == "Windows_NT"
25 NULL=
26 !ELSE
27 NULL=nul
28 !ENDIF
29 # ----------------------------------------------
30 # Xapian paths
31 # ----------------------------------------------
33 # EDIT THESE to match where your applications and bindings are, if you are compiling them
34 # Also edit:
35 # win32_applications_omega.mak
36 # win32_bindings_python.mak
37 # and any other bindings mak files
38 XAPIAN_APPLICATIONS=..\..\xapian-applications\omega$(VERSION_SUFFIX)
39 XAPIAN_BINDINGS=..\..\xapian-bindings$(VERSION_SUFFIX)
41 # ------------- Perl settings-------------
42 # Perl folder
43 PERL_DIR=C:\Perl\bin
44 # Perl executable
45 PERL_EXE=$(PERL_DIR)\perl.exe
46 # -------------end Perl settings-------------
49 # -------------Python settings-------------
50 # Note that you should only use a Windows Python built using Visual C++, i.e. the standard Windows
51 # binary distribution
53 # Python folder for 2.4
54 PYTHON_DIR_24=c:\Python24
55 # Python executable
56 PYTHON_EXE_24=$(PYTHON_DIR_24)\python.exe
57 #PYTHON_INCLUDE : Set this to the directory that contains python.h
58 PYTHON_INCLUDE_24=$(PYTHON_DIR_24)\include
59 #A 'PC' directory is also included for people building from a source tree.
60 PYTHON_INCLUDE_2_24=$(PYTHON_DIR_24)\PC
62 # PYTHON_LIB_DIR : Set this to the directory containing python*.lib
63 # It should only be necessary to change this for source builds of Python,
64 # where the files are in 'PCBuild' rather than 'libs' (this magically works
65 # as Python uses a #pragma to reference the library base name - which
66 # includes any version numbers and debug suffixes ('_d'))
67 PYTHON_LIB_DIR_24=$(PYTHON_DIR_24)\libs
69 # Python folder for 2.5
70 PYTHON_DIR_25=c:\Python25
71 # Python executable
72 PYTHON_EXE_25=$(PYTHON_DIR_25)\python.exe
73 #PYTHON_INCLUDE : Set this to the directory that contains python.h
74 PYTHON_INCLUDE_25=$(PYTHON_DIR_25)\include
75 #A 'PC' directory is also included for people building from a source tree.
76 PYTHON_INCLUDE_2_25=$(PYTHON_DIR_25)\PC
78 # PYTHON_LIB_DIR : Set this to the directory containing python*.lib
79 # It should only be necessary to change this for source builds of Python,
80 # where the files are in 'PCBuild' rather than 'libs' (this magically works
81 # as Python uses a #pragma to reference the library base name - which
82 # includes any version numbers and debug suffixes ('_d'))
83 PYTHON_LIB_DIR_25=$(PYTHON_DIR_25)\libs
85 # Python folder for 2.6
86 PYTHON_DIR_26=c:\Python26
87 # Python executable
88 PYTHON_EXE_26=$(PYTHON_DIR_26)\python.exe
89 #PYTHON_INCLUDE : Set this to the directory that contains python.h
90 PYTHON_INCLUDE_26=$(PYTHON_DIR_26)\include
91 #A 'PC' directory is also included for people building from a source tree.
92 PYTHON_INCLUDE_2_26=$(PYTHON_DIR_26)\PC
94 # PYTHON_LIB_DIR : Set this to the directory containing python*.lib
95 # It should only be necessary to change this for source builds of Python,
96 # where the files are in 'PCBuild' rather than 'libs' (this magically works
97 # as Python uses a #pragma to reference the library base name - which
98 # includes any version numbers and debug suffixes ('_d'))
99 PYTHON_LIB_DIR_26=$(PYTHON_DIR_26)\libs
101 # Python folder for 2.7
102 PYTHON_DIR_27=c:\Python27
103 # Python executable
104 PYTHON_EXE_27=$(PYTHON_DIR_27)\python.exe
105 #PYTHON_INCLUDE : Set this to the directory that contains python.h
106 PYTHON_INCLUDE_27=$(PYTHON_DIR_27)\include
107 #A 'PC' directory is also included for people building from a source tree.
108 PYTHON_INCLUDE_2_27=$(PYTHON_DIR_27)\PC
110 # PYTHON_LIB_DIR : Set this to the directory containing python*.lib
111 # It should only be necessary to change this for source builds of Python,
112 # where the files are in 'PCBuild' rather than 'libs' (this magically works
113 # as Python uses a #pragma to reference the library base name - which
114 # includes any version numbers and debug suffixes ('_d'))
115 PYTHON_LIB_DIR_27=$(PYTHON_DIR_27)\libs
117 # Python folder for 3.0
118 PYTHON_DIR_30=c:\Python30
119 # Python executable
120 !if "$(DEBUG)"=="1"
121 PYTHON_EXE_30=$(PYTHON_DIR_30)\python_d.exe
122 !else
123 PYTHON_EXE_30=$(PYTHON_DIR_30)\python.exe
124 !endif
125 #PYTHON_INCLUDE : Set this to the directory that contains python.h
126 PYTHON_INCLUDE_30=$(PYTHON_DIR_30)\include
127 #A 'PC' directory is also included for people building from a source tree.
128 PYTHON_INCLUDE_2_30=$(PYTHON_DIR_30)\PC
130 # PYTHON_LIB_DIR : Set this to the directory containing python*.lib
131 # It should only be necessary to change this for source builds of Python,
132 # where the files are in 'PCBuild' rather than 'libs' (this magically works
133 # as Python uses a #pragma to reference the library base name - which
134 # includes any version numbers and debug suffixes ('_d'))
135 PYTHON_LIB_DIR_30=$(PYTHON_DIR_30)\libs
137 # -------------end Python settings-------------
140 # -------------PHP settings-------------
141 # PHP source folder
142 PHP52_SRC_DIR=C:\work\php-5.2.1
144 PHP52_INCLUDE_CPPFLAGS= \
145 -I "$(PHP52_SRC_DIR)" -I "$(PHP52_SRC_DIR)\tsrm" -I "$(PHP52_SRC_DIR)\Zend" -I "$(PHP52_SRC_DIR)\main" -I "$(PHP52_SRC_DIR)\regex" \
146 -D ZTS=1 -D ZEND_WIN32=1 -D PHP_WIN32=1 -D ZEND_WIN32_FORCE_INLINE -D HAVE_WIN32STD=1
148 # PHP_EXE_DIR: Set this to the folder where the PHP executable is
149 # PHP_LIB : Set this to the path to the PHP library
150 !if "$(DEBUG)"=="1"
151 PHP52_EXE_DIR=C:\php-5.2.1\Debug_TS
152 PHP52_LIB=$(PHP52_EXE_DIR)\php5ts_debug.lib
153 PHP52_DEBUG_OR_RELEASE= /D "ZEND_DEBUG=1"
154 !else
155 PHP52_EXE_DIR=C:\work\php-5.2.1-win32
156 PHP52_LIB=$(PHP52_EXE_DIR)\dev\php5ts.lib
157 PHP52_DEBUG_OR_RELEASE= /D "ZEND_DEBUG=0"
158 !endif
160 # PHP executable
161 PHP52_EXE=$(PHP52_EXE_DIR)\PHP.exe
163 # PHP 5.3.0 only -----------------
164 # We need to build separate bindings for PHP 5.3.0 as the module API has changed
166 # PHP source folder - built from a snapshot according to http://wiki.php.net/internals/windows/stepbystepbuild
167 PHP53_SRC_DIR=C:\php-sdk\php53dev\vc9\x86\php5.3-201009020830
169 PHP53_INCLUDE_CPPFLAGS= \
170 -I "$(PHP53_SRC_DIR)" -I "$(PHP53_SRC_DIR)\tsrm" -I "$(PHP53_SRC_DIR)\Zend" -I "$(PHP53_SRC_DIR)\main" \
171 -D ZTS=1 -D ZEND_WIN32=1 -D PHP_WIN32=1 -D ZEND_WIN32_FORCE_INLINE -D HAVE_WIN32STD=1
172 #-I "$(PHP53_SRC_DIR)\regex" \
174 # PHP_EXE_DIR: Set this to the folder where the PHP executable is
175 # PHP_LIB : Set this to the path to the PHP library
176 !if "$(DEBUG)"=="1"
177 PHP53_EXE_DIR=$(PHP53_SRC_DIR)\Debug_TS
178 PHP53_LIB=$(PHP53_EXE_DIR)\php5ts_debug.lib
179 PHP53_DEBUG_OR_RELEASE= /D "ZEND_DEBUG=1"
180 !else
181 PHP53_EXE_DIR=$(PHP53_SRC_DIR)\Release_TS
182 PHP53_LIB=$(PHP53_EXE_DIR)\php5ts.lib
183 PHP53_DEBUG_OR_RELEASE= /D "ZEND_DEBUG=0"
184 !endif
186 # PHP executable
187 PHP53_EXE=$(PHP53_EXE_DIR)\PHP.exe
188 # end PHP 5.3.0 only -----------------
190 # ------------- end PHP settings-------------
192 # -------------Ruby settings-------------
193 # Tested with ruby 1.8.6 (the one that is installed using the one click installer 'ruby186-26.exe').
194 # You have to change the "!=" in first line of RUBY_DIR\lib\ruby\1.8\i386-mswin32\config.h
195 # to "<=" if using a Visual C++ older than 5.0
197 # Ruby folder
198 RUBY_DIR=c:\Ruby
199 # Ruby executable
200 RUBY_EXE=$(RUBY_DIR)\bin\ruby.exe
201 # RUBY_INCLUDE : Set this to the directory that contains ruby.h
202 RUBY_INCLUDE=$(RUBY_DIR)\lib\ruby\1.8\i386-mswin32
203 # RUBY_SO_DIR : Where to install the dll file
204 RUBY_SO_DIR=$(RUBY_INCLUDE)
205 # RUBY_RB_DIR : Where to install the .rb file
206 RUBY_RB_DIR=$(RUBY_INCLUDE)\..
207 # RUBY_LIB_DIR : Set this to the directory containing msvcrt-ruby18*.lib
208 RUBY_LIB_DIR=$(RUBY_DIR)\lib
209 # -------------end Ruby settings-------------
211 # ------------- Java settings ------------
213 JAVA_DIR=C:\Program Files\Java\jdk1.6.0_05\bin
214 JAVA_INCLUDE_DIR=C:\Program Files\Java\jdk1.6.0_05\include
215 JAVA="$(JAVA_DIR)\java.exe"
216 JAVAC="$(JAVA_DIR)\javac.exe"
217 JAR="$(JAVA_DIR)\jar.exe"
218 JAVA_PATHSEP=/
220 # ------------- end Java settings-------------
222 # ------------- C# settings ------------
224 CSC="C:\WINDOWS\Microsoft.NET\Framework\v3.5\csc.exe"
225 SN="C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin\sn.exe"
227 # ------------- end C# settings ------------
229 # ------------SWIG settings-------------
230 # Swig executable
231 SWIG=\work\xapian\xapian-git\swig\swig.exe
232 SWIG_FLAGS= -Werror
233 # ------------end SWIG settings-------------
235 # ------------ Misc external libraries we depend on -------------
236 ZLIB_DIR=C:\gnu\zlib123-dll
237 # If you installed a binary version, the following 3 lines are probably
238 # correct. If you build from sources, adjust accordingly.
239 ZLIB_INCLUDE_DIR=$(ZLIB_DIR)\include
240 ZLIB_LIB_DIR=$(ZLIB_DIR)\lib
241 ZLIB_BIN_DIR=$(ZLIB_DIR)
243 PCRE_DIR=C:\Program Files\GnuWin32
244 PCRE_INCLUDE_DIR=$(PCRE_DIR)\include
245 PCRE_LIB_DIR=$(PCRE_DIR)\lib
247 #--------------------------------------
248 # Visual C++ Compiler and linker programs, and flags for these
249 #--------------------------------------
250 LIB32=link.exe -lib
251 LIB32_FLAGS=-nologo $(MACHINE)
252 LINK32=link.exe
253 LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
254 advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib rpcrt4.lib\
255 wsock32.lib Ws2_32.lib odbccp32.lib -subsystem:console $(MACHINE) -debug -nologo \
256 "$(ZLIB_LIB_DIR)\zdll.lib"
258 CPP=cl.exe
259 RSC=rc.exe
260 # Manifest handling
261 # If using Visual C++ .net 2003 - you won't need to worry about manifests.
262 # For later compilers they're needed to avoid error R6034.
263 MANIFEST=mt.exe /manifest
264 # Uncomment this version instead to skip manifest handling.
265 #MANIFEST=echo Skipping: mt.exe /manifest
267 # make sure inference rules work with all source files
268 .SUFFIXES : .cc .java
270 # xapdep is a tool to turn compiler output (using the -showIncludes option) into dependency lists
271 DEPEND=xapdep.exe
273 # We build with the following compiler options:
274 # /W3 Set warning level to 3
275 # /O2 Optimisations:Maximise speed
276 # /EHc extern "C" defaults to nothrow
277 # /EHs enable C++ EH (no SEH exceptions)
278 # /c compile, don't link
279 # /MD Link multithreaded dynamic libraries
281 # Common stuff
282 # Note we enable debug flags for a release build - this means that
283 # even in release builds, a .pdb file is generated with basic
284 # stackframe information, meaning basic debugging on release builds
285 # is still possible (so long as the .pdb files are in place - it is
286 # assumed these files will *not* ship with a default binary build)
287 CPPFLAGS_COMMON=-nologo -c -Zi -I.. -I..\include -I..\common -I..\win32 -W3 -EHsc \
288 -DWIN32 -D__WIN32__ -D_WIN32 -D_WINDOWS \
289 -D "HAVE_VSNPRINTF" -D "HAVE_STRDUP" \
290 -D_CRT_SECURE_NO_DEPRECATE \
291 -I"$(ZLIB_INCLUDE_DIR)"
293 # The various parts of Xapian (but *not* the test suite or treecheck libs)
294 XAPIAN_LIBS = \
295 "$(OUTLIBDIR)\libcommon.lib" \
296 "$(OUTLIBDIR)\libbackend.lib" \
297 "$(OUTLIBDIR)\libexpand.lib" \
298 "$(OUTLIBDIR)\libbrass.lib" \
299 "$(OUTLIBDIR)\libchert.lib" \
300 "$(OUTLIBDIR)\libinmemory.lib" \
301 "$(OUTLIBDIR)\libmulti.lib" \
302 "$(OUTLIBDIR)\libmatcher.lib" \
303 "$(OUTLIBDIR)\libnet.lib" \
304 "$(OUTLIBDIR)\liblanguages.lib" \
305 "$(OUTLIBDIR)\libapi.lib" \
306 "$(OUTLIBDIR)\libremote.lib" \
307 "$(OUTLIBDIR)\libunicode.lib" \
308 "$(OUTLIBDIR)\libweight.lib" \
309 "$(OUTLIBDIR)\libqueryparser.lib"
311 !IF "$(DEBUG)" == "1"
312 # Debug build
313 CPPFLAGS_EXTRA=$(CPPFLAGS_COMMON) -Od -MDd -D DEBUG -D _DEBUG -D XAPIAN_DEBUG
314 XAPIAN_DEBUG_OR_RELEASE=Debug
315 !ELSE
316 # Release build
317 CPPFLAGS_EXTRA=$(CPPFLAGS_COMMON) -O2 -MD -D NDEBUG
318 XAPIAN_DEBUG_OR_RELEASE=Release
319 !ENDIF
321 #----------------end Visual C++----------------------