Makefile 11.1 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
Florent Lamiraux's avatar
Florent Lamiraux committed
10
11
12

SRC_DIR=${DEVEL_DIR}/src
BUILD_TYPE=Debug
13
14
15
16
17
ifeq (${BUILD_TYPE},Debug)
  BUILD_FOLDER=build
else
  BUILD_FOLDER=build-rel
endif
Florent Lamiraux's avatar
Florent Lamiraux committed
18

19
hpp-fcl_branch=master
20
hpp-fcl_repository=${HPP_REPO}
Florent Lamiraux's avatar
Florent Lamiraux committed
21

22
hpp-util_branch=master
Florent Lamiraux's avatar
Florent Lamiraux committed
23
24
hpp-util_repository=${HPP_REPO}

25
hpp-model_branch=master
Florent Lamiraux's avatar
Florent Lamiraux committed
26
27
hpp-model_repository=${HPP_REPO}

28
hpp-model-urdf_branch=master
Florent Lamiraux's avatar
Florent Lamiraux committed
29
30
hpp-model-urdf_repository=${HPP_REPO}

31
hpp-statistics_branch=master
32
hpp-statistics_repository=${HPP_REPO}
33

34
hpp-core_branch=master
35
hpp-core_repository=${HPP_REPO}
Florent Lamiraux's avatar
Florent Lamiraux committed
36

37
hpp-template-corba_branch=master
Florent Lamiraux's avatar
Florent Lamiraux committed
38
39
hpp-template-corba_repository=${LAAS_REPO}

40
hpp-corbaserver_branch=master
41
hpp-corbaserver_repository=${HPP_REPO}
Florent Lamiraux's avatar
Florent Lamiraux committed
42

43
44
45
qpOASES_branch=master
qpOASES_repository=${HPP_REPO}

46
hpp-constraints_branch=master
47
hpp-constraints_repository=${HPP_REPO}
Florent Lamiraux's avatar
Florent Lamiraux committed
48

49
hpp-walkgen_branch=master
Joseph Mirabel's avatar
Joseph Mirabel committed
50
51
hpp-walkgen_repository=${HPP_REPO}

52
hpp-wholebody-step_branch=master
Florent Lamiraux's avatar
Florent Lamiraux committed
53
54
hpp-wholebody-step_repository=${HPP_REPO}

55
hpp-wholebody-step-corba_branch=master
Florent Lamiraux's avatar
Florent Lamiraux committed
56
57
hpp-wholebody-step-corba_repository=${HPP_REPO}

58
test-hpp_branch=master
59
test-hpp_repository=${HPP_REPO}
Florent Lamiraux's avatar
Florent Lamiraux committed
60
61

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

64
hpp-hrp2_branch=master
65
hpp-hrp2_repository=${HPP_REPO}
Florent Lamiraux's avatar
Florent Lamiraux committed
66

Florent Lamiraux's avatar
Florent Lamiraux committed
67
68
69
70
71
72
robot_capsule_urdf_branch=groovy
robot_capsule_urdf_repository=${LAAS_REPO}

robot_model_py_branch=groovy
robot_model_py_repository=${LAAS_REPO}

73
hpp-doc_branch=master
74
hpp-doc_repository=${HPP_REPO}
Florent Lamiraux's avatar
Florent Lamiraux committed
75

76
hpp-manipulation_branch=master
77
hpp-manipulation_repository=${HPP_REPO}
78

79
80

hpp-manipulation-urdf_branch=master
81
hpp-manipulation-urdf_repository=${HPP_REPO}
Florent Lamiraux's avatar
Florent Lamiraux committed
82

83
hpp-manipulation-corba_branch=master
84
hpp-manipulation-corba_repository=${HPP_REPO}
85

86
87
88
89
90
91
robot_state_chain_publisher_branch=master
robot_state_chain_publisher_repository=${HPP_REPO}

iai_maps_branch=master
iai_maps_repository=${HPP_REPO}

92
hpp_tutorial_branch=master
93
hpp_tutorial_repository=${HPP_REPO}
94
95
96

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

98
99
100
collada-dom_branch=master
collada-dom_repository=${HPP_REPO}

101
gepetto-viewer_branch=master
102
103
gepetto-viewer_repository=${HPP_REPO}

104
gepetto-viewer-corba_branch=master
105
106
gepetto-viewer-corba_repository=${HPP_REPO}

107
hpp-gepetto-viewer_branch=master
108
hpp-gepetto-viewer_repository=${HPP_REPO}
109

