Makefile 11.7 KB
Newer Older
Florent Lamiraux's avatar
Florent Lamiraux committed
1
2
3
4
5
6
#
# Copyright (c) 2014 CNRS-LAAS
# Author: Florent Lamiraux
#

FCL_REPO=https://github.com/flexible-collision-library
Florent Lamiraux's avatar
Florent Lamiraux committed
7
JRL_REPO=https://github.com/jrl-umi3218
Florent Lamiraux's avatar
Florent Lamiraux committed
8
9
LAAS_REPO=https://github.com/laas
HPP_REPO=https://github.com/humanoid-path-planner
10
SOT_REPO=https://github.com/stack-of-tasks
Florent Lamiraux's avatar
Florent Lamiraux committed
11
12

SRC_DIR=${DEVEL_DIR}/src
13
14
INSTALL_DIR=${DEVEL_DIR}/install

Florent Lamiraux's avatar
Florent Lamiraux committed
15
BUILD_TYPE=Debug
16
17
18
19
20
ifeq (${BUILD_TYPE},Debug)
  BUILD_FOLDER=build
else
  BUILD_FOLDER=build-rel
endif
Florent Lamiraux's avatar
Florent Lamiraux committed
21

22
23
24
25
26
WGET=wget --quiet
UNZIP=unzip -qq
TAR=tar
GIT_QUIET=--quiet

27
hpp-fcl_branch=devel
28
hpp-fcl_repository=${HPP_REPO}
29
hpp-fcl_extra_flags= -DCMAKE_BUILD_TYPE=Release
Florent Lamiraux's avatar
Florent Lamiraux committed
30

31
hpp-util_branch=devel
Florent Lamiraux's avatar
Florent Lamiraux committed
32
33
hpp-util_repository=${HPP_REPO}

34
hpp-model_branch=xxx
Florent Lamiraux's avatar
Florent Lamiraux committed
35
36
hpp-model_repository=${HPP_REPO}

37
pinocchio_branch=devel
38
39
40
41
42
43
44
pinocchio_repository=${SOT_REPO}
pinocchio_extra_flags= -DBUILD_PYTHON_INTERFACE=OFF

hpp-pinocchio_branch=master
hpp-pinocchio_repository=${HPP_REPO}

hpp-model-urdf_branch=xxx
Florent Lamiraux's avatar
Florent Lamiraux committed
45
46
hpp-model-urdf_repository=${HPP_REPO}

47
hpp-statistics_branch=devel
48
hpp-statistics_repository=${HPP_REPO}
49

50
hpp-core_branch=devel
51
hpp-core_repository=${HPP_REPO}
Florent Lamiraux's avatar
Florent Lamiraux committed
52

53
hpp-template-corba_branch=devel
Florent Lamiraux's avatar
Florent Lamiraux committed
54
55
hpp-template-corba_repository=${LAAS_REPO}

56
hpp-corbaserver_branch=devel
57
hpp-corbaserver_repository=${HPP_REPO}
Florent Lamiraux's avatar
Florent Lamiraux committed
58

59
qpOASES_branch=devel
60
61
qpOASES_repository=${HPP_REPO}

62
hpp-constraints_branch=devel
63
hpp-constraints_repository=${HPP_REPO}
Florent Lamiraux's avatar
Florent Lamiraux committed
64

65
hpp-walkgen_branch=devel
Joseph Mirabel's avatar
Joseph Mirabel committed
66
67
hpp-walkgen_repository=${HPP_REPO}

68
hpp-wholebody-step_branch=devel
Florent Lamiraux's avatar
Florent Lamiraux committed
69
70
hpp-wholebody-step_repository=${HPP_REPO}

71
hpp-wholebody-step-corba_branch=devel
Florent Lamiraux's avatar
Florent Lamiraux committed
72
73
hpp-wholebody-step-corba_repository=${HPP_REPO}

74
test-hpp_branch=devel
75
test-hpp_repository=${HPP_REPO}
Florent Lamiraux's avatar
Florent Lamiraux committed
76
77

hrp2_branch=groovy
Marine Heckler's avatar
Marine Heckler committed
78
hrp2_repository=${JRL_REPO}
Florent Lamiraux's avatar
Florent Lamiraux committed
79

80
hpp-hrp2_branch=devel
81
hpp-hrp2_repository=${HPP_REPO}
Florent Lamiraux's avatar
Florent Lamiraux committed
82

