-
Notifications
You must be signed in to change notification settings - Fork 1
/
nmake.opt
222 lines (187 loc) · 6.81 KB
/
nmake.opt
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
# $Id$
#
# nmake.opt - main configuration file for NMAKE makefiles
#
!MESSAGE *** libLAS Build Configuration ***
!INCLUDE <ntwin32.mak>
###############################################################################
# For convenience, user may put custom settings to private mynmake.opt
# and use EXT_NMAKE_OPT option while calling nmake.exe, as follows:
#
# nmake -f makefile.vc EXT_NMAKE_OPT=mynmake.opt
!IFDEF EXT_NMAKE_OPT
!MESSAGE *** Setting EXT_NMAKE_OPT $(EXT_NMAKE_OPT)
!INCLUDE $(EXT_NMAKE_OPT)
!ENDIF
###############################################################################
# libLAS package settings
LAS_LIB = liblas.lib
LAS_DLL = liblas1.dll
LAS_LIB_DLL = liblas_i.lib
# only used for filenames of packages
PACKAGE_VERSION = 1.2.0
!MESSAGE *** Setting PACKAGE_VERSION $(PACKAGE_VERSION)
###############################################################################
# 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
!MESSAGE *** Setting BUILD_DEBUG $(BUILD_DEBUG)
###############################################################################
# libLAS include directories
INCLUDES = -I$(LAS_ROOT)/include -I$(LAS_ROOT)/include/liblas/capi
!MESSAGE *** Setting libLAS INCLUDE to -I$(LAS_ROOT)/include -I$(LAS_ROOT)/include/liblas/capi
###############################################################################
# GeoTIFF Support
# Uncomment the folling line to build GeoTIFF support for reading and
# writing LAS files with Coordinate Systems information.
# comment out GEOTIFF_HOME if you are building against a GDAL source tree
!IFNDEF GEOTIFF_HOME
GEOTIFF_HOME=C:\OSGeo4W
!ENDIF
!IF "$(GEOTIFF_HOME)" != "" && EXIST("$(GEOTIFF_HOME)")
!MESSAGE *** GeoTIFF support enabled
!MESSAGE *** Setting GEOTIFF_HOME $(GEOTIFF_HOME)
GEOTIFF_LIB = $(GEOTIFF_HOME)\lib\geotiff_i.lib
GEOTIFF_INCLUDE = -I$(GEOTIFF_HOME)\include
INCLUDES = $(INCLUDES) $(GEOTIFF_INCLUDE)
!ELSE
GEOTIFF_HOME=""
!MESSAGE *** Support of GeoTIFF has been disabled (GEOTIFF_HOME not set)
!ENDIF
###############################################################################
# GDAL/OGR Support
# Uncomment the following line to build OGR support for the las2ogr command
# and WKT SRS support
#USE_GDAL_SOURCE_TREE=YES
#GDAL_HOME=C:\cvs\buildkit\gdal
!IFNDEF GDAL_HOME
GDAL_HOME=C:\OSGeo4W
!ENDIF
!IF "$(GDAL_HOME)" != "" && EXIST("$(GDAL_HOME)")
!MESSAGE *** GDAL/OGR support enabled
!MESSAGE *** Setting GDAL_HOME $(GDAL_HOME)
GDAL_LIB = $(GDAL_HOME)\lib\gdal_i.lib
GDAL_INCLUDE = -I$(GDAL_HOME)\include
!IF "$(USE_GDAL_SOURCE_TREE)" == "YES"
GDAL_LIB = $(GDAL_HOME)\gdal_i.lib
GDAL_INCLUDE = -I$(GDAL_HOME)\port -I$(GDAL_HOME)\frmts\gtiff\libgeotiff -I$(GDAL_HOME)\frmts\gtiff\libtiff -I$(GDAL_HOME)\ogr -I$(GDAL_HOME)\gcore
GEOTIFF_INCLUDE = -I$(GEOTIFF_HOME)\frmts\gtiff\libgeotiff
!ENDIF
INCLUDES = $(INCLUDES) $(GDAL_INCLUDE)
!ELSE
GDAL_HOME=""
!MESSAGE *** Support of GDAL/OGR has been disabled (GDAL_HOME not set)
!ENDIF
###############################################################################
# Distribution directories
LAS_HOME=C:\cvs\liblas\trunk
BINDIR=$(LAS_HOME)\bin
OSGEO4W_DIR = $(LAS_HOME)\osgeo4w
PYDLL_DIR = $(LAS_HOME)\python
###############################################################################
# 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.30729.01"
MSVCVER = 9.0
!ELSEIF "$(_NMAKE_VER)" == "10.00.30128.01"
MSVCVER = 10.0
!ELSEIF "$(_NMAKE_VER)" == "10.00.30319.01"
MSVCVER = 10.0
!ELSEIF "$(_NMAKE_VER)" == "11.00.40825.2"
MSVCVER = 11.0
!ELSEIF "$(_NMAKE_VER)" == "11.00.50727.1"
MSVCVER = 11.0
!ELSEIF "$(_NMAKE_VER)" == "11.00.51106.1"
MSVCVER = 11.0
!ELSEIF "$(_NMAKE_VER)" == "11.00.60315.1"
MSVCVER = 11.0
!ELSEIF "$(_NMAKE_VER)" == "11.00.60430.2"
MSVCVER = 11.0
!ELSEIF "$(_NMAKE_VER)" == "11.00.60521.0"
MSVCVER = 11.0
!ELSEIF "$(_NMAKE_VER)" == "11.00.60610.1"
MSVCVER = 11.0
!ELSEIF "$(_NMAKE_VER)" == "11.00.61030.0"
MSVCVER = 11.0
!ELSEIF "$(_NMAKE_VER)" == "12.00.21005.1"
MSVCVER = 12.0
!ELSEIF "$(_NMAKE_VER)" == "14.00.22816.0"
MSVCVER = 14.0
!ELSEIF "$(_NMAKE_VER)" == "14.00.23026.0"
MSVCVER = 14.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 /Fd$(LAS_ROOT)\las.pdb
LAS_LIB = liblas_d.lib
LAS_DLL = liblas_d1.dll
LAS_LIB_DLL = libl1as_i.lib
!ELSE
# You may need to remove /GR if you are statically linking libLAS
OPTFLAGS=/nologo /MD /EHsc /Ox /GR /W3 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /DNDEBUG
LAS_LIB = liblas.lib
LAS_DLL = liblas1.dll
LAS_LIB_DLL = liblas_i.lib
!ENDIF
# Check if multiple process build available
!IF "$(MSVCVER)" == "9.0"
MPFLAGS=/MP
!MESSAGE *** Using /MP flag with number of effective processors
!ENDIF
CFLAGS= $(MPFLAGS) $(OPTFLAGS) $(INCLUDES)
!IF "$(GEOTIFF_HOME)" != "" && EXIST("$(GEOTIFF_HOME)")
CFLAGS = $(CFLAGS) /DHAVE_LIBGEOTIFF=1
!ENDIF
!IF "$(GDAL_HOME)" != "" && EXIST("$(GDAL_HOME)")
CFLAGS = $(CFLAGS) /DHAVE_GDAL=1
!IF "$(USE_GDAL_SOURCE_TREE)" == "YES"
CFLAGS = $(CFLAGS) /DHAVE_LIBGEOTIFF=1
!ENDIF
!ENDIF
###############################################################################
# Building toolset programs
# Compiler executable
CC = cl.exe
# Linker executable
# - Dynamic-Linked Libraries
# $(LINK) /dll
# - Static Libraries (use of lib.exe wrapper is not portable, see VC++ Toolkit 2003)
# $(LINK) /lib
LINK = link.exe
.c.obj:
$(CC) $(CFLAGS) /c $*.c /Fo$*.obj
.cpp.obj:
$(CC) $(CFLAGS) /c $*.cpp /Fo$*.obj