110
111
112
113
114
115
116
117
118
qgv_branch=master
qgv_repository=${HPP_REPO}

hpp-environments_branch=master
hpp-environments_repository=${HPP_REPO}

hpp-baxter_branch=master
hpp-baxter_repository=${HPP_REPO}

119
OpenSceneGraph-3.4.0_extra_flags= -DDESIRED_QT_VERSION=4 -DCOLLADA_DYNAMIC_LIBRARY=${DEVEL_DIR}/install/lib/libcollada14dom.so -DCOLLADA_INCLUDE_DIR=${DEVEL_DIR}/install/include/collada-dom -DLIB_POSTFIX=""
120

Joseph Mirabel's avatar
Joseph Mirabel committed
121
122
doxygen-Release_1_8_10_extra_flags= -DCMAKE_BUILD_TYPE=Release

123
124
125
126
127
128
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

Joseph Mirabel's avatar
Joseph Mirabel committed
129
all: doxygen-Release_1_8_10.install hpp_tutorial.install \
130
	hpp-gepetto-viewer.install hpp-manipulation-corba.install
131
	${MAKE} hpp-doc.install
Florent Lamiraux's avatar
Florent Lamiraux committed
132

Marine Heckler's avatar
Marine Heckler committed
133
# source $DEVEL_DIR/install/setup.bash before installing hrp2.
134
135
hrp2: test-hpp.install

Joseph Mirabel's avatar
Joseph Mirabel committed
136
hpp-fcl.configure.dep: eigen3.install hpp-fcl.checkout
137
eigen3.configure.dep: eigen3.checkout
Joseph Mirabel's avatar
Joseph Mirabel committed
138
doxygen-Release_1_8_10.configure.dep: doxygen-Release_1_8_10.checkout
Joseph Mirabel's avatar
Joseph Mirabel committed
139
140
roboptim-core-3.1.configure.dep: eigen3.install roboptim-core-3.1.checkout
roboptim-trajectory-3.1.configure.dep: roboptim-core-3.1.install \
141
	roboptim-trajectory-3.1.checkout
Joseph Mirabel's avatar
Joseph Mirabel committed
142
143
hpp-walkgen.configure.dep: hpp-util.install hpp-core.install \
        roboptim-trajectory-3.1.install hpp-walkgen.checkout
144
hpp-util.configure.dep: hpp-util.checkout
145
hpp-model.configure.dep: hpp-util.install hpp-fcl.install \
146
147
	eigen3.install hpp-model.checkout
hpp-model-urdf.configure.dep: hpp-model.install hpp-model-urdf.checkout
148
149
150
hpp-statistics.configure.dep: hpp-statistics.checkout
hpp-core.configure.dep: hpp-constraints.install hpp-statistics.install \
	hpp-core.checkout
151
152
qpOASES.configure.dep: qpOASES.checkout
hpp-constraints.configure.dep: qpOASES.install hpp-model.install hpp-constraints.checkout
Joseph Mirabel's avatar
Joseph Mirabel committed
153
hpp-wholebody-step.configure.dep: hpp-constraints.install hpp-walkgen.install \
154
155
	hpp-wholebody-step.checkout
hpp-manipulation.configure.dep: hpp-core.install hpp-constraints.install \
Joseph Mirabel's avatar
Joseph Mirabel committed
156
	hpp-wholebody-step.install hpp-manipulation.checkout
157
hpp-manipulation-urdf.configure.dep:hpp-manipulation.install \
158
	hpp-model-urdf.install hpp-manipulation-urdf.checkout
159
160
161
162
163
164
hpp-corbaserver.configure.dep: hpp-model-urdf.install hpp-core.install \
	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
165
hpp-manipulation-corba.configure.dep: hpp-manipulation-urdf.install \
166
167
168
169
170
171
172
173
174
	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 \
175
	hpp-gepetto-viewer.install hpp-hrp2.install test-hpp.checkout
176
177
robot_state_chain_publisher.configure.dep: robot_state_chain_publisher.checkout
iai_maps.configure.dep: robot_state_chain_publisher.install iai_maps.checkout
178
179
hpp_tutorial.configure.dep: hpp-gepetto-viewer.install iai_maps.install \
	hpp-corbaserver.install hpp_tutorial.checkout
180
hpp_benchmark.configure.dep: hpp_benchmark.checkout
181
collada-dom.configure.dep: collada-dom.checkout
182
183
184
OpenSceneGraph-3.4.0.configure.dep: collada-dom.install \
	OpenSceneGraph-3.4.0.checkout