Florent Lamiraux's avatar
Florent Lamiraux committed
83
84
85
86
87
88
robot_capsule_urdf_branch=groovy
robot_capsule_urdf_repository=${LAAS_REPO}

robot_model_py_branch=groovy
robot_model_py_repository=${LAAS_REPO}

89
hpp-doc_branch=devel
90
hpp-doc_repository=${HPP_REPO}
Florent Lamiraux's avatar
Florent Lamiraux committed
91

92
hpp-manipulation_branch=devel
93
hpp-manipulation_repository=${HPP_REPO}
94

95
hpp-manipulation-urdf_branch=devel
96
hpp-manipulation-urdf_repository=${HPP_REPO}
Florent Lamiraux's avatar
Florent Lamiraux committed
97

98
hpp-manipulation-corba_branch=devel
99
hpp-manipulation-corba_repository=${HPP_REPO}
100

101
102
103
robot_state_chain_publisher_branch=master
robot_state_chain_publisher_repository=${HPP_REPO}

104
iai_maps_branch=devel
105
106
iai_maps_repository=${HPP_REPO}

107
hpp_tutorial_branch=devel
108
hpp_tutorial_repository=${HPP_REPO}
109
110
111

hpp_benchmark_branch=master
hpp_benchmark_repository=${HPP_REPO}
Florent Lamiraux's avatar
Florent Lamiraux committed
112

113
114
115
collada-dom_branch=master
collada-dom_repository=${HPP_REPO}

116
117
118
OpenSceneGraph-dae-plugin_branch=master
OpenSceneGraph-dae-plugin_repository=${HPP_REPO}

119
gepetto-viewer_branch=devel
120
121
gepetto-viewer_repository=${HPP_REPO}

122
gepetto-viewer-corba_branch=devel
123
124
gepetto-viewer-corba_repository=${HPP_REPO}

125
hpp-gepetto-viewer_branch=devel
126
hpp-gepetto-viewer_repository=${HPP_REPO}
127

128
129
130
131
132
pythonqt_branch=patched-5
pythonqt_repository=${HPP_REPO}
pythonqt_extra_flags= -DPythonQt_Wrap_QtAll=ON -DPythonQt_Extensions=ON

qgv_branch=devel
133
134
qgv_repository=${HPP_REPO}

135
hpp-environments_branch=devel
136
137
hpp-environments_repository=${HPP_REPO}

138
hpp-baxter_branch=devel
139
140
hpp-baxter_repository=${HPP_REPO}

141
OpenSceneGraph-dae-plugin_extra_flags= -DCOLLADA_DYNAMIC_LIBRARY=${INSTALL_DIR}/lib/libcollada14dom.so -DCOLLADA_INCLUDE_DIR=${INSTALL_DIR}/include/collada-dom
142

143
144
145
146
147
148
roboptim-core-3.1_extra_flags= -DCMAKE_BUILD_TYPE=Release

roboptim-trajectory-3.1_extra_flags= -DCMAKE_BUILD_TYPE=Release

qpOASES_extra_flags= -DCMAKE_BUILD_TYPE=Release

149
all: doxygen-1.8.10.install hpp_tutorial.install \
150
	hpp-manipulation-corba.install 	hpp-gepetto-viewer.install
151
	${MAKE} hpp-doc.install
Florent Lamiraux's avatar
Florent Lamiraux committed
152

Marine Heckler's avatar
Marine Heckler committed
153
# source $DEVEL_DIR/install/setup.bash before installing hrp2.
154
155
hrp2: test-hpp.install

Joseph Mirabel's avatar
Joseph Mirabel committed
156
hpp-fcl.configure.dep: eigen3.install hpp-fcl.checkout
157
eigen3.configure.dep: eigen3.checkout
158
doxygen-1.8.10.configure.dep: doxygen-1.8.10.checkout
Joseph Mirabel's avatar
Joseph Mirabel committed
159
160
roboptim-core-3.1.configure.dep: eigen3.install roboptim-core-3.1.checkout
roboptim-trajectory-3.1.configure.dep: roboptim-core-3.1.install \
161
	roboptim-trajectory-3.1.checkout
Joseph Mirabel's avatar
Joseph Mirabel committed
162
163
hpp-walkgen.configure.dep: hpp-util.install hpp-core.install \
        roboptim-trajectory-3.1.install hpp-walkgen.checkout
164
hpp-util.configure.dep: hpp-util.checkout
165
hpp-model.configure.dep: hpp-util.install hpp-fcl.install \
166
167
	eigen3.install hpp-model.checkout
