forked from MapServer/MapServer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.vc
257 lines (227 loc) · 7.15 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
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
247
248
249
250
251
252
253
254
255
256
257
#
# makefile.vc - Main MapServer makefile for MSVC++
#
# This VC++ makefile will build MAPSERVER.LIB, MAPSERV.EXE, and the other
# MapServer command-line programs.
#
# 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$
#
MAPSERVER_ROOT = .
!INCLUDE nmake.opt
BASE_CFLAGS = $(OPTFLAGS)
CFLAGS=$(BASE_CFLAGS) $(MS_CFLAGS)
CC= cl
LINK= link
#
# Main MapServer library.
#
MS_DLL = libmap.dll
MS_OBJS = mapbits.obj maphash.obj mapshape.obj mapxbase.obj \
mapparser.obj maplexer.obj maptree.obj \
mapsearch.obj mapstring.obj mapsymbol.obj mapfile.obj \
maplegend.obj maputil.obj mapscale.obj mapquery.obj \
maplabel.obj maperror.obj mapprimitive.obj mapproject.obj\
mapraster.obj cgiutil.obj mapsde.obj mapogr.obj maptime.obj \
maptemplate.obj mappostgis.obj maplayer.obj mapresample.obj \
mapwms.obj mapwmslayer.obj mapgml.obj maporaclespatial.obj \
mapprojhack.obj mapdraw.obj mapgd.obj mapoutput.obj \
mapgdal.obj mapwfs.obj mapwfs11.obj mapwfslayer.obj mapows.obj maphttp.obj \
mapcontext.obj mapdrawgdal.obj mapjoin.obj mapgraticule.obj \
mapimagemap.obj mapcopy.obj maprasterquery.obj \
mapogcfilter.obj mapogcsld.obj mapthread.obj mapobject.obj \
classobject.obj layerobject.obj mapwcs.obj mapwcs11.obj mapwcs20.obj \
mapgeos.obj strptime.obj mapogroutput.obj \
mapcpl.obj mapio.obj mappool.obj mapregex.obj mappluginlayer.obj \
mapogcsos.obj mappostgresql.obj mapcrypto.obj mapowscommon.obj \
maplibxml2.obj mapdebug.obj mapchart.obj mapagg.obj maptclutf.obj \
maprendering.obj mapimageio.obj mapcairo.obj \
mapoglrenderer.obj mapoglcontext.obj mapogl.obj \
maptile.obj $(EPPL_OBJ) $(REGEX_OBJ) mapgeomtransform.obj mapunion.obj \
mapkmlrenderer.obj mapkml.obj mapdummyrenderer.obj mapgeomutil.obj mapquantization.obj \
mapogcfiltercommon.obj mapcluster.obj mapuvraster.obj mapcontour.obj mapservutil.obj $(AGG_OBJ)
MS_HDRS = mapserver.h mapfile.h
MS_EXE = mapserv.exe \
shp2img.exe legend.exe \
shptree.exe scalebar.exe sortshp.exe tile4ms.exe \
shptreevis.exe msencrypt.exe
#
#
#
default: all
all: $(MS_LIB) $(MS_EXE) mapscriptvars
$(MS_OBJS): $(MS_HDRS)
$(MS_DLL) $(MS_LIB_DLL): $(MS_LIB)
link /dll $(LDEBUG) \
$(MS_OBJS) $(EXTERNAL_LIBS) \
/out:$(MS_DLL) /implib:$(MS_LIB_DLL)
if exist $(MS_DLL).manifest mt -manifest $(MS_DLL).manifest -outputresource:$(MS_DLL);2
$(MS_LIB): $(MS_OBJS)
if exist $(GDAL_DIR)\gdal.pdb copy $(GDAL_DIR)\gdal.pdb .
lib /out:$(MS_LIB) $(MS_OBJS)
!IFDEF DLLBUILD
$(MS_EXE): $(MS_DLL) $(MS_LIB_DLL)
!ELSE
$(MS_EXE): $(MS_LIB)
!ENDIF
gd::
cd gd-1.2
nmake /f makefile.nt OPTFLAGS="$(OPTFLAGS)"
cd ..
.c.obj:
$(CC) $(CFLAGS) /c $*.c /Fo$*.obj
.cpp.obj:
$(CC) $(CFLAGS) /c $*.cpp /Fo$*.obj
.c.exe:
$(CC) $(CFLAGS) /c $*.c /Fo$*.obj
!IFDEF DLLBUILD
$(LINK) $(LDEBUG) $(LDFLAGS) $*.obj $(LIBS_DLL)
!ELSE
$(LINK) $(LDEBUG) $(LDFLAGS) $*.obj $(LIBS)
!ENDIF
if exist [email protected] mt -manifest [email protected] -outputresource:$@;1
clean:
del *.obj
del $(REGEX_OBJ)
del $(AGG_OBJ)
del *.lib
del *.dll
del $(MS_EXE)
del *.pdb
del *.exp
del *.ilk
del *.manifest
del renderers\agg\*.obj
!IFDEF DOT_NET
cd mapscript\csharp
nmake /f makefile.vc clean
cd ..\..
!ENDIF
!IFDEF JAVA_HOME
cd mapscript\java
nmake /f makefile.vc clean
cd ..\..
!ENDIF
!IFDEF PHP_HOME
cd mapscript\php
nmake /f makefile.vc clean
cd ..\..
!ENDIF
!IFDEF PYTHON_HOME
cd mapscript\python
-del mapscript_wrap.c
-rmdir /s /q build
cd ..\..
!ENDIF
mapscriptvars: makefile.vc nmake.opt
-del mapscriptvars
echo $(MS_CURRENT) > mapscriptvars
!IFDEF WIN64
echo $(MS_DEFS) -DWIN32 -D_WIN32 -DUSE_GENERIC_MS_NINT >> mapscriptvars
!ELSE
echo $(MS_DEFS) -DWIN32 -D_WIN32 >> mapscriptvars
!ENDIF
echo $(INCLUDES) >> mapscriptvars
echo $(LIBS_DLL) >> mapscriptvars
echo $(LIBS) >> mapscriptvars
findstr MS_VERSION mapserver.h | findstr define >> mapscriptvars
#install: $(MS_DLL) $(MS_EXE) python csharp java php
install: $(MS_DLL) $(MS_EXE)
-mkdir $(BINDIR)
xcopy /y /r /d /f $(MS_DLL) $(BINDIR)
copy *.exe $(BINDIR)
!IFDEF PYTHON_HOME
-mkdir $(BINDIR)\mapscript\python
xcopy /y /r /d /f .\mapscript\python\dist\*.zip $(BINDIR)\mapscript\python
!ENDIF
!IFDEF DOT_NET
-mkdir $(BINDIR)\mapscript\csharp
xcopy /y /r /d /f .\mapscript\csharp\*.dll $(BINDIR)\mapscript\csharp
xcopy /y /r /d /f .\mapscript\csharp\*.exe $(BINDIR)\mapscript\csharp
xcopy /y /r /d /f .\mapscript\csharp\*.manifest $(BINDIR)\mapscript\csharp
xcopy /y /r /d /f .\mapscript\csharp\*.config $(BINDIR)\mapscript\csharp
!ENDIF
!IFDEF JAVA_HOME
-mkdir $(BINDIR)\mapscript\java
xcopy /y /r /d /f .\mapscript\java\*.dll $(BINDIR)\mapscript\java
xcopy /y /r /d /f .\mapscript\java\*.jar $(BINDIR)\mapscript\java
!ENDIF
!IFDEF PHP_HOME
-mkdir $(BINDIR)\mapscript\php
xcopy /y /r /d /f .\mapscript\php\*.dll $(BINDIR)\mapscript\php
!ENDIF
!IFDEF PYTHON_HOME
python: mapscriptvars $(MS_DLL) $(MS_LIB_DLL)
cd mapscript\python
$(SWIG) -python -shadow -o mapscript_wrap.c ../mapscript.i
$(PYTHON_HOME)\PCBuild\python.exe setup.py bdist
cd ..\..
!ELSE
python:
!ENDIF
!IFDEF DOT_NET
csharp: mapscriptvars $(MS_DLL) $(MS_LIB_DLL)
cd mapscript\csharp
nmake /f makefile.vc
cd ..\..
!ELSE
csharp:
!ENDIF
!IFDEF JAVA_HOME
java: mapscriptvars $(MS_DLL) $(MS_LIB_DLL)
cd mapscript\java
nmake /f makefile.vc
cd ..\..
!ELSE
java:
!ENDIF
!IFDEF PHP_HOME
php: mapscriptvars $(MS_DLL) $(MS_LIB_DLL)
cd mapscript\php
nmake /f makefile.vc
cd ..\..
!ELSE
php:
!ENDIF
!IF DEFINED(SDE_OPT) || DEFINED(ORACLE) || DEFINED(MSSQL2008)
!IFDEF ORACLE
ORACLE_LIB=$(ORACLE_DIR)/lib/msvc/oci.lib
!ENDIF
!IFDEF SDE_OPT
!IF $(SDE_VERSION) >= 92
SDE_LIB = $(SDE_DIR)\lib\pe.lib \
$(SDE_DIR)\lib\sde.lib \
$(SDE_DIR)\lib\sg.lib
!ELSE
SDE_LIB = $(SDE_DIR)\lib\pe$(SDE_VERSION).lib \
$(SDE_DIR)\lib\sde$(SDE_VERSION).lib \
$(SDE_DIR)\lib\sg$(SDE_VERSION).lib
!ENDIF
!ENDIF
!ENDIF
plugins:
-del mapsde.obj
-del maporaclespatial.obj
-del mapmssql2008.obj
!IFDEF SDE_OPT
$(CC) $(CFLAGS) -DUSE_SDE /c mapsde.c /Fomapsde.obj
link /dll $(LDEBUG) /out:msplugin_sde_$(SDE_VERSION).dll mapsde.obj mapthread.obj mapserver_i.lib $(SDE_LIB)
if exist msplugin_sde_$(SDE_VERSION).dll.manifest mt -manifest msplugin_sde_$(SDE_VERSION).dll.manifest -outputresource:msplugin_sde_$(SDE_VERSION).dll;2
-del mapsde.obj
!ENDIF
!IFDEF ORACLE
$(CC) $(CFLAGS) -DUSE_ORACLESPATIAL /c maporaclespatial.c /Fomaporaclespatial.obj
link /dll $(LDEBUG) /out:msplugin_oracle.dll maporaclespatial.obj $(ORACLE_LIB) mapserver_i.lib
if exist msplugin_oracle.dll.manifest mt -manifest msplugin_oracle.dll.manifest -outputresource:msplugin_oracle.dll;2
-del maporaclespatial.obj
!ENDIF
!IFDEF MSSQL2008
$(CC) $(CFLAGS) $(ODBC_INC) -DUSE_MSSQL2008 -DUSE_MSSQL2008_PLUGIN /c mapmssql2008.c /Fomapmssql2008.obj
link /dll $(LDEBUG) /out:msplugin_mssql2008.dll mapmssql2008.obj $(ODBC_LIBS) mapserver_i.lib
if exist msplugin_mssql2008.dll.manifest mt -manifest msplugin_mssql2008.dll.manifest -outputresource:msplugin_mssql2008.dll;2
-del mapmssql2008.obj
!ENDIF