gepetto-viewer.configure.dep: OpenSceneGraph-3.4.0.install \
185
186
187
188
	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
189
	hpp-corbaserver.install \
190
	hpp-gepetto-viewer.checkout
191
192
qgv.configure.dep: qgv.checkout
hpp-baxter.configure.dep: hpp-corbaserver.install hpp-baxter.checkout
193
194

status:
195
196
197
198
199
200
	@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"; \
201
		git --no-pager -c status.showUntrackedFiles=no status --short --branch; \
202
203
		cd ..; \
	done
204

Florent Lamiraux's avatar
Florent Lamiraux committed
205
206
207
208
209
210
211
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

212
update:
213
	for d in hpp-util hpp-model hpp-model-urdf hpp-core hpp-template-corba hpp-corbaserver hpp-constraints hpp-wholebody-step hpp-wholebody-step-corba hpp-doc ; do \
214
215
	echo "Updating $$d";\
	make $$d.update; done
Florent Lamiraux's avatar
Florent Lamiraux committed
216
217
218

%.checkout:
	if [ -d $(@:.checkout=) ]; then \
219
		echo "$(@:.checkout=) already checkout out."; \
Florent Lamiraux's avatar
Florent Lamiraux committed
220
221
222
223
224
225
	else \
		git clone --recursive -b ${$(@:.checkout=)_branch} ${$(@:.checkout=)_repository}/$(@:.checkout=); \
	fi \

%.update:
	cd ${SRC_DIR}/$(@:.update=);\
226
227
	git remote rm origin;\
	git remote add origin ${$(@:.update=)_repository}/$(@:.update=);\
Florent Lamiraux's avatar
Florent Lamiraux committed
228
229
230
231
232
233
234
	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

235
%.configure:%.configure.dep
236
237
	mkdir -p ${SRC_DIR}/$(@:.configure=)/${BUILD_FOLDER}; \
	cd ${SRC_DIR}/$(@:.configure=)/${BUILD_FOLDER}; \
238
	cmake -DCMAKE_INSTALL_PREFIX=${DEVEL_DIR}/install -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-g -O3 -DNDEBUG" ${$(@:.configure=)_extra_flags} ..
Florent Lamiraux's avatar
Florent Lamiraux committed
239

Florent Lamiraux's avatar
Florent Lamiraux committed
240
%.install:%.configure
241
	cd ${SRC_DIR}/$(@:.install=)/${BUILD_FOLDER};\
Florent Lamiraux's avatar
Florent Lamiraux committed
242
243
244
	make install

%.uninstall:
245
	cd ${SRC_DIR}/$(@:.uninstall=)/${BUILD_FOLDER};\
Florent Lamiraux's avatar
Florent Lamiraux committed
246
247
248
	make uninstall

%.clean:
249
	cd ${SRC_DIR}/$(@:.clean=)/${BUILD_FOLDER};\
Florent Lamiraux's avatar
Florent Lamiraux committed
250
251
	make clean

