| 1 |
############################################################################# |
| 2 |
# OpenNI makefile. |
| 3 |
# |
| 4 |
# default configuration is Release. for a debug version use: |
| 5 |
# make CFG=Debug |
| 6 |
# |
| 7 |
# default compiler is g++. for another one use: |
| 8 |
# make CXX=<comp> |
| 9 |
# |
| 10 |
# By default, CLR projects will only be build if mono is installed. |
| 11 |
# To force CLR projects use: |
| 12 |
# make FORCE_BUILD_CLR=1 |
| 13 |
# |
| 14 |
############################################################################# |
| 15 |
|
| 16 |
include ThirdParty/PSCommon/BuildSystem/CommonDefs.mak |
| 17 |
|
| 18 |
MAJOR_VERSION = $(shell grep "define ONI_VERSION_MAJOR" Include/OniVersion.h | cut -f 2) |
| 19 |
MINOR_VERSION = $(shell grep "define ONI_VERSION_MINOR" Include/OniVersion.h | cut -f 2) |
| 20 |
MAINT_VERSION = $(shell grep "define ONI_VERSION_MAINT" Include/OniVersion.h | cut -f 2) |
| 21 |
|
| 22 |
ifeq ("$(OSTYPE)","Darwin") |
| 23 |
OS_NAME = MacOSX |
| 24 |
else |
| 25 |
OS_NAME = Linux |
| 26 |
endif |
| •27 |
PRODUCT_STRING = OpenNI-$(OS_NAME)-$(PLATFORM)-$(shell cd Packaging && python3 -c "import UpdateVersion; print UpdateVersion.getVersionName()" && cd ..) |
| 28 |
FINAL_DIR = Packaging/Final |
| 29 |
|
| 30 |
OPENNI = Source/Core |
| 31 |
XNLIB = ThirdParty/PSCommon/XnLib/Source |
| 32 |
DEPTH_UTILS = Source/DepthUtils |
| 33 |
|
| 34 |
# list all drivers |
| 35 |
ALL_DRIVERS = \ |
| 36 |
Source/Drivers/DummyDevice \ |
| 37 |
Source/Drivers/PS1080 \ |
| 38 |
Source/Drivers/PSLink \ |
| 39 |
Source/Drivers/OniFile |
| 40 |
|
| 41 |
# list all wrappers |
| 42 |
ALL_WRAPPERS = \ |
| 43 |
Wrappers/java/OpenNI.jni \ |
| 44 |
Wrappers/java/OpenNI.java |
| 45 |
|
| 46 |
# list all tools |
| 47 |
ALL_TOOLS = \ |
| 48 |
Source/Drivers/PS1080/PS1080Console \ |
| 49 |
Source/Drivers/PSLink/PSLinkConsole |
| 50 |
|
| 51 |
# list all core projects |
| 52 |
ALL_CORE_PROJS = \ |
| 53 |
$(XNLIB) \ |
| 54 |
$(OPENNI) \ |
| 55 |
$(DEPTH_UTILS) \ |
| 56 |
$(ALL_DRIVERS) \ |
| 57 |
$(ALL_WRAPPERS) \ |
| 58 |
$(ALL_TOOLS) |
| 59 |
|
| 60 |
# list all samples |
| 61 |
CORE_SAMPLES = \ |
| 62 |
Samples/SimpleRead \ |
| 63 |
Samples/EventBasedRead \ |
| 64 |
Samples/MultipleStreamRead \ |
| 65 |
Samples/MWClosestPoint \ |
| 66 |
Samples/MWClosestPointApp |
| 67 |
|
| 68 |
# list all java samples |
| 69 |
JAVA_SAMPLES = \ |
| 70 |
Samples/SimpleViewer.java |
| 71 |
|
| 72 |
ifeq "$(GLUT_SUPPORTED)" "1" |
| 73 |
ALL_TOOLS += \ |
| 74 |
Source/Tools/NiViewer |
| 75 |
|
| 76 |
CORE_SAMPLES += \ |
| 77 |
Samples/SimpleViewer \ |
| 78 |
Samples/MultiDepthViewer \ |
| 79 |
Samples/ClosestPointViewer |
| 80 |
else |
| 81 |
ifeq "$(GLES_SUPPORTED)" "1" |
| 82 |
CORE_SAMPLES += |
| 83 |
endif |
| 84 |
endif |
| 85 |
|
| 86 |
ALL_SAMPLES = \ |
| 87 |
$(CORE_SAMPLES) \ |
| 88 |
$(JAVA_SAMPLES) |
| 89 |
|
| 90 |
# list all projects that are build |
| 91 |
ALL_BUILD_PROJS = \ |
| 92 |
$(ALL_CORE_PROJS) \ |
| 93 |
$(ALL_SAMPLES) |
| 94 |
|
| 95 |
ALL_PROJS = \ |
| 96 |
$(ALL_BUILD_PROJS) |
| 97 |
|
| 98 |
ALL_PROJS_CLEAN = $(foreach proj,$(ALL_PROJS),$(proj)-clean) |
| 99 |
|
| 100 |
# define a function which creates a target for each proj |
| 101 |
define CREATE_PROJ_TARGET |
| 102 |
$1: |
| 103 |
$$(MAKE) -C $1 |
| 104 |
|
| 105 |
$1-clean: |
| 106 |
$$(MAKE) -C $1 clean |
| 107 |
endef |
| 108 |
|
| 109 |
################ TARGETS ################## |
| 110 |
|
| 111 |
.PHONY: all $(ALL_PROJS) $(ALL_PROJS_CLEAN) install uninstall clean release |
| 112 |
|
| 113 |
# make all makefiles |
| 114 |
all: $(ALL_PROJS) |
| 115 |
|
| 116 |
core: $(ALL_CORE_PROJS) |
| 117 |
|
| 118 |
samples: $(ALL_SAMPLES) |
| 119 |
|
| 120 |
# create projects targets |
| 121 |
$(foreach proj,$(ALL_PROJS),$(eval $(call CREATE_PROJ_TARGET,$(proj)))) |
| 122 |
|
| 123 |
# additional dependencies |
| 124 |
$(OPENNI): $(XNLIB) |
| 125 |
Wrappers/java/OpenNI.jni: $(OPENNI) $(XNLIB) |
| 126 |
|
| 127 |
Source/Drivers/DummyDevice: $(OPENNI) $(XNLIB) |
| 128 |
Source/Drivers/RawDevice: $(OPENNI) $(XNLIB) |
| 129 |
Source/Drivers/PS1080: $(OPENNI) $(XNLIB) $(DEPTH_UTILS) |
| 130 |
Source/Drivers/PS1080/PS1080Console: $(OPENNI) $(XNLIB) |
| 131 |
Source/Drivers/PSLink: $(OPENNI) $(XNLIB) |
| 132 |
Source/Drivers/PSLink/PSLinkConsole: $(OPENNI) $(XNLIB) |
| 133 |
Source/Drivers/OniFile: $(OPENNI) $(XNLIB) |
| 134 |
|
| 135 |
Source/Tools/NiViewer: $(OPENNI) $(XNLIB) |
| 136 |
|
| 137 |
Samples/SimpleRead: $(OPENNI) |
| 138 |
Samples/EventBasedRead: $(OPENNI) |
| 139 |
Samples/MultipleStreamRead: $(OPENNI) |
| 140 |
Samples/MWClosestPoint: $(OPENNI) |
| 141 |
Samples/MWClosestPointApp: $(OPENNI) Samples/MWClosestPoint |
| 142 |
|
| 143 |
Samples/SimpleViewer: $(OPENNI) |
| 144 |
Samples/MultiDepthViewer: $(OPENNI) |
| 145 |
Samples/ClosestPointViewer: $(OPENNI) Samples/MWClosestPoint |
| 146 |
Samples/SimpleViewer.java: Wrappers/java/OpenNI.java |
| 147 |
|
| 148 |
$(FINAL_DIR): |
| 149 |
mkdir -p $(FINAL_DIR) |
| 150 |
|
| 151 |
doc: |
| 152 |
Source/Documentation/Runme.py |
| 153 |
rm -f Source/Documentation/html/*.md5 |
| 154 |
|
| 155 |
release: | all doc $(FINAL_DIR) |
| 156 |
Packaging/Harvest.py Packaging/$(PRODUCT_STRING) $(PLATFORM) |
| 157 |
cd Packaging; tar -cjf Final/$(PRODUCT_STRING).tar.bz2 $(PRODUCT_STRING) |
| 158 |
|
| 159 |
# clean is cleaning all projects |
| 160 |
clean: $(ALL_PROJS_CLEAN) |