-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
177 lines (136 loc) · 4.33 KB
/
Makefile
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# url: https://github.com/osrf/docker_images/blob/d9efe4367b9d376fd97a154bdaba896ca0382645/docker/Makefile
.ONESHELL:
all: help
help: ## Show this help. (press tab to complete)
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
##-------------
clean: ## clean all (volumes, images, rosserial, arduino, ins)
clean: clean-volumes clean-images
clean-images: \
clean-rosserial-images \
clean-arduino-images \
clean-ins-images
clean-volumes: \
clean-rosserial-volumes \
clean-arduino-volumes \
clean-ins-volumes
clean-rosserial-images:
(cd rosserial/latest; rmi.sh 2> /dev/null || true)
clean-rosserial-volumes:
(cd rosserial/latest; delete_volume.sh 2> /dev/null || true)
clean-arduino-images:
(cd arduino; rmi.sh 2> /dev/null || true)
clean-arduino-volumes:
(cd arduino; delete_volume.sh 2> /dev/null || true)
clean-ins-images:
(cd ins; rmi.sh 2> /dev/null || true)
clean-ins-volumes:
(cd ins; delete_volume.sh 2> /dev/null || true)
clean-laser-volumes:
(cd laser; rmi.sh 2> /dev/null || true)
clean-laser-images:
(cd laser; delete_volume.sh 2> /dev/null || true)
##-------------
.ressources: .dir_ressources .apt.conf .gitconfig .proxy.list
@echo $@
.dir_ressources:
@(mkdir -p ressources)
.apt.conf:
@( \
if [ -f /etc/apt/apt.conf ]; then \
cp /etc/apt/apt.conf ressources/.; \
else \
touch ressources/apt.conf; \
fi; \
)
.gitconfig:
( \
if [ -f ~/.gitconfig ]; then \
cp ~/.gitconfig ressources/.; \
else \
touch ressources/.gitconfig; \
fi; \
)
# utiliser dans scripts/run.sh
.proxy.list:
@( \
if [ ! -f ressources/proxy.list ]; then \
touch ressources/apt.conf; \
fi; \
)
##-------------
li3ds: li3ds-all
li3ds-all: ros rosserial arduino ins laser
##-------------
ros: ## ros for LI3DS [DEV]
ros: .ressources ros-all
ros-all:
(cd ros; \
cp ${LI3DS_RESSOURCES_PATH}/apt.conf .; \
cp ${LI3DS_RESSOURCES_PATH}/.gitconfig .; \
build.sh \
)
##-------------
rosserial: ## rosserial
rosserial: rosserial-all
rosserial-all: ros rosserial-volumes rosserial-images
rosserial-volumes:
(cd rosserial/latest; create_volume.sh)
rosserial-images: rosserial-volumes
(cd rosserial/latest; build.sh; run.sh )
##-------------
##| ARDUINO |
##-------------
arduino: ## build all (volumes, images, build, (run))
arduino: arduino-all
arduino-all: rosserial arduino-volumes arduino-images \
arduino-configure \
arduino-build \
arduino-upload
arduino-images: rosserial-images
(cd arduino; build.sh)
arduino-volumes: rosserial-volumes
arduino-clean:
(cd arduino; run.sh 'bash -c "/root/clean.sh"')
arduino-configure:
(cd arduino; run.sh 'bash -c "/root/configure.sh"')
arduino-build:
(cd arduino; run.sh 'bash -c "/root/build.sh"')
arduino-upload:
(cd arduino; run.sh 'bash -c "/root/upload.sh"')
arduino-run:
@( echo; echo "Type 'source /opt/ros/indigo/setup.bash' to set env. vars"; echo; \
docker exec -it rosnode_li3ds_arduino bash \
)
##-------------
##| INS |
##-------------
ins: ## build all (volumes, images, build, (run))
ins: ins-all
ins-all: ros ins-volumes ins-images ins-build
ins-volumes:
(cd ins; create_volume.sh)
ins-images:
(cd ins; build.sh)
ins-build:
(cd ins; run.sh 'bash -c "/root/build.sh"')
ins-run:
@( echo; echo "Type 'source entry-point.sh' to set env. vars"; echo; \
docker exec -it rosnode_li3ds_ins bash \
)
##-------------
##| LASER |
##-------------
laser: ## build all (volumes, images, build, (run))
laser: laser-all
laser-all: ros laser-volumes laser-images laser-build
laser-volumes:
(cd laser; create_volume.sh)
laser-images:
(cd laser; build.sh)
laser-build:
(cd laser; run.sh 'bash -c "/root/build.sh"')
laser-run:
@( echo; echo "Type 'source entry-point.sh' to set env. vars"; echo; \
docker exec -it rosnode_li3ds_laser bash \
)