-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile.hrpsys-base
50 lines (42 loc) · 2.07 KB
/
Makefile.hrpsys-base
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
all: installed
INSTALL_DIR ?= ${CURDIR}
GIT_DIR = build/hrpsys-base-source
PATCH_DIR = $(CURDIR)
GIT_URL = https://github.com/fkanehiro/hrpsys-base.git
GIT_REVISION = 315.2.7
GIT_PATCH = ${PATCH_DIR}/patch/opencv2.patch
#if arch
ifeq (,$(wildcard /etc/debian_version)) #if not debian_version exists
GIT_PATCH += ${PATCH_DIR}/patch/python.patch
endif
ifneq (,$(wildcard /etc/arch-release)) # if arch
GIT_PATCH += ${PATCH_DIR}/patch/qhull.patch
endif
OPENRTM_DIR ?= $(shell rospack find openrtm_aist)
PKG_CONFIG_PATH := $(shell rospack find openrtm_aist)/lib/pkgconfig:$(shell rospack find openhrp3)/lib/pkgconfig:$(PKG_CONFIG_PATH)
MK_DIR = $(shell rospack find mk)
NUM_OF_CPUS = $(shell grep -c '^processor' /proc/cpuinfo)
include $(MK_DIR)/git_checkout.mk
disable_ssl:
git config --global http.sslVerify false
installed: disable_ssl $(GIT_DIR) $(GIT_PATCH)
@echo "patch hrpsys-base ... "
@echo " PATCH_DIR=$(PATCH_DIR)"
cd $(GIT_DIR) && git reset --hard && git checkout $(GIT_REVISION)
ifneq ($(strip $(GIT_PATCH)),)
$(foreach PATCH, $(GIT_PATCH), patch -d $(GIT_DIR) -p0 < $(PATCH) && ) echo patched
touch rospack_nosubdirs
touch patched
endif
rm -f build/hrpsys-base/CMakeCache.txt
@echo "compile hrpsys-base ... "
@echo " PATH=$(PATH)"
@echo " INSTALL_DIR=$(INSTALL_DIR)"
@echo " OPENRTM_DIR=$(OPENRTM_DIR)"
(mkdir -p build/hrpsys-base && cd build/hrpsys-base && PKG_CONFIG_PATH=${PKG_CONFIG_PATH} cmake -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -DOPENRTM_DIR=${OPENRTM_DIR} -DENABLE_INSTALL_RPATH=ON -DCOMPILE_JAVA_STUFF=OFF -DEXTRA_RTC_DIRS="$(EXTRA_RTC_DIRS)" -DEXTRA_IDL_FILES="$(EXTRA_IDL_FILES)" -DENABLE_INSTALL_RPATH_TO_SELF=ON -DENABLE_DOXYGEN=OFF ${CURDIR}/build/hrpsys-base-source && make -j$(shell if [ $(NUM_OF_CPUS) -gt 2 ] ; then echo "2"; else echo $(NUM_OF_CPUS); fi) && make install) 2>&1 | tee ${CURDIR}/compile.log
#
touch installed
clean:
-cd $(GIT_DIR) && make clean
download:
git clone $(GIT_URL) $(GIT_DIR); (cd ${GIT_DIR}; git checkout $(GIT_REVISION) up; rm -f `rospack find hrpsys`/installed)