Makefile 8.59 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
8
9
10
11
12
13
LAAS_REPO=git@github.com:laas
HPP_REPO=git@github.com:humanoid-path-planner
FLORENT_REPO=git@github.com:florent-lamiraux
TRAC_REPO=ssh://trac.laas.fr/git/jrl
JOSEPH_REPO=git@github.com:billx09
TINYXML2_REPO=git@github.com:leethomason
Florent Lamiraux's avatar
Florent Lamiraux committed
14
15
16
17

SRC_DIR=${DEVEL_DIR}/src
BUILD_TYPE=Debug

18
19
hpp-fcl_branch=master
hpp-fcl_repository=${HPP_REPO}
Florent Lamiraux's avatar
Florent Lamiraux committed
20
21
22
23
24
25
26
27
28
29

hpp-util_branch=master
hpp-util_repository=${HPP_REPO}

hpp-model_branch=master
hpp-model_repository=${HPP_REPO}

hpp-model-urdf_branch=master
hpp-model-urdf_repository=${HPP_REPO}

30
31
32
hpp-statistics_branch=master
hpp-statistics_repository=${TRAC_REPO}/algo

Florent Lamiraux's avatar
Florent Lamiraux committed
33
hpp-core_branch=master
34
hpp-core_repository=${TRAC_REPO}/algo
Florent Lamiraux's avatar
Florent Lamiraux committed
35
36
37
38
39

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

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

hpp-constraints_branch=master
43
hpp-constraints_repository=${TRAC_REPO}/algo
Florent Lamiraux's avatar
Florent Lamiraux committed
44
45
46
47
48
49
50
51

hpp-wholebody-step_branch=master
hpp-wholebody-step_repository=${HPP_REPO}

hpp-wholebody-step-corba_branch=master
hpp-wholebody-step-corba_repository=${HPP_REPO}

hpp_ros_branch=master
52
hpp_ros_repository=${TRAC_REPO}/ros
Florent Lamiraux's avatar
Florent Lamiraux committed
53
54

test-hpp_branch=master
55
test-hpp_repository=${TRAC_REPO}/test
Florent Lamiraux's avatar
Florent Lamiraux committed
56
57

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

Florent Lamiraux's avatar
Florent Lamiraux committed
60
hpp-hrp2_branch=master
61
hpp-hrp2_repository=${TRAC_REPO}/algo
Florent Lamiraux's avatar
Florent Lamiraux committed
62

Florent Lamiraux's avatar
Florent Lamiraux committed
63
64
65
66
67
68
69
robot_capsule_urdf_branch=groovy
robot_capsule_urdf_repository=${LAAS_REPO}

robot_model_py_branch=groovy
robot_model_py_repository=${LAAS_REPO}

hpp-doc_branch=master
70
hpp-doc_repository=${TRAC_REPO}/doc
Florent Lamiraux's avatar
Florent Lamiraux committed
71

72
hpp-manipulation_branch=master
73
74
75
76
77
78
79
hpp-manipulation_repository=${TRAC_REPO}/algo

tinyxml2_branch=master
tinyxml2_repository=${TINYXML2_REPO}

hpp-manipulation-urdf_branch=master
hpp-manipulation-urdf_repository=${TRAC_REPO}/algo
Florent Lamiraux's avatar
Florent Lamiraux committed
80

81
hpp-manipulation-corba_branch=master
82
hpp-manipulation-corba_repository=${TRAC_REPO}/corba
83
84

airbus_ros_branch=master
85
airbus_ros_repository=${TRAC_REPO}/ros
86
87

airbus_environment_branch=master
88
airbus_environment_repository=${TRAC_REPO}/data
89

90
91
92
93
94
95
robot_state_chain_publisher_branch=master
robot_state_chain_publisher_repository=${HPP_REPO}

iai_maps_branch=master
iai_maps_repository=${HPP_REPO}

Florent Lamiraux's avatar
Florent Lamiraux committed
96
hpp_tutorial_branch=master
97
hpp_tutorial_repository=${TRAC_REPO}/algo
98
99
100

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

102
all: hpp_tutorial.install hpp-manipulation-corba.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
tinyxml2.configure.dep: tinyxml2.checkout
123
124
hpp-manipulation-urdf.configure.dep:hpp-manipulation.install tinyxml2.install \
	hpp-manipulation-urdf.checkout
125
126
127
128
129
130
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
131
hpp-manipulation-corba.configure.dep: hpp-manipulation-urdf.install \
132
133
134
135
136
137
138
139
140
141
142
143
144
145
	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
