-
Notifications
You must be signed in to change notification settings - Fork 10
/
makefile.vc
119 lines (80 loc) · 2.68 KB
/
makefile.vc
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
#
# makefile.vc - MSVC++ makefile for the PHP/MapScript extension
#
# This VC++ makefile will build the PHP module PHP_OGR.DLL (PHP wrapper to
# OGR module). For information on OGR http://gdal.velocet.ca/projects/opengis/
#
# To use the makefile:
# - Open a DOS prompt window
# - Run the VCVARS32.BAT script to initialize the VC++ environment variables
# - Start the build with: nmake /f makefile.vc
#
# $Id$
#
#To use the PHP4 module uncomment the following line
#PHP4 = 1
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Check compiler version given in command line
# nmake -f makefile.vc MSVC_VER=xxxx
# 1310 = 7.1 (2003) 1400 = 8.0 (2005) 1500 = 9.0 (2008)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!IFNDEF MSVC_VER
#assume msvc 9.0
MSVC_VER=1500
!ENDIF
# Set flag for Visual Studio > 2003 & PHP < 5.3
# see http://bugs.php.net/bug.php?id=39130
!IF $(MSVC_VER) >= 1400
VCFLAGS = -D_USE_32BIT_TIME_T
!ENDIF
OPTFLAGS = /nologo /MD /GX /Zi /W3 /DNO_REGEX_EXTRA_H
BASE_CFLAGS = $(OPTFLAGS) /DWIN32 /DZEND_WIN32 /DPHP_WIN32 /DPHP4 /DZTS /DCOMPILE_DL_OGR $(VCFLAGS)
LINK_OPT = /dll /debug
#
# Set MS_BASE to point to the buildkit base directory
#
MS_BASE = D:\build\mapserver-buildkit-2008
#
# Set PHP_SOURCE_DIR to point to the root of the PHP source tree
#
PHP_SOURCE_DIR = $(MS_BASE)\php-5.3.0rc2
PHP_INC = -I$(PHP_SOURCE_DIR) -I$(PHP_SOURCE_DIR)/main -I$(PHP_SOURCE_DIR)/zend -I$(PHP_SOURCE_DIR)/include -I$(PHP_SOURCE_DIR)/tsrm
$PHPDLLDIR='c:\apache\php4\extensions'
#xerces
XERCES_DIR = $(MS_BASE)\xerces-c-3.0.1
XERCES_INCLUDE = -I$(XERCES_DIR)/src -I$(XERCES_DIR)/src/xercesc
XERCES_LIB = $(XERCES_DIR)/Build\Win32\VC9\Release/xerces-c_3.lib
ODBC_LIB = "odbc32.lib"
#
# Where do you want the dll to be installed?
#
PHP_INSTALL_DIR = c:\php\php4\extensions
#GDAL_DIR = ../../gdal-1.3.1
GDAL_DIR = $(MS_BASE)\gdal-svn-04222009
GD_DIR = $(MS_BASE)\gd-2.0.35
PHPOGR_INC = -I$(GD_DIR) -I$(GDAL_DIR)/ogr/ogrsf_frmts -I$(GDAL_DIR)/ogr -I$(GDAL_DIR)/ogr/../port -I$(GDAL_DIR)/gcore -I$(GDAL_DIR)/alg
PHPOGR_LIBS = $(GD_DIR)/gd.lib $(GDAL_DIR)/gdal_i.lib $(XERCES_LIB) $(ODBC_LIB)
#
# The rest of the file should not have to be edited...
#
PHPOGR_OBJS = ogr.obj
PHPOGR_DLL = php_ogr.dll
CFLAGS = $(BASE_CFLAGS) $(PHPOGR_INC) $(PHP_INC)
default: all
all: $(PHPOGR_DLL)
install: all
copy $(PHPOGR_DLL) $(PHP_INSTALL_DIR)
$(PHPOGR_DLL): $(PHPOGR_OBJS)
link $(LINK_OPT) /out:$(PHPOGR_DLL) $(PHPOGR_OBJS) $(PHPOGR_LIBS)\
$(PHP_SOURCE_DIR)\lib\php5ts.lib
$(PHPOGR_OBJS): php_ogr.h
.c.obj:
$(CC) $(CFLAGS) /DCOMPILE_DL=1 /c $*.c /Fo$*.obj
clean:
del *.obj
del $(PHPOGR_OBJS)
del $(PHPOGR_DLL)
del *.lib
del *.pdb
del *.exp
del *.ilk