Makefile 9.03 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
13

SRC_DIR=${DEVEL_DIR}/src
BUILD_TYPE=Debug

14
hpp-fcl_branch=devel
15
hpp-fcl_repository=${HPP_REPO}
Florent Lamiraux's avatar
Florent Lamiraux committed
16

17
hpp-util_branch=devel
Florent Lamiraux's avatar
Florent Lamiraux committed
18
19
hpp-util_repository=${HPP_REPO}

20
hpp-model_branch=devel
Florent Lamiraux's avatar
Florent Lamiraux committed
21
22
hpp-model_repository=${HPP_REPO}

23
hpp-model-urdf_branch=devel
Florent Lamiraux's avatar
Florent Lamiraux committed
24
25
hpp-model-urdf_repository=${HPP_REPO}

26
hpp-statistics_branch=devel
27
hpp-statistics_repository=${HPP_REPO}
28

29
hpp-core_branch=devel
30
hpp-core_repository=${HPP_REPO}
Florent Lamiraux's avatar
Florent Lamiraux committed
31
32
33
34

hpp-template-corba_branch=master
hpp-template-corba_repository=${LAAS_REPO}

35
hpp-corbaserver_branch=devel
36
hpp-corbaserver_repository=${HPP_REPO}
Florent Lamiraux's avatar
Florent Lamiraux committed
37

38
hpp-constraints_branch=devel
39
hpp-constraints_repository=${HPP_REPO}
Florent Lamiraux's avatar
Florent Lamiraux committed
40

41
hpp-wholebody-step_branch=devel
Florent Lamiraux's avatar
Florent Lamiraux committed
42
43
hpp-wholebody-step_repository=${HPP_REPO}

44
hpp-wholebody-step-corba_branch=devel
Florent Lamiraux's avatar
Florent Lamiraux committed
45
46
hpp-wholebody-step-corba_repository=${HPP_REPO}

47
test-hpp_branch=devel
48
test-hpp_repository=${HPP_REPO}
Florent Lamiraux's avatar
Florent Lamiraux committed
49
50

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

53
hpp-hrp2_branch=devel
54
hpp-hrp2_repository=${HPP_REPO}
Florent Lamiraux's avatar
Florent Lamiraux committed
55

Florent Lamiraux's avatar
Florent Lamiraux committed
56
57
58
59
60
61
robot_capsule_urdf_branch=groovy
robot_capsule_urdf_repository=${LAAS_REPO}

robot_model_py_branch=groovy
robot_model_py_repository=${LAAS_REPO}

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

65
hpp-manipulation_branch=devel
66
hpp-manipulation_repository=${HPP_REPO}
67
68


69
hpp-manipulation-urdf_branch=devel
70
hpp-manipulation-urdf_repository=${HPP_REPO}
Florent Lamiraux's avatar
Florent Lamiraux committed
71

72
hpp-manipulation-corba_branch=devel
73
hpp-manipulation-corba_repository=${HPP_REPO}
74

75
76
77
78
79
80
robot_state_chain_publisher_branch=master
robot_state_chain_publisher_repository=${HPP_REPO}

iai_maps_branch=master
iai_maps_repository=${HPP_REPO}

81
hpp_tutorial_branch=devel
82
hpp_tutorial_repository=${HPP_REPO}
83
84
85

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

87
88
89
collada-dom_branch=master
collada-dom_repository=${HPP_REPO}

90
gepetto-viewer_branch=devel
91
92
gepetto-viewer_repository=${HPP_REPO}

93
gepetto-viewer-corba_branch=devel
94
95
gepetto-viewer-corba_repository=${HPP_REPO}

96
hpp-gepetto-viewer_branch=devel
97
hpp-gepetto-viewer_repository=${HPP_REPO}
98

99
OpenSceneGraph-3.4.0_extra_flags= -DCOLLADA_DYNAMIC_LIBRARY=${DEVEL_DIR}/install/lib/libcollada14dom.so -DCOLLADA_INCLUDE_DIR=${DEVEL_DIR}/install/include/collada-dom -DLIB_POSTFIX=""
100

101
all: hpp_tutorial.install \
102
	hpp-gepetto-viewer.install
103
	${MAKE} hpp-doc.install
Florent Lamiraux's avatar
Florent Lamiraux committed
104

