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.
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
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
27 VRUI_MAKEDIR
:= /usr
/local
/share
/Vrui-4.6
/make
29 VRUI_MAKEDIR
:= $(VRUI_MAKEDIR
)/debug
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.
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
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
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 \
91 ########################################################################
92 # Pseudo-target to print configuration options
93 ########################################################################
98 .PHONY
: 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
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 ########################################################################
127 .PHONY
: 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 \
151 DepthImageRenderer.
cpp \
152 ElevationColorMap.
cpp \
153 SurfaceRenderer.
cpp \
156 ContourLineExtractor.
cpp \
158 GlobalWaterTool.
cpp \
162 BathymetrySaverTool.
cpp \
165 $(EXEDIR
)/SARndbox
: $(SARNDBOX_SOURCES
:%.
cpp=$(OBJDIR
)/%.o
)
167 SARndbox
: $(EXEDIR
)/SARndbox
169 ########################################################################
170 # Specify installation rules
171 ########################################################################
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