forked from simplegeo/spatialindex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile.vc
216 lines (185 loc) · 6.84 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
.SUFFIXES: .cc
SPATIALINDEX_HOME=c:\cvs\buildkit\spatialindex
DLL_VERSION = 1
BINDIR=$(SPATIALINDEX_HOME)\bin
OSGEO4W_DIR = $(SPATIALINDEX_HOME)\osgeo4w
###############################################################################
# Set BUILD_DEBUG balue to YES if you want to make debug build
# and to prepare not optimized binaries.
!IFNDEF BUILD_DEBUG
BUILD_DEBUG = NO
!ENDIF
###############################################################################
# Derive version of Visual C++ being used from NMAKE if not specified
#
# WARNING:
# If we should expect variety of NMAKE build versions, tests below may fail
# and we will need to fall back to setting MSVCVER as command line parameter.
#
!IF "$(_NMAKE_VER)" == ""
MSVCVER = 4.0
!ERROR *** Failed to determine version of Visual C++
!ELSEIF "$(_NMAKE_VER)" == "162"
MSVCVER = 5.0
!ERROR *** Detected Visual C++ 5.0 - NOT SUPPORTED
!ELSEIF "$(_NMAKE_VER)" == "6.00.8168.0"
MSVCVER = 6.0
!ERROR *** Detected Visual C++ 6.0 - NOT SUPPORTED
!ELSEIF "$(_NMAKE_VER)" == "7.00.9466"
MSVCVER = 7.0
!ELSEIF "$(_NMAKE_VER)" == "7.10.3077"
MSVCVER = 7.1
!ELSEIF "$(_NMAKE_VER)" == "8.00.50727.42"
MSVCVER = 8.0
!ELSEIF "$(_NMAKE_VER)" == "8.00.50727.762"
MSVCVER = 8.0
!ELSEIF "$(_NMAKE_VER)" == "9.00.21022.08"
MSVCVER = 9.0
!ELSEIF "$(_NMAKE_VER)" == "9.00.30729.01"
MSVCVER = 9.0
!ELSE
MSVCVER = 0.0
!ENDIF
!IF "$(MSVCVER)" == "0.0"
!MESSAGE *** Cannot determined Visual C++ version
!ERROR *** Aborting make job
!ELSE
!MESSAGE *** Using Microsoft NMAKE version $(_NMAKE_VER)
!MESSAGE *** Using Microsoft Visual C++ version $(MSVCVER)
!ENDIF
###############################################################################
# Compilation flags for Release and Debug modes
!IF "$(BUILD_DEBUG)" == "YES"
OPTFLAGS=/nologo /MDd /EHsc /Z7 /W4 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /DDEBUG /D_DEBUG /DDEBUG /Fd$(SPATIALINDEX_HOME)\spatialindex.pdb
LAS_LIB = spatialindex_d.lib
LAS_DLL = spatialindex_d$(DLL_VERSION).dll
LAS_LIB_DLL = spatialindex_i.lib
!ELSE
# You may need to remove /GR if you are statically linking libLAS
OPTFLAGS=/nologo /MD /EHsc /Ox /GR /W2 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /DNDEBUG /D "PACKAGE_BUGREPORT=\"[email protected]\"" /DSPATIALINDEX_CREATE_DLL=1
LAS_LIB = spatialindex.lib
LAS_DLL = spatialindex$(DLL_VERSION).dll
CDLLNAME = spatialindex$(DLL_VERSION)_c.dll
CLIBNAME = spatialindex_c_i.lib
LAS_LIB_DLL = spatialindex_i.lib
!ENDIF
# Check if multiple process build available
!IF "$(MSVCVER)" == "9.0"
MPFLAGS=/MP
!MESSAGE *** Using /MP flag with number of effective processors
!ELSE
MPFLAGS=
!ENDIF
PACKAGE_VERSION=1.5.0
INCLUDES=-I$(SPATIALINDEX_HOME)/include -I$(SPATIALINDEX_HOME)/include/capi
CFLAGS= $(MPFLAGS) $(OPTFLAGS) $(INCLUDES)
# Commands
#
MAKE = nmake
RM = -del
CC= cl
LINK= link
LAS_DIRLIST = src\mvrtree \
src\rtree \
src\spatialindex \
src\storagemanager \
src\tools \
src\tprtree \
src\capi
OBJS = src\mvrtree\Index.obj \
src\mvrtree\Leaf.obj \
src\mvrtree\MVRtree.obj \
src\mvrtree\Node.obj \
src\mvrtree\Statistics.obj \
src\rtree\BulkLoader.obj \
src\rtree\Index.obj \
src\rtree\Leaf.obj \
src\rtree\Node.obj \
src\rtree\RTree.obj \
src\rtree\Statistics.obj \
src\spatialindex\LineSegment.obj \
src\spatialindex\MovingPoint.obj \
src\spatialindex\MovingRegion.obj \
src\spatialindex\Point.obj \
src\spatialindex\Region.obj \
src\spatialindex\SpatialIndexImpl.obj \
src\spatialindex\TimePoint.obj \
src\spatialindex\TimeRegion.obj \
src\storagemanager\Buffer.obj \
src\storagemanager\DiskStorageManager.obj \
src\storagemanager\MemoryStorageManager.obj \
src\storagemanager\RandomEvictionsBuffer.obj \
src\tools\rand48.obj \
src\tools\Tools.obj \
src\tprtree\Index.obj \
src\tprtree\Leaf.obj \
src\tprtree\Node.obj \
src\tprtree\Statistics.obj \
src\tprtree\TPRTree.obj
COBJS = src\capi\BoundsQuery.obj \
src\capi\CountVisitor.obj \
src\capi\DataStream.obj \
src\capi\Error.obj \
src\capi\IdVisitor.obj \
src\capi\Index.obj \
src\capi\LeafQuery.obj \
src\capi\ObjVisitor.obj \
src\capi\sidx_api.obj\
src\capi\Utility.obj
default: $(LAS_DLL) $(CDLLNAME)
all: default
$(LAS_LIB): $(OBJS)
if exist $(LAS_LIB) del $(LAS_LIB)
$(LINK) /lib /nologo /out:$(LAS_LIB) $(OBJS)
$(LAS_DLL): $(LAS_LIB) $(RES)
$(LINK) /dll \
$(OBJS) $(LAS_LIB) \
/out:$(LAS_DLL) /implib:$(LAS_LIB_DLL)
if exist $(LAS_DLL).manifest mt -manifest $(LAS_DLL).manifest -outputresource:$(LAS_DLL);2
$(CDLLNAME): $(COBJS) $(LAS_DLL)
$(LINK) /dll /debug $(COBJS) $(LAS_LIB_DLL) /out:$(CDLLNAME) /implib:$(CLIBNAME)
if exist $(CDLLNAME).manifest mt -manifest $(CDLLNAME).manifest -outputresource:$(CDLLNAME);2
install: default
-mkdir $(BINDIR)
-mkdir $(SPATIALINDEX_HOME)\packages
-mkdir $(BINDIR)\lib
-mkdir $(BINDIR)\include\spatialindex
-mkdir $(OSGEO4W_DIR)
-mkdir $(OSGEO4W_DIR)\lib
-mkdir $(OSGEO4W_DIR)\devel
-mkdir $(OSGEO4W_DIR)\lib\bin
-mkdir $(OSGEO4W_DIR)\devel\include
-mkdir $(OSGEO4W_DIR)\devel\include\spatialindex
-mkdir $(OSGEO4W_DIR)\devel\lib
xcopy /y /r /d /f spatialindex_i.lib $(BINDIR)\lib
xcopy /y /r /d /f spatialindex_i.lib $(OSGEO4W_DIR)\devel\lib
xcopy /y /r /d /f spatialindex.lib $(BINDIR)\lib
xcopy /y /r /d /f spatialindex.lib $(OSGEO4W_DIR)\devel\lib
xcopy /y /r /d /f /s include\* $(BINDIR)\include\spatialindex
xcopy /y /r /d /f /s include\* $(OSGEO4W_DIR)\devel\include\spatialindex
xcopy /y /r /d /f $(LAS_DLL) $(BINDIR)
xcopy /y /r /d /f $(LAS_DLL) $(OSGEO4W_DIR)\lib\bin
.cc.obj:
$(CC) $(CFLAGS) /c $*.cc /Fo$@
.c.obj:
$(CC) $(CFLAGS) /c $*.c /Fo$@
clean:
$(RM) $(LAS_LIB)
$(RM) $(LAS_DLL)
$(RM) *.ilk
$(RM) *.manifest
$(RM) *.obj
$(RM) *.pdb
for %d in ( $(LAS_DIRLIST) ) do \
del %d\*.obj
package: install
cd $(SPATIALINDEX_HOME)/osgeo4w/lib
C:\cygwin\bin\tar.exe cvf ../../packages/libspatialindex-$(PACKAGE_VERSION).tar *
c:\cygwin\bin\bzip2.exe -f /cygdrive/c/cvs/buildkit/spatialindex/packages/libspatialindex-$(PACKAGE_VERSION).tar
cd $(SPATIALINDEX_HOME)/osgeo4w/
cd $(SPATIALINDEX_HOME)/osgeo4w/devel
C:\cygwin\bin\tar.exe cvf ../../packages/libspatialindex-devel-$(PACKAGE_VERSION).tar *
c:\cygwin\bin\bzip2.exe -f /cygdrive/c/cvs/buildkit/spatialindex/packages/libspatialindex-devel-$(PACKAGE_VERSION).tar
cd $(SPATIALINDEX_HOME)/osgeo4w/
cd $(SPATIALINDEX_HOME)/
c:\cygwin\bin\zip.exe -r packages/libspatialindex-$(PACKAGE_VERSION)-win32.zip bin