forked from OpenNI/OpenNI2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
160 lines (127 loc) · 3.99 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
#############################################################################
# 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 ThirdParty/PSCommon/BuildSystem/CommonDefs.mak
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 && python -c "import UpdateVersion; print UpdateVersion.getVersionName()" && cd ..)
FINAL_DIR = Packaging/Final
OPENNI = Source/Core
XNLIB = ThirdParty/PSCommon/XnLib/Source
DEPTH_UTILS = Source/DepthUtils
# list all drivers
ALL_DRIVERS = \
Source/Drivers/DummyDevice \
Source/Drivers/PS1080 \
Source/Drivers/PSLink \
Source/Drivers/OniFile
# list all wrappers
ALL_WRAPPERS = \
Wrappers/java/OpenNI.jni \
Wrappers/java/OpenNI.java
# list all tools
ALL_TOOLS = \
Source/Drivers/PS1080/PS1080Console \
Source/Drivers/PSLink/PSLinkConsole
# list all core projects
ALL_CORE_PROJS = \
$(XNLIB) \
$(OPENNI) \
$(DEPTH_UTILS) \
$(ALL_DRIVERS) \
$(ALL_WRAPPERS) \
$(ALL_TOOLS)
# list all samples
CORE_SAMPLES = \
Samples/SimpleRead \
Samples/EventBasedRead \
Samples/MultipleStreamRead \
Samples/MWClosestPoint \
Samples/MWClosestPointApp
# list all java samples
JAVA_SAMPLES = \
Samples/SimpleViewer.java
ifeq "$(GLUT_SUPPORTED)" "1"
ALL_TOOLS += \
Source/Tools/NiViewer
CORE_SAMPLES += \
Samples/SimpleViewer \
Samples/MultiDepthViewer \
Samples/ClosestPointViewer
else
ifeq "$(GLES_SUPPORTED)" "1"
CORE_SAMPLES +=
endif
endif
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)
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 release
# make all makefiles
all: $(ALL_PROJS)
core: $(ALL_CORE_PROJS)
samples: $(ALL_SAMPLES)
# create projects targets
$(foreach proj,$(ALL_PROJS),$(eval $(call CREATE_PROJ_TARGET,$(proj))))
# additional dependencies
$(OPENNI): $(XNLIB)
Wrappers/java/OpenNI.jni: $(OPENNI) $(XNLIB)
Source/Drivers/DummyDevice: $(OPENNI) $(XNLIB)
Source/Drivers/RawDevice: $(OPENNI) $(XNLIB)
Source/Drivers/PS1080: $(OPENNI) $(XNLIB) $(DEPTH_UTILS)
Source/Drivers/PS1080/PS1080Console: $(OPENNI) $(XNLIB)
Source/Drivers/PSLink: $(OPENNI) $(XNLIB)
Source/Drivers/PSLink/PSLinkConsole: $(OPENNI) $(XNLIB)
Source/Drivers/OniFile: $(OPENNI) $(XNLIB)
Source/Tools/NiViewer: $(OPENNI) $(XNLIB)
Samples/SimpleRead: $(OPENNI)
Samples/EventBasedRead: $(OPENNI)
Samples/MultipleStreamRead: $(OPENNI)
Samples/MWClosestPoint: $(OPENNI)
Samples/MWClosestPointApp: $(OPENNI) Samples/MWClosestPoint
Samples/SimpleViewer: $(OPENNI)
Samples/MultiDepthViewer: $(OPENNI)
Samples/ClosestPointViewer: $(OPENNI) Samples/MWClosestPoint
Samples/SimpleViewer.java: Wrappers/java/OpenNI.java
$(FINAL_DIR):
mkdir -p $(FINAL_DIR)
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 is cleaning all projects
clean: $(ALL_PROJS_CLEAN)