252
%.very-clean:
253
	rm -rf ${SRC_DIR}/$(@:.very-clean=)/${BUILD_FOLDER}/*
254

Florent Lamiraux's avatar
Florent Lamiraux committed
255
256
257
%.status:
	cd ${SRC_DIR}/$(@:.status=); git status

Florent Lamiraux's avatar
Florent Lamiraux committed
258
259
260
261
262
263
264
265
%.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
266
hpp-doc.configure: hpp-doc.checkout
Florent Lamiraux's avatar
Florent Lamiraux committed
267
268
	cd ${SRC_DIR}/$(@:.configure=);\
	./bootstrap;\
269
270
	mkdir -p ${BUILD_FOLDER}; \
	cd ${SRC_DIR}/$(@:.configure=)/${BUILD_FOLDER}; \
Florent Lamiraux's avatar
Florent Lamiraux committed
271
272
273
	../configure --prefix=${DEVEL_DIR}/install

eigen3.checkout:
274
275
276
	if [ -d $(@:.checkout=) ]; then \
		echo "$(@:.checkout=) already checkout out."; \
	else \
277
278
		wget -O - "http://bitbucket.org/eigen/eigen/get/3.2.4.tar.bz2" | tar -xj; \
		mv eigen-eigen-10219c95fe65 eigen3;\
279
	fi
Florent Lamiraux's avatar
Florent Lamiraux committed
280

281
eigen3.configure: eigen3.configure.dep
Florent Lamiraux's avatar
Florent Lamiraux committed
282
	cd ${SRC_DIR}/eigen3;\
283
284
	mkdir -p ${BUILD_FOLDER}; \
	cd ${SRC_DIR}/eigen3/${BUILD_FOLDER}; \
Florent Lamiraux's avatar
Florent Lamiraux committed
285
286
	cmake -DCMAKE_INSTALL_PREFIX=${DEVEL_DIR}/install -DCMAKE_INSTALL_LIBDIR=lib -Dpkg_config_libdir=${DEVEL_DIR}/install/lib ..

Joseph Mirabel's avatar
Joseph Mirabel committed
287
288
289
290
roboptim-core-3.1.checkout:
	if [ -d $(@:.checkout=) ]; then \
		echo "$(@:.checkout=) already checkout out."; \
	else \
291
		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
292
293
294
295
296
297
298
299
300
	fi

roboptim-trajectory-3.1.checkout:
	if [ -d $(@:.checkout=) ]; then \
		echo "$(@:.checkout=) already checkout out."; \
	else \
	        wget -O - "https://github.com/roboptim/roboptim-trajectory/releases/download/v3.1/roboptim-trajectory-3.1.tar.bz2" | tar -xj; \
	fi

Joseph Mirabel's avatar
Joseph Mirabel committed
301
302
303
304
305
306
307
doxygen-Release_1_8_10.checkout:
	if [ -d $(@:.checkout=) ]; then \
		echo "$(@:.checkout=) already checkout out."; \
	else \
		wget -O - "https://github.com/doxygen/doxygen/archive/Release_1_8_10.tar.gz" | tar -xz;\
	fi

308
hrp2.configure: hrp2.configure.dep
Florent Lamiraux's avatar
Florent Lamiraux committed
309
	. ${DEVEL_DIR}/install/setup.sh; \
Florent Lamiraux's avatar
Florent Lamiraux committed
310
	cd ${SRC_DIR}/hrp2/hrp2_14_description;\
311
312
	mkdir -p ${BUILD_FOLDER}; \
	cd ${SRC_DIR}/hrp2/hrp2_14_description/${BUILD_FOLDER}; \
Florent Lamiraux's avatar
Florent Lamiraux committed
313
314
	cmake -DCMAKE_INSTALL_PREFIX=${DEVEL_DIR}/install -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ..

Florent Lamiraux's avatar
Florent Lamiraux committed
315
hrp2.install: hrp2.configure
316
	cd ${SRC_DIR}/hrp2/hrp2_14_description/${BUILD_FOLDER};\
Florent Lamiraux's avatar
Florent Lamiraux committed
317
318
	make install

319
robot_model_py.configure: robot_model_py.configure.dep
Florent Lamiraux's avatar
Florent Lamiraux committed
320
	cd ${SRC_DIR}/$(@:.configure=)/xml_reflection;\
321
322
	mkdir -p ${BUILD_FOLDER}; \
	cd ${BUILD_FOLDER}; \
Florent Lamiraux's avatar
Florent Lamiraux committed
323
324
	cmake -DCMAKE_INSTALL_PREFIX=${DEVEL_DIR}/install -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ..
	cd ${SRC_DIR}/$(@:.configure=)/urdf_parser_py;\
325
326
	mkdir -p ${BUILD_FOLDER}; \
	cd ${BUILD_FOLDER}; \
Florent Lamiraux's avatar
Florent Lamiraux committed
327
	cmake -DCMAKE_INSTALL_PREFIX=${DEVEL_DIR}/install -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ..
Marine Heckler's avatar
Marine Heckler committed
328

Florent Lamiraux's avatar
Florent Lamiraux committed
329
robot_model_py.install: robot_model_py.configure
330
	cd ${SRC_DIR}/$(@:.install=)/xml_reflection/${BUILD_FOLDER}; \
Marine Heckler's avatar
Marine Heckler committed
331
	make install; \
332
	cd ${SRC_DIR}/$(@:.install=)/urdf_parser_py/${BUILD_FOLDER}; \
Marine Heckler's avatar
Marine Heckler committed
333
	make install;
334

335
OpenSceneGraph-3.4.0.checkout:
336
337
338
	if [ -d $(@:.checkout=) ]; then \
		echo "$(@:.checkout=) already checkout out."; \
	else \
339
340
341
		wget http://www.openscenegraph.org/downloads/stable_releases/OpenSceneGraph-3.4.0/source/OpenSceneGraph-3.4.0.zip;\
		cd ${SRC_DIR}; unzip OpenSceneGraph-3.4.0.zip;\
		rm -f OpenSceneGraph-3.4.0.zip;\
342
	fi