-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile.openhrp3
45 lines (38 loc) · 2.24 KB
/
Makefile.openhrp3
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
INSTALL_DIR ?= $(CURDIR)
PATCH_DIR = ${CURDIR}
SVN_DIR = build/OpenHRP-3.1
#SVN_URL = https://openrtp.org/svn/hrg/openhrp/3.1/trunk # for developers only
SVN_URL = https://openrtp.org/svn/hrg/openhrp/3.1/tags/3.1.6/
#SVN_REVISION = -r@REVISION@
SVN_CMDLINE = svn --non-interactive --trust-server-cert
SVN_PATCH = ${PATCH_DIR}/patch/OpenHRP2ModelFile.patch ${PATCH_DIR}/patch/CompileColladaModel.patch ${PATCH_DIR}/patch/CompileIdlPy.patch ${PATCH_DIR}/patch/Boost.patch ${PATCH_DIR}/patch/cblas.patch ${PATCH_DIR}/patch/Optional-lsb-release.patch ${PATCH_DIR}/patch/FixPythonExec.patch ${PATCH_DIR}/patch/AddOpenHRP3SampleModel.patch ${PATCH_DIR}/patch/CMAKE_INSTALL_RPATH.patch #
# OpenHRP2ModelFile.patch : https://openrtp.jp/redmine/issues/2154
# CompileColladaModel.patch : https://openrtp.jp/redmine/issues/2171
# CompileIdlPy.patch : https://openrtp.jp/redmine/issues/2170
# Boost.patch cblas.patch :see https://openrtp.jp/redmine/issues/2172, https://github.com/start-jsk/openhrp3/issues/26
# CMAKE_INSTALL_RPATH.patch : only for ROS, due to ROS FHS ./lib/lib*.so ./lib/openhrp3/openhrp-*(.exe)
MK_DIR = $(shell rospack find mk)
NUM_OF_CPUS = $(shell grep -c '^processor' /proc/cpuinfo)
include $(MK_DIR)/svn_checkout.mk
patched_no_makefile: $(SVN_PATCH) ## copy from svn_checkout.mk
ifneq ($(strip $(SVN_PATCH)),)
svn revert -R $(SVN_DIR)
svn status $(SVN_DIR) | grep ^? | awk '{print $2}' | xargs rm -rf
endif
-cd $(SVN_DIR) && $(SVN_CMDLINE) up $(SVN_REVISION)
$(foreach PATCH, $(SVN_PATCH), patch -d $(SVN_DIR) -p0 < $(PATCH) && ) echo patched
touch rospack_nosubdirs
touch patched_no_makefile
installed: $(SVN_DIR) patched_no_makefile
@echo "compile openhrp3 ... "
@echo " PATH=$(PATH)"
@echo " INSTALL_DIR=$(INSTALL_DIR)"
@echo " OPENRTM_DIR=$(OPENRTM_DIR)"
cd $(SVN_DIR) && cmake . -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -DENABLE_INSTALL_RPATH=ON -DENABLE_INSTALL_RPATH_TO_SELF=ON -DCOMPILE_JAVA_STUFF=OFF && make VERBOSE=1 -j$(shell if [ $(NUM_OF_CPUS) -gt 2 ] ; then echo "2"; else echo $(NUM_OF_CPUS); fi) && make install
#
# add link
ln -sf SimulationEC.so $(INSTALL_DIR)/lib/libSimulationEC.so
#
touch installed
clean:
-rm -fr installed patched include bin lib share build