Add ContourLineExtractor to Sandbox
[SARndbox.git] / makefile
blobe7bca9a623cf1d446f6b0d64f019a22a3ff472b7
1 ########################################################################
2 # Makefile for the Augmented Reality Sandbox.
3 # Copyright (c) 2012-2018 Oliver Kreylos
5 # This file is part of the WhyTools Build Environment.
6 #
7 # The WhyTools Build Environment is free software; you can redistribute
8 # it and/or modify it under the terms of the GNU General Public License
9 # as published by the Free Software Foundation; either version 2 of the
10 # License, or (at your option) any later version.
12 # The WhyTools Build Environment is distributed in the hope that it will
13 # be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
14 # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with the WhyTools Build Environment; if not, write to the Free
19 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20 # 02111-1307 USA
21 ########################################################################
23 # Directory containing the Vrui build system. The directory below
24 # matches the default Vrui installation; if Vrui's installation
25 # directory was changed during Vrui's installation, the directory below
26 # must be adapted.
27 VRUI_MAKEDIR := /usr/local/share/Vrui-4.6/make
28 ifdef DEBUG
29 VRUI_MAKEDIR := $(VRUI_MAKEDIR)/debug
30 endif
32 # Base installation directory for the Augmented Reality Sandbox. If this
33 # is set to the default of $(PWD), the Augmented Reality Sandbox does
34 # not have to be installed to be run. Created executables and resources
35 # will be installed in the bin and etc directories under the given base
36 # directory, respectively.
37 # Important note: Do not use ~ as an abbreviation for the user's home
38 # directory here; use $(HOME) instead.
39 INSTALLDIR := $(PWD)
41 ########################################################################
42 # Everything below here should not have to be changed
43 ########################################################################
45 # Version number for installation subdirectories. This is used to keep
46 # subsequent release versions of the Augmented Reality Sandbox from
47 # clobbering each other. The value should be identical to the
48 # major.minor version number found in VERSION in the root package
49 # directory.
50 VERSION = 2.6
52 # Set up resource directories: */
53 CONFIGDIR = etc/SARndbox-$(VERSION)
54 RESOURCEDIR = share/SARndbox-$(VERSION)
56 # Include definitions for the system environment and system-provided
57 # packages
58 include $(VRUI_MAKEDIR)/SystemDefinitions
59 include $(VRUI_MAKEDIR)/Packages.System
60 include $(VRUI_MAKEDIR)/Configuration.Vrui
61 include $(VRUI_MAKEDIR)/Packages.Vrui
62 include $(VRUI_MAKEDIR)/Configuration.Kinect
63 include $(VRUI_MAKEDIR)/Packages.Kinect
65 # Set installation directory structure:
66 EXECUTABLEINSTALLDIR = $(INSTALLDIR)/$(EXEDIR)
67 ETCINSTALLDIR = $(INSTALLDIR)/$(CONFIGDIR)
68 SHAREINSTALLDIR = $(INSTALLDIR)/$(RESOURCEDIR)
70 ########################################################################
71 # Specify additional compiler and linker flags
72 ########################################################################
74 ########################################################################
75 # List common packages used by all components of this project
76 # (Supported packages can be found in $(VRUI_MAKEDIR)/Packages.*)
77 ########################################################################
79 PACKAGES = MYKINECT MYVRUI
81 ########################################################################
82 # Specify all final targets
83 ########################################################################
85 ALL = $(EXEDIR)/CalibrateProjector \
86 $(EXEDIR)/SARndbox
88 PHONY: all
89 all: $(ALL)
91 ########################################################################
92 # Pseudo-target to print configuration options
93 ########################################################################
95 .PHONY: config
96 config: Configure-End
98 .PHONY: Configure-Begin
99 Configure-Begin:
100 @cp Config.h Config.h.temp
101 @$(call CONFIG_SETSTRINGVAR,Config.h.temp,CONFIG_CONFIGDIR,$(ETCINSTALLDIR))
102 @$(call CONFIG_SETSTRINGVAR,Config.h.temp,CONFIG_SHADERDIR,$(SHAREINSTALLDIR)/Shaders)
103 @if ! diff Config.h.temp Config.h > /dev/null ; then cp Config.h.temp Config.h ; fi
104 @rm Config.h.temp
106 .PHONY: Configure-Install
107 Configure-Install: Configure-Begin
108 @echo "---- SARndbox installation configuration ----"
109 @echo "Root installation directory: $(INSTALLDIR)"
110 @echo "Configuration data directory: $(ETCINSTALLDIR)"
111 @echo "Resource data directory: $(SHAREINSTALLDIR)"
112 @echo "Shader source code directory: $(SHAREINSTALLDIR)/Shaders"
114 .PHONY: Configure-End
115 Configure-End: Configure-Install
116 @echo "---- End of SARndbox configuration options: ----"
118 $(wildcard *.cpp): config
120 ########################################################################
121 # Specify other actions to be performed on a `make clean'
122 ########################################################################
124 .PHONY: extraclean
125 extraclean:
127 .PHONY: extrasqueakyclean
128 extrasqueakyclean:
130 # Include basic makefile
131 include $(VRUI_MAKEDIR)/BasicMakefile
133 ########################################################################
134 # Specify build rules for executables
135 ########################################################################
138 # Calibration utility for Kinect 3D camera and projector:
141 $(EXEDIR)/CalibrateProjector: $(OBJDIR)/CalibrateProjector.o
142 .PHONY: CalibrateProjector
143 CalibrateProjector: $(EXEDIR)/CalibrateProjector
146 # The Augmented Reality Sandbox:
149 SARNDBOX_SOURCES = FrameFilter.cpp \
150 ShaderHelper.cpp \
151 DepthImageRenderer.cpp \
152 ElevationColorMap.cpp \
153 SurfaceRenderer.cpp \
154 WaterTable2.cpp \
155 WaterRenderer.cpp \
156 ContourLineExtractor.cpp \
157 HandExtractor.cpp \
158 GlobalWaterTool.cpp \
159 LocalWaterTool.cpp \
160 DEM.cpp \
161 DEMTool.cpp \
162 BathymetrySaverTool.cpp \
163 Sandbox.cpp
165 $(EXEDIR)/SARndbox: $(SARNDBOX_SOURCES:%.cpp=$(OBJDIR)/%.o)
166 .PHONY: SARndbox
167 SARndbox: $(EXEDIR)/SARndbox
169 ########################################################################
170 # Specify installation rules
171 ########################################################################
173 install: $(ALL)
174 @echo Installing the Augmented Reality Sandbox in $(INSTALLDIR)...
175 @install -d $(INSTALLDIR)
176 @install -d $(EXECUTABLEINSTALLDIR)
177 @install $(ALL) $(EXECUTABLEINSTALLDIR)
178 @install -d $(ETCINSTALLDIR)
179 @install -m u=rw,go=r $(CONFIGDIR)/* $(ETCINSTALLDIR)
180 @install -d $(SHAREINSTALLDIR)
181 @install -d $(SHAREINSTALLDIR)/Shaders
182 @install -m u=rw,go=r $(RESOURCEDIR)/Shaders/* $(SHAREINSTALLDIR)/Shaders