forked from structureio/OpenNI2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
210 lines (156 loc) · 5.35 KB
/
Copy pathMakefile
File metadata and controls
210 lines (156 loc) · 5.35 KB
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
# OpenNI 2 Makefile
#
# Default configuration is Release. for a debug version use:
# make CFG=Debug
#
# Default compiler is g++. for another one use:
# make CXX=<comp>
#
# Java-dependent build rules are disabled by default. To enable them, use:
# make HAS_JAVA=1
#-------------------------------------------------------------------------------
include ThirdParty/PSCommon/BuildSystem/CommonDefs.mak
#-------------------------------------------------------------------------------
# HAS_JAVA=0 # Uncomment this to force the value.
MAJOR_VERSION = $(shell grep "define ONI_VERSION_MAJOR" Include/OniVersion.h | cut -f 2)
MINOR_VERSION = $(shell grep "define ONI_VERSION_MINOR" Include/OniVersion.h | cut -f 2)
MAINT_VERSION = $(shell grep "define ONI_VERSION_MAINT" Include/OniVersion.h | cut -f 2)
ifeq ("$(OSTYPE)","Darwin")
OS_NAME = MacOSX
else
OS_NAME = Linux
endif
PRODUCT_STRING = OpenNI-$(OS_NAME)-$(PLATFORM)-$(shell cd Packaging && python2 -c "import UpdateVersion; print UpdateVersion.getVersionName()" && cd ..)
FINAL_DIR = Packaging/Final
CORE = Source/Core
XNLIB = ThirdParty/PSCommon/XnLib/Source
DEPTH_UTILS = Source/DepthUtils
#-------------------------------------------------------------------------------
# C++
CXX_MAIN_SUBDIRS = \
$(CORE) \
ThirdParty/PSCommon/XnLib/Source \
Source/DepthUtils \
Source/Drivers/DummyDevice \
Source/Drivers/PS1080 \
Source/Drivers/PSLink \
Source/Drivers/OniFile \
Source/Drivers/PS1080/PS1080Console \
Source/Drivers/PSLink/PSLinkConsole
CXX_SAMPLES_SUBDIRS = \
Samples/SimpleRead \
Samples/EventBasedRead \
Samples/MultipleStreamRead \
Samples/MWClosestPoint \
Samples/MWClosestPointApp
#-------------------------------------------------------------------------------
# Java
JAVA_MAIN_SUBDIRS = \
Wrappers/java \
Wrappers/java/jni
JAVA_SAMPLES_SUBDIRS = \
Samples/SimpleViewer.java
#-------------------------------------------------------------------------------
# GLUT
ifeq "$(GLUT_SUPPORTED)" "1"
CXX_MAIN_SUBDIRS += \
Source/Tools/NiViewer
CXX_SAMPLES_SUBDIRS += \
Samples/SimpleViewer \
Samples/MultiDepthViewer \
Samples/ClosestPointViewer
endif
#-------------------------------------------------------------------------------
# Target groups
ALL_CXX_SUBDIRS = \
$(CXX_MAIN_SUBDIRS) \
$(CXX_SAMPLES_SUBDIRS) \
ALL_JAVA_SUBDIRS = \
$(JAVA_MAIN_SUBDIRS) \
$(JAVA_SAMPLES_SUBDIRS)
ALL_MAIN_SUBDIRS = \
$(CXX_MAIN_SUBDIRS) \
$(JAVA_MAIN_SUBDIRS)
ALL_SAMPLES_SUBDIRS = \
$(CXX_SAMPLES_SUBDIRS) \
$(JAVA_SAMPLES_SUBDIRS)
ALL_SUBDIRS = \
$(ALL_MAIN_SUBDIRS) \
$(ALL_SAMPLES_SUBDIRS)
# Add an unconditional shorthand for java targets
java: $(ALL_JAVA_SUBDIRS)
.PHONY: java
#-------------------------------------------------------------------------------
# Recursive make machinery
# Compute the list of cleaning targets.
CLEAN_SUBDIRS = $(foreach target,$(ALL_SUBDIRS),$(target)-clean)
# Define a function for creating per-subdirectory target rules.
define CREATE_SUBDIR
$1:
$$(MAKE) -C $1
$1-clean:
$$(MAKE) -C $1 clean
endef
# Create all per-subdirectory targets.
$(foreach target,$(ALL_SUBDIRS),$(eval $(call CREATE_SUBDIR,$(target))))
# Declare all per-subdirectory rules as phony, so that they're always built.
# See: http://www.gnu.org/software/make/manual/make.html#Recursion
.PHONY: \
$(ALL_SUBDIRS) \
$(CLEAN_SUBDIRS)
# Set 'all' as the default target, since it is not the first target defined in this Makefile.
.DEFAULT_GOAL = all
#-------------------------------------------------------------------------------
# Additional rules
$(FINAL_DIR):
mkdir -p $(FINAL_DIR)
#-------------------------------------------------------------------------------
# Target dependencies
$(CORE): $(XNLIB)
Wrappers/java: Wrappers/java/jni
Wrappers/java/jni: $(CORE)
Source/Drivers/DummyDevice: $(CORE)
Source/Drivers/RawDevice: $(CORE)
Source/Drivers/PS1080: $(CORE) $(DEPTH_UTILS)
Source/Drivers/PS1080/PS1080Console: $(CORE)
Source/Drivers/PSLink: $(CORE)
Source/Drivers/PSLink/PSLinkConsole: $(CORE)
Source/Drivers/OniFile: $(CORE)
Source/Tools/NiViewer: $(CORE)
Samples/SimpleRead: $(CORE)
Samples/EventBasedRead: $(CORE)
Samples/MultipleStreamRead: $(CORE)
Samples/MWClosestPoint: $(CORE)
Samples/SimpleViewer: $(CORE)
Samples/MultiDepthViewer: $(CORE)
Samples/MWClosestPointApp: $(CORE) Samples/MWClosestPoint
Samples/ClosestPointViewer: $(CORE) Samples/MWClosestPoint
Samples/SimpleViewer.java: Wrappers/java
#-------------------------------------------------------------------------------
# Top-level targets
MAIN_SUBDIRS = \
$(CXX_MAIN_SUBDIRS)
SAMPLES_SUBDIRS = \
$(CXX_SAMPLES_SUBDIRS)
# Add java targets to the default build, depending on the HAS_JAVA variable.
ifeq ($(HAS_JAVA), 1)
MAIN_SUBDIRS += $(JAVA_MAIN_SUBDIRS)
SAMPLES_SUBDIRS += $(JAVA_SAMPLES_SUBDIRS)
endif
all: main samples
main: $(MAIN_SUBDIRS)
samples: $(SAMPLES_SUBDIRS)
doc:
Source/Documentation/Runme.py
rm -f Source/Documentation/html/*.md5
release: | all doc $(FINAL_DIR)
Packaging/Harvest.py Packaging/$(PRODUCT_STRING) $(PLATFORM)
cd Packaging; tar -cjf Final/$(PRODUCT_STRING).tar.bz2 $(PRODUCT_STRING)
clean: $(CLEAN_SUBDIRS)
.PHONY: \
all \
doc \
main \
samples \
release \
clean