hpp-model-urdf.configure.dep: hpp-model.install hpp-model-urdf.checkout
168
169
170
pinocchio.configure.dep: eigen3.install hpp-fcl.install pinocchio.checkout
hpp-pinocchio.configure.dep: pinocchio.install hpp-util.install \
	hpp-pinocchio.checkout
171
hpp-statistics.configure.dep: hpp-util.install hpp-statistics.checkout
172
173
hpp-core.configure.dep: hpp-constraints.install hpp-statistics.install \
	hpp-core.checkout
174
qpOASES.configure.dep: qpOASES.checkout
175
176
hpp-constraints.configure.dep: qpOASES.install \
	hpp-pinocchio.install hpp-constraints.checkout
Joseph Mirabel's avatar
Joseph Mirabel committed
177
hpp-wholebody-step.configure.dep: hpp-constraints.install hpp-walkgen.install \
178
179
	hpp-wholebody-step.checkout
hpp-manipulation.configure.dep: hpp-core.install hpp-constraints.install \
180
	hpp-manipulation.checkout
181
hpp-manipulation-urdf.configure.dep:hpp-manipulation.install \
182
183
	hpp-manipulation-urdf.checkout
hpp-corbaserver.configure.dep: hpp-core.install \
184
185
186
187
188
	hpp-constraints.install hpp-corbaserver.checkout
hpp-wholebody-step-corba.configure.dep: hpp-corbaserver.install \
	hpp-wholebody-step.install hpp-template-corba.install \
	hpp-wholebody-step-corba.checkout
hpp-template-corba.configure.dep: hpp-util.install hpp-template-corba.checkout
189
hpp-manipulation-corba.configure.dep: hpp-manipulation-urdf.install \
190
191
192
193
194
195
196
197
198
	hpp-wholebody-step-corba.install hpp-manipulation.install \
	hpp-manipulation-corba.checkout
robot_model_py.configure.dep: robot_model_py.checkout
robot_capsule_urdf.configure.dep: robot_model_py.install \
	robot_capsule_urdf.checkout
hpp-hrp2.configure.dep: hrp2.install hpp-corbaserver.install hpp-hrp2.checkout
hrp2.configure.dep: robot_capsule_urdf.install robot_model_py.install \
	hrp2.checkout
test-hpp.configure.dep: hpp-wholebody-step-corba.install \
199
	hpp-gepetto-viewer.install hpp-hrp2.install test-hpp.checkout
200
201
robot_state_chain_publisher.configure.dep: robot_state_chain_publisher.checkout
iai_maps.configure.dep: robot_state_chain_publisher.install iai_maps.checkout
202
203
hpp_tutorial.configure.dep: hpp-gepetto-viewer.install iai_maps.install \
	hpp-corbaserver.install hpp_tutorial.checkout
204
hpp_benchmark.configure.dep: hpp_benchmark.checkout
205
collada-dom.configure.dep: collada-dom.checkout
206
207
208
OpenSceneGraph-dae-plugin.configure.dep: collada-dom.install \
	OpenSceneGraph-dae-plugin.checkout
gepetto-viewer.configure.dep: OpenSceneGraph-dae-plugin.install \
209
210
211
212
	gepetto-viewer.checkout
gepetto-viewer-corba.configure.dep: gepetto-viewer.install \
	gepetto-viewer-corba.checkout
hpp-gepetto-viewer.configure.dep: gepetto-viewer-corba.install \
Florent Lamiraux's avatar
Florent Lamiraux committed
213
	hpp-corbaserver.install \
214
	hpp-gepetto-viewer.checkout
215
hpp-baxter.configure.dep: hpp-corbaserver.install hpp-baxter.checkout
216
pythonqt.configure.dep: pythonqt.checkout
217
218

status:
219
220
221
222
223
224
	@for child_dir in $$(ls ${SRC_DIR}); do \
		test -d "$$child_dir" || continue; \
		test -d "$$child_dir/.git" || continue; \
		cd "$$child_dir";\
		echo \
		"\033[1;36m------- Folder $$child_dir ---------------\033[0m"; \
225
		git --no-pager -c status.showUntrackedFiles=no status --short --branch; \
226
227
		cd ..; \
	done
228

Florent Lamiraux's avatar
Florent Lamiraux committed
229
230
231
232
233
234
235
log:
	@for child_dir in $$(ls ${SRC_DIR}); do \
		test -d "$$child_dir" || continue; \
		test -d "$$child_dir/.git" || continue; \
		${MAKE} "$$child_dir".log; \
	done