Marine Heckler's avatar
Marine Heckler committed
105
# source $DEVEL_DIR/install/setup.bash before installing hrp2.
106
107
hrp2: test-hpp.install

108
hpp-fcl.configure.dep: hpp-fcl.checkout
109
110
eigen3.configure.dep: eigen3.checkout
hpp-util.configure.dep: hpp-util.checkout
111
hpp-model.configure.dep: hpp-util.install hpp-fcl.install \
112
113
	eigen3.install hpp-model.checkout
hpp-model-urdf.configure.dep: hpp-model.install hpp-model-urdf.checkout
114
115
116
hpp-statistics.configure.dep: hpp-statistics.checkout
hpp-core.configure.dep: hpp-constraints.install hpp-statistics.install \
	hpp-core.checkout
Florent Lamiraux's avatar
Florent Lamiraux committed
117
hpp-constraints.configure.dep: hpp-model.install hpp-constraints.checkout
118
119
120
121
hpp-wholebody-step.configure.dep: hpp-constraints.install \
	hpp-wholebody-step.checkout
hpp-manipulation.configure.dep: hpp-core.install hpp-constraints.install \
	hpp-manipulation.checkout
122
hpp-manipulation-urdf.configure.dep:hpp-manipulation.install \
123
	hpp-model-urdf.install hpp-manipulation-urdf.checkout
124
125
126
127
128
129
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
130
hpp-manipulation-corba.configure.dep: hpp-manipulation-urdf.install \
131
132
133
134
135
136
137
138
139
	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 \
140
	hpp-gepetto-viewer.install hpp-hrp2.install test-hpp.checkout
141
142
robot_state_chain_publisher.configure.dep: robot_state_chain_publisher.checkout
iai_maps.configure.dep: robot_state_chain_publisher.install iai_maps.checkout
143
144
hpp_tutorial.configure.dep: hpp-gepetto-viewer.install iai_maps.install \
	hpp-corbaserver.install hpp_tutorial.checkout
145
hpp_benchmark.configure.dep: hpp_benchmark.checkout
146
collada-dom.configure.dep: collada-dom.checkout
147
148
149
OpenSceneGraph-3.4.0.configure.dep: collada-dom.install \
	OpenSceneGraph-3.4.0.checkout
gepetto-viewer.configure.dep: OpenSceneGraph-3.4.0.install \
150
151
152
153
	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
154
	hpp-corbaserver.install \
155
	hpp-gepetto-viewer.checkout
156
157

status:
158
159
160
161
162
163
	@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"; \
164
		git --no-pager -c status.showUntrackedFiles=no status --short --branch; \
165
166
		cd ..; \
	done
167

Florent Lamiraux's avatar
Florent Lamiraux committed
168
169
170
171
172
173
174
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

175
update:
176
	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 \
177
178
	echo "Updating $$d";\
	make $$d.update; done
Florent Lamiraux's avatar
Florent Lamiraux committed
179
180
181

%.checkout:
	if [ -d $(@:.checkout=) ]; then \
182
		echo "$(@:.checkout=) already checkout out."; \
Florent Lamiraux's avatar
Florent Lamiraux committed
183
184
185
186
187
188
	else \
		git clone --recursive -b ${$(@:.checkout=)_branch} ${$(@:.checkout=)_repository}/$(@:.checkout=); \
	fi \

%.update:
	cd ${SRC_DIR}/$(@:.update=);\
189
190
	git remote rm origin;\
	git remote add origin ${$(@:.update=)_repository}/$(@:.update=);\
Florent Lamiraux's avatar
Florent Lamiraux committed
191
192
193
194
195
196
197
	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

198
%.configure:%.configure.dep
Florent Lamiraux's avatar
Florent Lamiraux committed
199
200
201
	cd ${SRC_DIR}/$(@:.configure=);\
	mkdir -p build; \
	cd ${SRC_DIR}/$(@:.configure=)/build; \
202
	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
203

Florent Lamiraux's avatar
Florent Lamiraux committed
204
%.install:%.configure
Florent Lamiraux's avatar
Florent Lamiraux committed
205
206
207
208
209
210
211
212
213
214
215
	cd ${SRC_DIR}/$(@:.install=)/build;\
	make install

