forked from OpenNI/OpenNI2
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
115 lines (90 loc) · 2.52 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
#############################################################################
# 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
OPENNI = Source/Core
XNLIB = ThirdParty/PSCommon/XnLib/Source
# list all drivers
ALL_DRIVERS = \
Source/Drivers/DummyDevice \
Source/Drivers/PS1080 \
Source/Drivers/OniFile
# list all tools
ALL_TOOLS =
# list all core projects
ALL_CORE_PROJS = \
$(XNLIB) \
$(OPENNI) \
$(ALL_DRIVERS) \
$(ALL_TOOLS)
# list all samples
CORE_SAMPLES = \
Samples/SimpleRead \
Samples/EventBasedRead \
Samples/MultipleStreamRead \
Samples/MWClosestPoint \
Samples/MWClosestPointApp
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)
# 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
# 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)
Source/Drivers/DummyDevice: $(OPENNI) $(XNLIB)
Source/Drivers/RawDevice: $(OPENNI) $(XNLIB)
Source/Drivers/PS1080: $(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
# clean is cleaning all projects
clean: $(ALL_PROJS_CLEAN)