236
update:
237
	for d in hpp-util hpp-pinocchio hpp-core hpp-template-corba hpp-corbaserver hpp-constraints hpp-wholebody-step hpp-wholebody-step-corba hpp-doc ; do \
238
	echo "Updating $$d";\
239
	${MAKE} $$d.update; done
Florent Lamiraux's avatar
Florent Lamiraux committed
240
241
242

%.checkout:
	if [ -d $(@:.checkout=) ]; then \
243
		echo "$(@:.checkout=) already checkout out."; \
Florent Lamiraux's avatar
Florent Lamiraux committed
244
	else \
245
		git clone ${GIT_QUIET} --recursive -b ${$(@:.checkout=)_branch} ${$(@:.checkout=)_repository}/$(@:.checkout=); \
Florent Lamiraux's avatar
Florent Lamiraux committed
246
247
248
249
	fi \

%.update:
	cd ${SRC_DIR}/$(@:.update=);\
250
251
	git remote rm origin;\
	git remote add origin ${$(@:.update=)_repository}/$(@:.update=);\
Florent Lamiraux's avatar
Florent Lamiraux committed
252
253
254
255
256
257
258
	git fetch origin;\
	git checkout -b bce46g origin/${$(@:.update=)_branch};\
	git branch -D ${$(@:.update=)_branch};\
	git checkout -b ${$(@:.update=)_branch} bce46g;\
	git branch -D bce46g;\
	git submodule update

259
260
261
262
263
264
265
%.configure:%.configure.dep %.confthis
	: # Do nothing else

%.confthis:%.checkout
	mkdir -p ${SRC_DIR}/$(@:.confthis=)/${BUILD_FOLDER}; \
	cd ${SRC_DIR}/$(@:.confthis=)/${BUILD_FOLDER}; \
	cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-g -O3 -DNDEBUG" ${$(@:.confthis=)_extra_flags} ..
Florent Lamiraux's avatar
Florent Lamiraux committed
266

Florent Lamiraux's avatar
Florent Lamiraux committed
267
%.install:%.configure
268
269
270
271
	${MAKE} -C ${SRC_DIR}/$(@:.install=)/${BUILD_FOLDER} install

%.instthis:%.confthis
	${MAKE} -C ${SRC_DIR}/$(@:.instthis=)/${BUILD_FOLDER} install
Florent Lamiraux's avatar
Florent Lamiraux committed
272
273

%.uninstall:
274
	${MAKE} -C ${SRC_DIR}/$(@:.uninstall=)/${BUILD_FOLDER} uninstall
Florent Lamiraux's avatar
Florent Lamiraux committed
275
276

%.clean:
277
	${MAKE} -C ${SRC_DIR}/$(@:.clean=)/${BUILD_FOLDER} clean
Florent Lamiraux's avatar
Florent Lamiraux committed
278