%.uninstall:
	cd ${SRC_DIR}/$(@:.uninstall=)/build;\
	make uninstall

%.clean:
	cd ${SRC_DIR}/$(@:.clean=)/build;\
	make clean

216
217
218
%.very-clean:
	rm -rf ${SRC_DIR}/$(@:.very-clean=)/build/*

Florent Lamiraux's avatar
Florent Lamiraux committed
219
220
221
%.status:
	cd ${SRC_DIR}/$(@:.status=); git status

Florent Lamiraux's avatar
Florent Lamiraux committed
222
223
224
225
226
227
228
229
%.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
230
hpp-doc.configure: hpp-doc.checkout
Florent Lamiraux's avatar
Florent Lamiraux committed
231
232
233
234
235
236
237
	cd ${SRC_DIR}/$(@:.configure=);\
	./bootstrap;\
	mkdir -p build; \
	cd ${SRC_DIR}/$(@:.configure=)/build; \
	../configure --prefix=${DEVEL_DIR}/install

eigen3.checkout:
238
239
240
241
	if [ -d $(@:.checkout=) ]; then \
		echo "$(@:.checkout=) already checkout out."; \
	else \
		wget -O eigen3.tar.bz2 \
242
		http://bitbucket.org/eigen/eigen/get/3.2.4.tar.bz2;\
243
		cd ${SRC_DIR}; bunzip2 eigen3.tar.bz2; tar xvf eigen3.tar;\
244
		rm -f eigen3.tar; mv eigen-eigen-10219c95fe65 eigen3;\
245
	fi
Florent Lamiraux's avatar
Florent Lamiraux committed
246

247
eigen3.configure: eigen3.configure.dep
Florent Lamiraux's avatar
Florent Lamiraux committed
248
249
250
251
252
	cd ${SRC_DIR}/eigen3;\
	mkdir -p build; \
	cd ${SRC_DIR}/eigen3/build; \
	cmake -DCMAKE_INSTALL_PREFIX=${DEVEL_DIR}/install -DCMAKE_INSTALL_LIBDIR=lib -Dpkg_config_libdir=${DEVEL_DIR}/install/lib ..

253
hrp2.configure: hrp2.configure.dep
Florent Lamiraux's avatar
Florent Lamiraux committed
254
	. ${DEVEL_DIR}/install/setup.sh; \
Florent Lamiraux's avatar
Florent Lamiraux committed
255
256
257
258
259
	cd ${SRC_DIR}/hrp2/hrp2_14_description;\
	mkdir -p build; \
	cd ${SRC_DIR}/hrp2/hrp2_14_description/build; \
	cmake -DCMAKE_INSTALL_PREFIX=${DEVEL_DIR}/install -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ..

Florent Lamiraux's avatar
Florent Lamiraux committed
260
hrp2.install: hrp2.configure
Florent Lamiraux's avatar
Florent Lamiraux committed
261
262
263
	cd ${SRC_DIR}/hrp2/hrp2_14_description/build;\
	make install

264
robot_model_py.configure: robot_model_py.configure.dep
Florent Lamiraux's avatar
Florent Lamiraux committed
265
266
267
268
269
270
271
272
	cd ${SRC_DIR}/$(@:.configure=)/xml_reflection;\
	mkdir -p build; \
	cd build; \
	cmake -DCMAKE_INSTALL_PREFIX=${DEVEL_DIR}/install -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ..
	cd ${SRC_DIR}/$(@:.configure=)/urdf_parser_py;\
	mkdir -p build; \
	cd build; \
	cmake -DCMAKE_INSTALL_PREFIX=${DEVEL_DIR}/install -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ..
Marine Heckler's avatar
Marine Heckler committed
273

Florent Lamiraux's avatar
Florent Lamiraux committed
274
robot_model_py.install: robot_model_py.configure
Marine Heckler's avatar
Marine Heckler committed
275
276
277
278
	cd ${SRC_DIR}/$(@:.install=)/xml_reflection/build; \
	make install; \
	cd ${SRC_DIR}/$(@:.install=)/urdf_parser_py/build; \
	make install;
279

280
OpenSceneGraph-3.4.0.checkout:
281
282
283
	if [ -d $(@:.checkout=) ]; then \
		echo "$(@:.checkout=) already checkout out."; \
	else \
284
285
286
		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;\
287
	fi