-
Notifications
You must be signed in to change notification settings - Fork 20
/
makefile
414 lines (347 loc) · 15.8 KB
/
makefile
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
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
########################################################################
# Makefile for 3D Visualizer, a generic visualization program for 3D
# multivariate gridded data.
# Copyright (c) 1999-2017 Oliver Kreylos
#
# This file is part of the WhyTools Build Environment.
#
# The WhyTools Build Environment is free software; you can redistribute
# it and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# The WhyTools Build Environment is distributed in the hope that it will
# be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with the WhyTools Build Environment; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
# 02111-1307 USA
########################################################################
# Directory containing the Vrui build system. The directory below
# matches the default Vrui installation; if Vrui's installation
# directory was changed during Vrui's installation, the directory below
# must be adapted.
VRUI_MAKEDIR := /usr/local/share/Vrui-4.2/make
ifdef DEBUG
VRUI_MAKEDIR := $(VRUI_MAKEDIR)/debug
endif
# Base installation directory for 3D Visualizer and its module
# plug-ins. The module plug-ins cannot be moved from this location
# after installation, or 3D Visualizer will not find them. If this is
# set to the default of $(PWD), 3D Visualizer does not have to be
# installed to be run. 3D Visualizer's executable, plug-ins, and
# resources will be installed in the bin, lib (or lib64), and share
# directories underneath the given base directory, respectively.
# Important note: Do not use ~ as an abbreviation for the user's home
# directory here; use $(HOME) instead.
INSTALLDIR := $(shell pwd)
# Flag whether to use GLSL shaders instead of fixed OpenGL functionality
# for some visualization algorithms, especially volume rendering. This
# flag should only be set to 1 on newer, dedicated 3D graphics cards
# such as Nvidia's G80 series.
USE_SHADERS = 1
# Flag whether to build the 3D Visualizer collaboration module for
# spatially distributed shared data exploration. If the Vrui
# Collaboration Infrastructure is not installed on the host system, this
# flag will be ignored.
USE_COLLABORATION = 1
# List of default visualization modules:
MODULE_NAMES = SphericalASCIIFile \
StructuredGridASCII \
StructuredGridVTK \
CitcomCUCartesianRawFile \
CitcomCUSphericalRawFile \
CitcomSRegionalASCIIFile \
CitcomSGlobalASCIIFile \
CitcomtFile \
MultiCitcomtFile \
CitcomtVectorFile \
StructuredHexahedralTecplotASCIIFile \
UnstructuredHexahedralTecplotASCIIFile \
ImageStack \
DicomImageStack \
MultiChannelImageStack
# List of other available modules:
# Add any of these to the MODULE_NAMES list to build them
UNSUPPORTED_MODULE_NAMES = AnalyzeFile \
AvsUcdAsciiFile \
ByteVolFile \
SCTFile \
GaleFEMVectorFile \
GocadVoxetFile \
ConvectionFile \
ConvectionFileCartesian \
CSConvectionFile \
EarthTomographyGrid \
ReifSeismicTomography \
SeismicTomographyModel \
FloatGridFile \
FloatVolFile \
MultiVolFile \
VecVolFile \
Kollmann0p9File \
MagaliSubductionFile \
MargareteSubductionFile \
VanKekenFile \
UnstructuredPlot3DFile
########################################################################
# Everything below here should not have to be changed
########################################################################
# Define the root of the package source tree
PACKAGEROOT := $(shell pwd)
# Version number for installation subdirectories. This is used to keep
# subsequent release versions of 3D Visualizer from clobbering each
# other. The value should be identical to the major.minor version
# number found in VERSION in the root package directory.
VERSION = 1.15
# Set up resource directories: */
PLUGINSDIREXT = 3DVisualizer-$(VERSION)
RESOURCEDIR = share/3DVisualizer-$(VERSION)
# Include definitions for the system environment and system-provided
# packages
include $(VRUI_MAKEDIR)/SystemDefinitions
include $(VRUI_MAKEDIR)/Packages.System
include $(VRUI_MAKEDIR)/Configuration.Vrui
include $(VRUI_MAKEDIR)/Packages.Vrui
# Check if support for collaboration was requested
ifneq ($(USE_COLLABORATION),0)
include $(VRUI_MAKEDIR)/Configuration.Collaboration
include $(VRUI_MAKEDIR)/Packages.Collaboration
# Check if the collaboration infrastructure is installed
ifndef COLLABORATION_VERSION
USE_COLLABORATION = 0
endif
endif
# Add base directory to include path:
EXTRACINCLUDEFLAGS += -I.
# Set destination directory for plugins:
LIBDESTDIR := $(PACKAGEROOT)/$(MYLIBEXT)
PLUGINDESTDIR := $(LIBDESTDIR)/$(PLUGINSDIREXT)
ifneq ($(USE_COLLABORATION),0)
COLLABORATIONPLUGINDESTDIR := $(LIBDESTDIR)/CollaborationPlugins
# Collaboration plug-ins are installed into Vrui's plug-in
# installation directory, not 3D Visualizer's:
COLLABORATIONPLUGININSTALLDIR := $(PLUGININSTALLDIR)/$(COLLABORATIONPLUGINSDIREXT)
endif
# Set up installation directory structure:
EXECUTABLEINSTALLDIR = $(INSTALLDIR)/$(EXEDIR)
PLUGININSTALLDIR = $(INSTALLDIR)/$(MYLIBEXT)/$(PLUGINSDIREXT)
SHAREINSTALLDIR = $(INSTALLDIR)/$(RESOURCEDIR)
########################################################################
# Specify additional compiler and linker flags
########################################################################
CFLAGS += -Wall -pedantic
MODULENAME = $(PLUGINDESTDIR)/lib$(1).$(PLUGINFILEEXT)
COLLABORATIONPLUGINNAME = $(COLLABORATIONPLUGINDESTDIR)/lib$(1).$(PLUGINFILEEXT)
########################################################################
# List packages used by this project
# (Supported packages can be found in
# $(VRUI_MAKEDIR)/BuildRoot/Packages)
########################################################################
PACKAGES = MYGEOMETRY MYMATH MYCLUSTER MYIO MYTHREADS MYMISC
########################################################################
# Specify all final targets
########################################################################
EXECUTABLES =
MODULES =
COLLABORATIONPLUGINS =
EXECUTABLES += $(EXEDIR)/3DVisualizer
MODULES += $(MODULE_NAMES:%=$(call MODULENAME,%))
ifneq ($(USE_COLLABORATION),0)
EXECUTABLES += $(EXEDIR)/SharedVisualizationServer
COLLABORATIONPLUGIN_NAMES = SharedVisualizationServer
COLLABORATIONPLUGINS = $(COLLABORATIONPLUGIN_NAMES:%=$(call COLLABORATIONPLUGINNAME,%))
endif
ALL = $(EXECUTABLES) $(MODULES) $(COLLABORATIONPLUGINS)
.PHONY: all
all: config $(ALL)
########################################################################
# Pseudo-target to print configuration options
########################################################################
.PHONY: config
config: Configure-End
.PHONY: Configure-Begin
Configure-Begin:
@echo "---- Configured 3D Visualizer options: ----"
@echo "Installation directory: $(INSTALLDIR)"
ifneq ($(USE_SHADERS),0)
@echo "Use of GLSL shaders enabled"
else
@echo "Use of GLSL shaders disabled"
endif
ifneq ($(USE_COLLABORATION),0)
@echo "Collaborative visualization enabled"
@echo " Run 'make plugins-install' to install collaborative visualization server plug-in"
else
@echo "Collaborative visualization disabled"
ifdef COLLABORATION_VERSION
@echo " (Vrui Collaboration Infrastructure installed)"
else
@echo " (Vrui Collaboration Infrastructure not installed)"
endif
endif
@echo "Enabled modules: $(MODULE_NAMES)"
.PHONY: Configure-End
Configure-End: Configure-Begin
Configure-End:
@echo "--------"
$(wildcard *.cpp Abstract/*.cpp Templatized/*.cpp Wrappers/*.cpp Concrete/*.cpp): config
########################################################################
# Specify other actions to be performed on a `make clean'
########################################################################
.PHONY: extraclean
extraclean:
-rm -f $(MODULE_NAMES:%=$(call MODULENAME,%))
ifneq ($(USE_COLLABORATION),0)
-rm -f $(COLLABORATIONPLUGIN_NAMES:%=$(call COLLABORATIONPLUGINNAME,%))
endif
.PHONY: extrasqueakyclean
extrasqueakyclean:
-rm -f $(ALL)
-rm -rf $(PACKAGEROOT)/$(LIBEXT)
# Include basic makefile
include $(VRUI_MAKEDIR)/BasicMakefile
########################################################################
# Specify build rules for executables
########################################################################
ABSTRACT_SOURCES = $(wildcard Abstract/*.cpp)
TEMPLATIZED_SOURCES = $(wildcard Templatized/*.cpp)
WRAPPERS_SOURCES = $(wildcard Wrappers/*.cpp)
CONCRETE_SOURCES = Concrete/SphericalCoordinateTransformer.cpp \
Concrete/EarthRenderer.cpp \
Concrete/PointSet.cpp
VISUALIZER_SOURCES = $(ABSTRACT_SOURCES) \
$(TEMPLATIZED_SOURCES) \
$(WRAPPERS_SOURCES) \
$(CONCRETE_SOURCES) \
GLRenderState.cpp \
BaseLocator.cpp \
CuttingPlaneLocator.cpp \
EvaluationLocator.cpp \
ScalarEvaluationLocator.cpp \
VectorEvaluationLocator.cpp \
Extractor.cpp \
ExtractorLocator.cpp \
ElementList.cpp \
ColorBar.cpp \
ColorMap.cpp \
PaletteEditor.cpp \
Visualizer.cpp
ifneq ($(USE_SHADERS),0)
VISUALIZER_SOURCES += TwoSidedSurfaceShader.cpp \
TwoSided1DTexturedSurfaceShader.cpp \
Polyhedron.cpp \
Raycaster.cpp \
SingleChannelRaycaster.cpp \
TripleChannelRaycaster.cpp
else
VISUALIZER_SOURCES += VolumeRenderer.cpp \
PaletteRenderer.cpp
endif
ifneq ($(USE_COLLABORATION),0)
VISUALIZER_SOURCES += SharedVisualizationProtocol.cpp \
SharedVisualizationClient.cpp
endif
# List of required shaders:
SHADERS = SingleChannelRaycaster.vs \
SingleChannelRaycaster.fs \
TripleChannelRaycaster.vs \
TripleChannelRaycaster.fs
# Per-source compiler flags:
$(OBJDIR)/Concrete/EarthRenderer.o: CFLAGS += -DEARTHRENDERER_IMAGEDIR='"$(SHAREINSTALLDIR)"'
$(OBJDIR)/SingleChannelRaycaster.o: CFLAGS += -DVISUALIZER_SHADERDIR='"$(SHAREINSTALLDIR)/Shaders"'
$(OBJDIR)/TripleChannelRaycaster.o: CFLAGS += -DVISUALIZER_SHADERDIR='"$(SHAREINSTALLDIR)/Shaders"'
$(OBJDIR)/Visualizer.o: CFLAGS += -DVISUALIZER_MODULENAMETEMPLATE='"$(PLUGININSTALLDIR)/lib%s.$(PLUGINFILEEXT)"'
#
# Rule to build 3D Visualizer main program
#
$(EXEDIR)/3DVisualizer: PACKAGES += MYVRUI MYREALTIME
$(EXEDIR)/3DVisualizer: LINKFLAGS += $(PLUGINHOSTLINKFLAGS)
ifneq ($(USE_COLLABORATION),0)
$(EXEDIR)/3DVisualizer: PACKAGES += MYCOLLABORATIONCLIENT
$(EXEDIR)/3DVisualizer: CFLAGS += -DVISUALIZER_USE_COLLABORATION
endif
$(EXEDIR)/3DVisualizer: $(VISUALIZER_SOURCES:%.cpp=$(OBJDIR)/%.o)
.PHONY: 3DVisualizer
3DVisualizer: $(EXEDIR)/3DVisualizer
#
# Rule to build shared Visualizer server
#
SHAREDVISUALIZATIONSERVER_SOURCES = SharedVisualizationProtocol.cpp \
SharedVisualizationServer.cpp \
SharedVisualizationServerMain.cpp
$(EXEDIR)/SharedVisualizationServer: PACKAGES += MYCOLLABORATIONSERVER
$(EXEDIR)/SharedVisualizationServer: $(SHAREDVISUALIZATIONSERVER_SOURCES:%.cpp=$(OBJDIR)/%.o)
.PHONY: SharedVisualizationServer
SharedVisualizationServer:$(EXEDIR)/SharedVisualizationServer
########################################################################
# Specify build rules for plug-ins
########################################################################
# Pattern rule to link visualization module plug-ins:
$(call MODULENAME,%): PACKAGES += MYGLGEOMETRY MYGLSUPPORT MYGLWRAPPERS GL
ifneq ($(USE_SHADERS),0)
$(call MODULENAME,%): CFLAGS += -DVISUALIZATION_USE_SHADERS
endif
$(call MODULENAME,%): $(OBJDIR)/pic/Concrete/%.o
@mkdir -p $(PLUGINDESTDIR)
ifdef SHOWCOMMAND
$(CCOMP) $(PLUGINLINKFLAGS) -o $@ $(filter %.o,$^) $(LINKDIRFLAGS) $(LINKLIBFLAGS)
else
@echo Linking $@...
@$(CCOMP) $(PLUGINLINKFLAGS) -o $@ $(filter %.o,$^) $(LINKDIRFLAGS) $(LINKLIBFLAGS)
endif
# Dependencies and special flags for visualization modules:
$(call MODULENAME,CitcomSRegionalASCIIFile): $(OBJDIR)/pic/Concrete/CitcomSRegionalASCIIFile.o \
$(OBJDIR)/pic/Concrete/CitcomSCfgFileParser.o
$(call MODULENAME,CitcomSGlobalASCIIFile): $(OBJDIR)/pic/Concrete/CitcomSGlobalASCIIFile.o \
$(OBJDIR)/pic/Concrete/CitcomSCfgFileParser.o
$(call MODULENAME,StructuredHexahedralTecplotASCIIFile): $(OBJDIR)/pic/Concrete/TecplotASCIIFileHeaderParser.o \
$(OBJDIR)/pic/Concrete/StructuredHexahedralTecplotASCIIFile.o
$(call MODULENAME,UnstructuredHexahedralTecplotASCIIFile): $(OBJDIR)/pic/Concrete/TecplotASCIIFileHeaderParser.o \
$(OBJDIR)/pic/Concrete/UnstructuredHexahedralTecplotASCIIFile.o
$(call MODULENAME,MultiChannelImageStack): PACKAGES += MYIMAGES
$(call MODULENAME,DicomImageStack): $(OBJDIR)/pic/Concrete/HuffmanTable.o \
$(OBJDIR)/pic/Concrete/JPEGDecompressor.o \
$(OBJDIR)/pic/Concrete/DicomFile.o \
$(OBJDIR)/pic/Concrete/DicomImageStack.o
# Keep module object files around after building:
.SECONDARY: $(MODULE_NAMES:%=$(OBJDIR)/pic/Concrete/%.o)
# Pattern rule to link collaboration protocol plug-ins:
$(call COLLABORATIONPLUGINNAME,%): PACKAGES += MYCOLLABORATIONSERVER
$(call COLLABORATIONPLUGINNAME,%): $(OBJDIR)/pic/%.o
@mkdir -p $(COLLABORATIONPLUGINDESTDIR)
ifdef SHOWCOMMAND
$(CCOMP) $(PLUGINLINKFLAGS) -o $@ $(filter %.o,$^) $(LINKDIRFLAGS) $(LINKLIBFLAGS)
else
@echo Linking $@...
@$(CCOMP) $(PLUGINLINKFLAGS) -o $@ $(filter %.o,$^) $(LINKDIRFLAGS) $(LINKLIBFLAGS)
endif
$(call COLLABORATIONPLUGINNAME,SharedVisualizationServer): $(OBJDIR)/pic/SharedVisualizationProtocol.o \
$(OBJDIR)/pic/SharedVisualizationServer.o
# Keep collaboration plugin object files around after building:
.SECONDARY: $(COLLABORATIONPLUGIN_NAMES:%=$(OBJDIR)/pic/%.o)
#
# Rule to install 3D Visualizer in a destination directory
#
install: $(ALL)
@echo Installing 3D Visualizer in $(INSTALLDIR)...
@install -d $(INSTALLDIR)
@install -d $(EXECUTABLEINSTALLDIR)
@install $(EXECUTABLES) $(EXECUTABLEINSTALLDIR)
@install -d $(PLUGININSTALLDIR)
@install $(MODULES) $(PLUGININSTALLDIR)
@install -d $(SHAREINSTALLDIR)
@install $(RESOURCEDIR)/EarthTopography.png $(RESOURCEDIR)/EarthTopography.ppm $(SHAREINSTALLDIR)
ifneq ($(USE_SHADERS),0)
@install -d $(SHAREINSTALLDIR)/Shaders
@install $(SHADERS:%=$(RESOURCEDIR)/Shaders/%) $(SHAREINSTALLDIR)/Shaders
endif
#
# Rule to install 3D Visualizer's collaboration server plug-in
#
plugins-install: $(COLLABORATIONPLUGINS)
@echo Installing 3D Visualizer collaboration server plugin in $(COLLABORATIONPLUGININSTALLDIR)
@install $(COLLABORATIONPLUGINS) $(COLLABORATIONPLUGININSTALLDIR)