279
%.very-clean:
280
	rm -rf ${SRC_DIR}/$(@:.very-clean=)/${BUILD_FOLDER}/*
281

Florent Lamiraux's avatar
Florent Lamiraux committed
282
283
284
%.status:
	cd ${SRC_DIR}/$(@:.status=); git status

Florent Lamiraux's avatar
Florent Lamiraux committed
285
286
287
288
289
290
291
292
%.log:
	@cd ${SRC_DIR}/$(@:.log=); \
	if [ -f .git/refs/heads/${$(@:.log=)_branch} ]; then \
		echo -n "$(@:.log=): "; \
		cat .git/refs/heads/${$(@:.log=)_branch}; \
	fi


Florent Lamiraux's avatar
Florent Lamiraux committed
293
hpp-doc.configure: hpp-doc.checkout
Florent Lamiraux's avatar
Florent Lamiraux committed
294
295
	cd ${SRC_DIR}/$(@:.configure=);\
	./bootstrap;\
296
297
	mkdir -p ${BUILD_FOLDER}; \
	cd ${SRC_DIR}/$(@:.configure=)/${BUILD_FOLDER}; \
298
	../configure --prefix=${INSTALL_DIR}
Florent Lamiraux's avatar
Florent Lamiraux committed
299
300

eigen3.checkout:
301
302
303
	if [ -d $(@:.checkout=) ]; then \
		echo "$(@:.checkout=) already checkout out."; \
	else \
304
		${WGET} -O - "http://bitbucket.org/eigen/eigen/get/3.2.4.tar.bz2" | ${TAR} -xj; \
305
		mv eigen-eigen-10219c95fe65 eigen3;\
306
	fi
Florent Lamiraux's avatar
Florent Lamiraux committed
307

308
eigen3.configure: eigen3.configure.dep
Florent Lamiraux's avatar
Florent Lamiraux committed
309
	cd ${SRC_DIR}/eigen3;\
310
311
	mkdir -p ${BUILD_FOLDER}; \
	cd ${SRC_DIR}/eigen3/${BUILD_FOLDER}; \
312
	cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -DCMAKE_INSTALL_LIBDIR=lib -Dpkg_config_libdir=${INSTALL_DIR}/lib ..
Florent Lamiraux's avatar
Florent Lamiraux committed
313

Joseph Mirabel's avatar
Joseph Mirabel committed
314
315
316
317
roboptim-core-3.1.checkout:
	if [ -d $(@:.checkout=) ]; then \
		echo "$(@:.checkout=) already checkout out."; \
	else \
318
		${WGET} -O - "https://github.com/roboptim/roboptim-core/releases/download/v3.1/roboptim-core-3.1.tar.bz2" | ${TAR} -xj; \
Joseph Mirabel's avatar
Joseph Mirabel committed
319
320
321
322
323
324
	fi

roboptim-trajectory-3.1.checkout:
	if [ -d $(@:.checkout=) ]; then \
		echo "$(@:.checkout=) already checkout out."; \
	else \
325
	  ${WGET} -O - "https://github.com/roboptim/roboptim-trajectory/releases/download/v3.1/roboptim-trajectory-3.1.tar.bz2" | ${TAR} -xj; \
Joseph Mirabel's avatar
Joseph Mirabel committed
326
327
	fi

328
doxygen-1.8.10.checkout:
Joseph Mirabel's avatar
Joseph Mirabel committed
329
330
331
	if [ -d $(@:.checkout=) ]; then \
		echo "$(@:.checkout=) already checkout out."; \
	else \
332
	  ${WGET} -O - "ftp://ftp.stack.nl/pub/users/dimitri/doxygen-1.8.10.linux.bin.tar.gz" | ${TAR} -xz;\
Joseph Mirabel's avatar
Joseph Mirabel committed
333
334
	fi

335
336
337
338
339
340
341
342
doxygen-1.8.10.configure: doxygen-1.8.10.configure.dep
	@ :

doxygen-1.8.10.install: doxygen-1.8.10.configure
	cd ${SRC_DIR}/doxygen-1.8.10;\
  mkdir -p ${DEVEL_DIR}/install/bin;\
  install --mode=755 -t ${DEVEL_DIR}/install/bin bin/doxygen

343
hrp2.configure: hrp2.configure.dep
344
	. ${INSTALL_DIR}/setup.sh; \
Florent Lamiraux's avatar
Florent Lamiraux committed
345
	cd ${SRC_DIR}/hrp2/hrp2_14_description;\
346
347
	mkdir -p ${BUILD_FOLDER}; \
	cd ${SRC_DIR}/hrp2/hrp2_14_description/${BUILD_FOLDER}; \
348
	cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ..
Florent Lamiraux's avatar
Florent Lamiraux committed
349

Florent Lamiraux's avatar
Florent Lamiraux committed
350
hrp2.install: hrp2.configure
351
	${MAKE} -C ${SRC_DIR}/hrp2/hrp2_14_description/${BUILD_FOLDER} install
Florent Lamiraux's avatar
Florent Lamiraux committed
352

353
robot_model_py.configure: robot_model_py.configure.dep
Florent Lamiraux's avatar
Florent Lamiraux committed
354
	cd ${SRC_DIR}/$(@:.configure=)/xml_reflection;\
355
356
	mkdir -p ${BUILD_FOLDER}; \
	cd ${BUILD_FOLDER}; \
357
	cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ..
Florent Lamiraux's avatar
Florent Lamiraux committed
358
	cd ${SRC_DIR}/$(@:.configure=)/urdf_parser_py;\
359
360
	mkdir -p ${BUILD_FOLDER}; \
	cd ${BUILD_FOLDER}; \
361
	cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ..
Marine Heckler's avatar
Marine Heckler committed
362

Florent Lamiraux's avatar
Florent Lamiraux committed
363
robot_model_py.install: robot_model_py.configure
364
365
	${MAKE} -C ${SRC_DIR}/$(@:.install=)/xml_reflection/${BUILD_FOLDER} install; \
	${MAKE} -C ${SRC_DIR}/$(@:.install=)/urdf_parser_py/${BUILD_FOLDER} install;