-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.openni
204 lines (160 loc) · 4.29 KB
/
Makefile.openni
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
#############################################################################
# OpenNI makefile.
#
# default configuration is Release. for a debug version use:
# make CFG=Debug
#
# default compiler is g++. for another one use:
# make CXX=<comp>
#
# By default, CLR projects will only be build if mono is installed.
# To force CLR projects use:
# make FORCE_BUILD_CLR=1
#
#############################################################################
include Common/CommonDefs.mak
# list all modules
ALL_MODULES = \
Modules/nimCodecs \
Modules/nimMockNodes \
Modules/nimRecorder
# list all utils
ALL_UTILS = \
Utils/niReg \
Utils/niLicense
ALL_MONO_PROJS = \
Wrappers/OpenNI.net
ALL_JAVA_PROJS = \
Wrappers/OpenNI.jni \
Wrappers/OpenNI.java
# list all core projects
ALL_CORE_PROJS = \
OpenNI \
$(ALL_MODULES) \
$(ALL_UTILS) \
$(ALL_JAVA_PROJS)
# list all samples
CORE_SAMPLES = \
Samples/NiSimpleRead \
Samples/NiBackRecorder \
Samples/NiConvertXToONI \
Samples/NiRecordSynthetic \
Samples/NiSampleModule \
Samples/NiSimpleCreate \
Samples/NiCRead \
Samples/NiAudioSample \
Samples/NiSimpleSkeleton \
Samples/NiSkeletonBenchmark
ifeq "$(GLUT_SUPPORTED)" "1"
CORE_SAMPLES += \
# Samples/NiViewer \
Samples/NiSimpleViewer \
Samples/NiUserTracker \
Samples/NiUserSelection \
Samples/NiHandTracker
else
ifeq "$(GLES_SUPPORTED)" "1"
CORE_SAMPLES += \
Samples/NiUserTracker \
Samples/NiUserSelection
endif
endif
MONO_SAMPLES = \
Samples/SimpleRead.net
MONO_FORMS_SAMPLES = \
Samples/SimpleViewer.net \
Samples/UserTracker.net
JAVA_SAMPLES = \
Samples/SimpleRead.java \
Samples/SimpleViewer.java \
Samples/UserTracker.java \
ALL_SAMPLES = \
$(CORE_SAMPLES) \
$(JAVA_SAMPLES)
# list all projects that are build
ALL_BUILD_PROJS = \
$(ALL_CORE_PROJS) \
$(ALL_SAMPLES)
ALL_PROJS = \
$(ALL_BUILD_PROJS)
# decide if CLR projects should be build
ifneq "$(realpath /usr/bin/gmcs)" ""
MONO_INSTALLED = 1
ifneq "$(shell gacutil -l | grep System.Windows.Forms)" ""
MONO_WINFORMS_INSTALLED = 1
endif
endif
ifeq "$(FORCE_BUILD_CLR)" "1"
ifndef MONO_INSTALLED
DUMMY:=$(error Mono is not installed! Consider turning off FORCE_BUILD_CLR.)
endif
ifndef MONO_WINFORMS_INSTALLED
DUMMY:=$(error Mono WinForms is not installed! Consider turning off FORCE_BUILD_CLR.)
endif
endif
ifdef MONO_INSTALLED
ALL_PROJS += $(ALL_MONO_PROJS)
ALL_PROJS += $(MONO_SAMPLES)
ifdef MONO_WINFORMS_INSTALLED
ALL_PROJS += $(MONO_FORMS_SAMPLES)
endif
endif
ALL_PROJS_CLEAN = $(foreach proj,$(ALL_PROJS),$(proj)-clean)
# define a function which creates a target for each proj
define CREATE_PROJ_TARGET
$1:
$$(MAKE) -C $1
$1-clean:
$$(MAKE) -C $1 clean
endef
################ TARGETS ##################
.PHONY: all $(ALL_PROJS) $(ALL_PROJS_CLEAN) install uninstall clean
# make all makefiles
all: $(ALL_PROJS)
core: $(ALL_CORE_PROJS)
samples: $(ALL_SAMPLES)
mono_wrapper: Wrappers/OpenNI.net
mono_samples: $(MONO_SAMPLES) $(MONO_FORMS_SAMPLES)
# create projects targets
$(foreach proj,$(ALL_PROJS),$(eval $(call CREATE_PROJ_TARGET,$(proj))))
# additional dependencies
Modules/nimCodecs: OpenNI
Modules/nimMockNodes: OpenNI
Modules/nimRecorder: OpenNI
Utils/niReg: OpenNI
Utils/niLicense: OpenNI
Wrappers/OpenNI.net: OpenNI
Wrappers/OpenNI.jni: OpenNI
Wrappers/OpenNI.java: Wrappers/OpenNI.jni
Samples/NiSimpleRead: OpenNI
Samples/NiBackRecorder: OpenNI
Samples/NiConvertXToONI: OpenNI
Samples/NiRecordSynthetic: OpenNI
Samples/NiSampleModule: OpenNI
Samples/NiSimpleCreate: OpenNI
Samples/NiCRead: OpenNI
Samples/NiAudioSample: OpenNI
Samples/NiSimpleSkeleton: OpenNI
Samples/NiSkeletonBenchmark: OpenNI
Samples/NiUserTracker: OpenNI
Samples/NiUserSelection: OpenNI
Samples/NiHandTracker: OpenNI
Samples/NiViewer: OpenNI
Samples/NiSimpleViewer: OpenNI
Samples/SimpleRead.net: Wrappers/OpenNI.net
Samples/SimpleViewer.net: Wrappers/OpenNI.net
Samples/UserTracker.net: Wrappers/OpenNI.net
Samples/SimpleRead.java: Wrappers/OpenNI.java
Samples/SimpleViewer.java: Wrappers/OpenNI.java
Samples/UserTracker.java: Wrappers/OpenNI.java
# clean is cleaning all projects
clean: $(ALL_PROJS_CLEAN)
# redist target
redist: all
cd ../CreateRedist; ./RedistMaker; cd -
# install target
install: redist
cd ../Redist; ./install.sh; cd -
# uninstall target
uninstall:
cd ../Redist; ./install.sh -u; cd -