-
Notifications
You must be signed in to change notification settings - Fork 25
/
Makefile.vc.def
370 lines (302 loc) · 11.8 KB
/
Makefile.vc.def
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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
#*****************************************************************************
# $Id: Makefile.vc.def 1728 2014-04-25 09:11:19Z naohisa.sakamoto@gmail.com $
#*****************************************************************************
#=============================================================================
# KVS_DIR.
#=============================================================================
!IFNDEF KVS_DIR
!ERROR KVS_DIR is not defined.
!ENDIF
#=============================================================================
# Suffix rule.
#=============================================================================
.SUFFIXES:
.SUFFIXES: .obj .cpp .h
#=============================================================================
# Command macro.
#=============================================================================
MAKE = nmake /nologo
CPP = cl /nologo
MPICPP = mpicxx /nologo
LD = link /nologo
AR = lib /nologo
QMAKE = qmake
MKDIR = mkdir
RM = del /s
RMDIR = rmdir /q /s
INSTALL = xcopy /f /y
INSTALL_EXE = xcopy /f /y
#=============================================================================
# all command.
#=============================================================================
all: build
#=============================================================================
# rebuild command..
#=============================================================================
rebuild: clean build
#=============================================================================
# Makefile.
#=============================================================================
MAKEFILE = Makefile.vc
#=============================================================================
# KVS library.
#=============================================================================
LIB_KVS_CORE = kvsCore.lib
LIB_KVS_SUPPORT_CUDA = libkvsSupportCUDA.lib
LIB_KVS_SUPPORT_GLUT = kvsSupportGLUT.lib
LIB_KVS_SUPPORT_GLFW = kvsSupportGLFW.lib
LIB_KVS_SUPPORT_FFMPEG = kvsSupportFFmpeg.lib
LIB_KVS_SUPPORT_QT = kvsSupportQt.lib
LIB_KVS_SUPPORT_OPENCV = kvsSupportOpenCV.lib
LIB_KVS_SUPPORT_PYTHON = kvsSupportPython.lib
LIB_KVS_SUPPORT_MPI = kvsSupportMPI.lib
LIB_KVS_SUPPORT_EGL = kvsSupportEGL.lib
LIB_KVS_SUPPORT_OSMESA = kvsSupportOSMesa.lib
#=============================================================================
# Solution.
#=============================================================================
!IFDEF DEBUG
SOLUTION = Debug
!ELSE
SOLUTION = Release
!ENDIF
#=============================================================================
# Output directory.
#=============================================================================
OUTDIR = $(SOLUTION)
#=============================================================================
# GL_INCLUDE_PATH, GL_LIBRARY_PATH, GL_LINK_LIBRARY
#=============================================================================
GL_INCLUDE_PATH =
GL_LIBRARY_PATH =
GL_LINK_LIBRARY =
!IF "$(KVS_ENABLE_OPENGL)" == "1"
GL_LINK_LIBRARY = $(GL_LINK_LIBRARY) opengl32.lib
!IF "$(KVS_ENABLE_GLU)" == "1"
GL_LINK_LIBRARY = $(GL_LINK_LIBRARY) glu32.lib
!ENDIF
!ENDIF
#=============================================================================
# GLEW_INCLUDE_PATH, GLEW_LIBRARY_PATH, GLEW_LINK_LIBRARY
#=============================================================================
GLEW_INCLUDE_PATH =
GLEW_LIBRARY_PATH =
GLEW_LINK_LIBRARY =
!IF "$(KVS_ENABLE_OPENGL)" == "1"
!IF "$(KVS_ENABLE_GLEW)" == "1"
GLEW_LINK_LIBRARY = glew32.lib
!IFDEF KVS_GLEW_DIR
GLEW_INCLUDE_PATH = $(GLEW_INCLUDE_PATH) /I"$(KVS_GLEW_DIR)\include"
GLEW_LIBRARY_PATH = $(GLEW_LIBRARY_PATH) /LIBPATH:"$(KVS_GLEW_DIR)\lib"
!ENDIF
!ENDIF
!ENDIF
#=============================================================================
# GLUT_INCLUDE_PATH, GLUT_LIBRARY_PATH, GLUT_LINK_LIBRARY
#=============================================================================
!IF "$(KVS_SUPPORT_GLUT)" == "1"
GLUT_INCLUDE_PATH =
GLUT_LIBRARY_PATH =
GLUT_LINK_LIBRARY = freeglut.lib
!IFDEF KVS_GLUT_DIR
GLUT_INCLUDE_PATH = $(GLUT_INCLUDE_PATH) /I"$(KVS_GLUT_DIR)\include"
GLUT_LIBRARY_PATH = $(GLUT_LIBRARY_PATH) /LIBPATH:"$(KVS_GLUT_DIR)\lib"
!ENDIF
!ENDIF
#=============================================================================
# GLFW_INCLUDE_PATH, GLFW_LIBRARY_PATH, GLFW_LINK_LIBRARY
#=============================================================================
!IF "$(KVS_SUPPORT_GLFW)" == "1"
GLFW_INCLUDE_PATH =
GLFW_LIBRARY_PATH =
GLFW_LINK_LIBRARY = glfw3.lib
!IFDEF KVS_GLFW_DIR
GLFW_INCLUDE_PATH = $(GLFW_INCLUDE_PATH) /I"$(KVS_GLFW_DIR)\include"
GLFW_LIBRARY_PATH = $(GLFW_LIBRARY_PATH) /LIBPATH:"$(KVS_GLFW_DIR)\lib"
!ENDIF
!ENDIF
#=============================================================================
# FFMPEG_INCLUDE_PATH, FFMPEG_LIBRARY_PATH, FFMPEG_LINK_LIBRARY
#=============================================================================
!IF "$(KVS_SUPPORT_FFMPEG)" == "1"
FFMPEG_INCLUDE_PATH =
FFMPEG_LIBRARY_PATH =
FFMPEG_LINK_LIBRARY = avcodec.lib avformat.lib avutil.lib avdevice.lib avfilter.lib swscale.lib
!IFDEF KVS_FFMPEG_DIR
FFMPEG_INCLUDE_PATH = $(FFMPEG_INCLUDE_PATH) /I"$(KVS_FFMPEG_DIR)\include"
FFMPEG_LIBRARY_PATH = $(FFMPEG_LIBRARY_PATH) /LIBPATH:"$(KVS_FFMPEG_DIR)\lib"
!ENDIF
!ENDIF
#=============================================================================
# CUDA_INCLUDE_PATH, CUDA_LIBRARY_PATH, CUDA_LINK_LIBRARY
#=============================================================================
!IF "$(KVS_SUPPORT_CUDA)" == "1"
CUDA_INCLUDE_PATH =
CUDA_LIBRARY_PATH =
CUDA_LINK_LIBRARY = cuda.lib cudart.lib
!IFDEF KVS_CUDA_DIR
CUDA_INCLUDE_PATH = $(CUDA_INCLUDE_PATH) /I"$(KVS_CUDA_DIR)\include"
CUDA_LIBRARY_PATH = $(CUDA_LIBRARY_PATH) /LIBPATH:"$(KVS_CUDA_DIR)\lib\win32"
!ENDIF
!IFDEF KVS_CUDA_SDK_DIR
CUDA_INCLUDE_PATH = $(CUDA_INCLUDE_PATH) /I"$(KVS_CUDA_SDK_DIR)\common\inc"
CUDA_LIBRARY_PATH = $(CUDA_LIBRARY_PATH) /LIBPATH:"$(KVS_CUDA_SDK_DIR)\lib\win32"
#CUDA_LINK_LIBRARY = cutil.lib
CUDA_LINK_LIBRARY = $(CUDA_LINK_LIBRARY)
!ENDIF
NVCC = nvcc
NVCCFLAGS = --host-compilation C++
!ENDIF
#=============================================================================
# OPENCV_INCLUDE_PATH, OPENCV_LIBRARY_PATH, OPENCV_LINK_LIBRARY
#=============================================================================
!IF "$(KVS_SUPPORT_OPENCV)" == "1"
OPENCV_INCLUDE_PATH = /I"C:\Program Files\OpenCV\cv\include"
OPENCV_INCLUDE_PATH = $(OPENCV_INCLUDE_PATH) /I"C:\Program Files\OpenCV\cvaux\include"
OPENCV_INCLUDE_PATH = $(OPENCV_INCLUDE_PATH) /I"C:\Program Files\OpenCV\cxcore\include"
OPENCV_INCLUDE_PATH = $(OPENCV_INCLUDE_PATH) /I"C:\Program Files\OpenCV\otherlibs\highgui"
OPENCV_LIBRARY_PATH = /LIBPATH:"C:\Program Files\OpenCV\lib"
OPENCV_LINK_LIBRARY = cv.lib cxcore.lib cvaux.lib highgui.lib cvcam.lib
!IFDEF KVS_OPENCV_DIR
OPENCV_INCLUDE_PATH = $(OPENCV_INCLUDE_PATH) /I"$(KVS_OPENCV_DIR)\cv\include"
OPENCV_INCLUDE_PATH = $(OPENCV_INCLUDE_PATH) /I"$(KVS_OPENCV_DIR)\cvaux\include"
OPENCV_INCLUDE_PATH = $(OPENCV_INCLUDE_PATH) /I"$(KVS_OPENCV_DIR)\cxcore\include"
OPENCV_INCLUDE_PATH = $(OPENCV_INCLUDE_PATH) /I"$(KVS_OPENCV_DIR)\otherlibs\hightgui"
OPENCV_LIBRARY_PATH = $(OPENCV_LIBRARY_PATH) /LIBPATH:"$(KVS_OPENCV_DIR)\lib"
!ENDIF
!ENDIF
#=============================================================================
# PYTHON_INCLUDE_PATH, PYTHON_LIBRARY_PATH, PYTHON_LINK_LIBRARY
# NUMPY_INCLUDE_PATH, NUMPY_LIBRARY_PATH, NUMPY_LINK_LIBRARY
#=============================================================================
!IF "$(KVS_SUPPORT_PYTHON)" == "1"
PYTHON_INCLUDE_PATH =
PYTHON_LIBRARY_PATH =
PYTHON_LINK_LIBRARY =
!IFDEF KVS_PYTHON_DIR
PYTHON_INCLUDE_PATH = $(PYTHON_INCLUDE_PATH) /I"$(KVS_PYTHON_DIR)\include"
PYTHON_LIBRARY_PATH = $(PYTHON_LIBRARY_PATH) /LIBPATH:"$(KVS_PYTHON_DIR)\libs"
!ENDIF
!IFDEF KVS_PYTHON_LINK_LIBRARY
PYTHON_LINK_LIBRARY = $(KVS_PYTHON_LINK_LIBRARY)
!ENDIF
NUMPY_INCLUDE_PATH =
NUMPY_LIBRARY_PATH =
NUMPY_LINK_LIBRARY =
!IFDEF KVS_NUMPY_DIR
NUMPY_INCLUDE_PATH = $(NUMPY_INCLUDE_PATH) /I"$(KVS_NUMPY_DIR)\include"
NUMPY_LIBRARY_PATH = $(NUMPY_LIBRARY_PATH) /LIBPATH:"$(KVS_NUMPY_DIR)\lib"
!ENDIF
!IFDEF KVS_NUMPY_LINK_LIBRARY
NUMPY_LINK_LIBRARY = $(KVS_NUMPY_LINK_LIBRARY)
!ENDIF
!ENDIF
#=============================================================================
# MPI_INCLUDE_PATH, MPI_LIBRARY_PATH, MPI_LINK_LIBRARY
#=============================================================================
!IF "$(KVS_SUPPORT_MPI)" == "1"
MPI_INCLUDE_PATH =
MPI_LIBRARY_PATH =
MPI_LINK_LIBRARY =
!IFDEF KVS_MPI_DIR
MPI_INCLUDE_PATH = $(MPI_INCLUDE_PATH) /I"$(KVS_MPI_DIR)\include"
MPI_LIBRARY_PATH = $(MPI_LIBRARY_PATH) /LIBPATH:"$(KVS_MPI_DIR)\lib"
!ENDIF
!ENDIF
#=============================================================================
# EGL_INCLUDE_PATH, EGL_LIBRARY_PATH, EGL_LINK_LIBRARY
#=============================================================================
!IF "$(KVS_SUPPORT_EGL)" == "1"
EGL_INCLUDE_PATH =
EGL_LIBRARY_PATH =
EGL_LINK_LIBRARY =
!IFDEF KVS_EGL_DIR
EGL_INCLUDE_PATH = $(EGL_INCLUDE_PATH) /I"$(KVS_EGL_DIR)\include"
EGL_LIBRARY_PATH = $(EGL_LIBRARY_PATH) /LIBPATH:"$(KVS_EGL_DIR)\lib"
!ENDIF
!ENDIF
#=============================================================================
# Compiler option.
#=============================================================================
CPPFLAGS = /W3 /EHsc /GR
!IFDEF DEBUG
CPPFLAGS = $(CPPFLAGS) /Od /MTd
!ELSE
CPPFLAGS = $(CPPFLAGS) /Ox /MT
!ENDIF
# OpenMP
!IF "$(KVS_ENABLE_OPENMP)" == "1"
CPPFLAGS = $(CPPFLAGS) /openmp
!ENDIF
#=============================================================================
# Definition.
#=============================================================================
DEFINITIONS = /DWIN32 /D_MBCS /DNOMINMAX /D_SCL_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE
!IFDEF DEBUG
DEFINITIONS = $(DEFINITIONS) /D_DEBUG /DKVS_ENABLE_DEBUG
!ELSE
DEFINITIONS = $(DEFINITIONS) /DNDEBUG
!ENDIF
!IFDEF MEM_DEBUG
DEFINITIONS = $(DEFINITIONS) /DKVS_ENABLE_MEM_DEBUG
!ENDIF
!IF "$(KVS_ENABLE_OPENGL)" == "1"
DEFINITIONS = $(DEFINITIONS) /DKVS_ENABLE_OPENGL
!ENDIF
!IF "$(KVS_ENABLE_GLU)" == "1"
DEFINITIONS = $(DEFINITIONS) /DKVS_ENABLE_GLU
!ENDIF
!IF "$(KVS_ENABLE_GLEW)" == "1"
DEFINITIONS = $(DEFINITIONS) /DKVS_ENABLE_GLEW
!ENDIF
!IF "$(KVS_ENABLE_OPENMP)" == "1"
DEFINITIONS = $(DEFINITIONS) /DKVS_ENABLE_OPENMP
!ENDIF
!IF "$(KVS_ENABLE_DEPRECATED)" == "1"
DEFINITIONS = $(DEFINITIONS) /DKVS_ENABLE_DEPRECATED
!ENDIF
# NOTE: The GLEW header files must be included before including the OpenGL
# header files. Therefore 'GLEW_INCLUDE_PATH' adds to 'DEFINITIONS' here.
DEFINITIONS = $(DEFINITIONS) $(GLEW_INCLUDE_PATH)
!IF "$(KVS_ENABLE_OPENGL)" == "1"
!IF "$(KVS_SUPPORT_GLUT)" == "1"
DEFINITIONS = $(DEFINITIONS) /DKVS_SUPPORT_GLUT
!ENDIF
!IF "$(KVS_SUPPORT_GLFW)" == "1"
DEFINITIONS = $(DEFINITIONS) /DKVS_SUPPORT_GLFW
!ENDIF
!ENDIF
!IF "$(KVS_SUPPORT_FFMPEG)" == "1"
DEFINITIONS = $(DEFINITIONS) /DKVS_SUPPORT_FFMPEG
!ENDIF
!IF "$(KVS_SUPPORT_QT)" == "1"
DEFINITIONS = $(DEFINITIONS) /DKVS_SUPPORT_QT
!ENDIF
!IF "$(KVS_SUPPORT_OPENCV)" == "1"
DEFINITIONS = $(DEFINITIONS) /DKVS_SUPPORT_OPENCV
!ENDIF
!IF "$(KVS_SUPPORT_CUDA)" == "1"
DEFINITIONS = $(DEFINITIONS) /DKVS_SUPPORT_CUDA
!ENDIF
!IF "$(KVS_SUPPORT_PYTHON)" == "1"
DEFINITIONS = $(DEFINITIONS) /DKVS_SUPPORT_PYTHON
!ENDIF
!IF "$(KVS_SUPPORT_MPI)" == "1"
DEFINITIONS = $(DEFINITIONS) /DKVS_SUPPORT_MPI
!ENDIF
!IF "$(KVS_SUPPORT_EGL)" == "1"
DEFINITIONS = $(DEFINITIONS) /DKVS_SUPPORT_EGL
!ENDIF
!IF "$(KVS_SUPPORT_OSMESA)" == "1"
DEFINITIONS = $(DEFINITIONS) /DKVS_SUPPORT_OSMESA
!ENDIF
#=============================================================================
# Linker option.
#=============================================================================
LDFLAGS = /MANIFEST
!IFDEF DEBUG
LDFLAGS = $(LDFLAGS) /DEBUG
!ENDIF
!IFDEF NOCONSOLE
LDFLAGS = /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup /MANIFEST
!ENDIF