hpp_ros.configure.dep: hpp-corbaserver.install hpp_ros.checkout
test-hpp.configure.dep: hpp-wholebody-step-corba.install \
	hpp_ros.install hpp-hrp2.install test-hpp.checkout
airbus_ros.configure.dep: airbus_environment.install \
	hpp-manipulation-corba.install airbus_ros.checkout
airbus_environment.configure.dep: hpp_ros.install airbus_environment.checkout
146
147
robot_state_chain_publisher.configure.dep: robot_state_chain_publisher.checkout
iai_maps.configure.dep: robot_state_chain_publisher.install iai_maps.checkout
Florent Lamiraux's avatar
Florent Lamiraux committed
148
149
hpp_tutorial.configure.dep: iai_maps.install hpp-corbaserver.install \
	hpp_ros.install hpp_tutorial.checkout
150
hpp_benchmark.configure.dep: hpp_benchmark.checkout
151
152

status:
153
154
155
156
157
158
	@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"; \
159
		git --no-pager -c status.showUntrackedFiles=no status --short --branch; \
160
161
		cd ..; \
	done
162

Florent Lamiraux's avatar
Florent Lamiraux committed
163
164
165
166
167
168
169
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

170
171
172
173
update:
	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_ros hpp-manipulation hpp-manipulation-corba airbus_ros airbus_environment hpp-doc ; do \
	echo "Updating $$d";\
	make $$d.update; done
Florent Lamiraux's avatar
Florent Lamiraux committed
174
175
176

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

%.update:
	cd ${SRC_DIR}/$(@:.update=);\
	git remote set-url origin ${$(@:.update=)_repository}/$(@:.update=);\
	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

192
%.configure:%.configure.dep
Florent Lamiraux's avatar
Florent Lamiraux committed
193
194
195
	cd ${SRC_DIR}/$(@:.configure=);\
	mkdir -p build; \
	cd ${SRC_DIR}/$(@:.configure=)/build; \
Florent Lamiraux's avatar
Florent Lamiraux committed
196
	cmake -DCMAKE_INSTALL_PREFIX=${DEVEL_DIR}/install -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-g -O3 -DNDEBUG" ..
Florent Lamiraux's avatar
Florent Lamiraux committed
197

Florent Lamiraux's avatar
Florent Lamiraux committed
198
%.install:%.configure
Florent Lamiraux's avatar
Florent Lamiraux committed
199
200
201
202
203
204
205
206
207
208
209
	cd ${SRC_DIR}/$(@:.install=)/build;\
	make install

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

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

210
211
212
%.very-clean:
	rm -rf ${SRC_DIR}/$(@:.very-clean=)/build/*

Florent Lamiraux's avatar
Florent Lamiraux committed
213
214
215
%.status:
	cd ${SRC_DIR}/$(@:.status=); git status

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

eigen3.checkout:
232
233
234
235
236
237
238
239
	if [ -d $(@:.checkout=) ]; then \
		echo "$(@:.checkout=) already checkout out."; \
	else \
		wget -O eigen3.tar.bz2 \
		http://bitbucket.org/eigen/eigen/get/3.2.1.tar.bz2;\
		cd ${SRC_DIR}; bunzip2 eigen3.tar.bz2; tar xvf eigen3.tar;\
		rm -f eigen3.tar; mv eigen-eigen-6b38706d90a9 eigen3;\
	fi
Florent Lamiraux's avatar
Florent Lamiraux committed
240

241
eigen3.configure: eigen3.configure.dep
Florent Lamiraux's avatar
Florent Lamiraux committed
242
243
244
245
246
	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 ..

247
hrp2.configure: hrp2.configure.dep
Florent Lamiraux's avatar
Florent Lamiraux committed
248
	. ${DEVEL_DIR}/install/setup.sh; \
Florent Lamiraux's avatar
Florent Lamiraux committed
249
250
251
252
253
	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
254
hrp2.install: hrp2.configure
Florent Lamiraux's avatar
Florent Lamiraux committed
255
256
257
	cd ${SRC_DIR}/hrp2/hrp2_14_description/build;\
	make install

258
robot_model_py.configure: robot_model_py.configure.dep
Florent Lamiraux's avatar
Florent Lamiraux committed
259
260
261
262
263
264
265
266
	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
267

Florent Lamiraux's avatar
Florent Lamiraux committed
268
robot_model_py.install: robot_model_py.configure
Marine Heckler's avatar
Marine Heckler committed
269
270
271
272
	cd ${SRC_DIR}/$(@:.install=)/xml_reflection/build; \
	make install; \
	cd ${SRC_DIR}/$(@:.install=)/urdf_parser_py/build; \
	make install;