This repository has been archived by the owner on Nov 8, 2024. It is now read-only.
forked from foxglove/ros-foxglove-bridge
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
63 lines (47 loc) · 2.09 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
ROS1_DISTRIBUTIONS := melodic noetic
ROS2_DISTRIBUTIONS := galactic humble iron rolling
define generate_ros1_targets
.PHONY: $(1)
$(1):
docker build -t foxglove_bridge_$(1) --pull -f Dockerfile.ros1 --build-arg ROS_DISTRIBUTION=$(1) .
.PHONY: $(1)-test
$(1)-test: $(1)
docker run -t --rm foxglove_bridge_$(1) bash -c "catkin_make run_tests && catkin_test_results"
.PHONY: $(1)-boost-asio
$(1)-boost-asio:
docker build -t foxglove_bridge_$(1)_boost_asio --pull -f Dockerfile.ros1 --build-arg ROS_DISTRIBUTION=$(1) --build-arg USE_ASIO_STANDALONE=OFF .
.PHONY: $(1)-test-boost-asio
$(1)-test-boost-asio: $(1)-boost-asio
docker run -t --rm foxglove_bridge_$(1)_boost_asio bash -c "catkin_make run_tests && catkin_test_results"
endef
define generate_ros2_targets
.PHONY: $(1)
$(1):
docker build -t foxglove_bridge_$(1) --pull -f Dockerfile.ros2 --build-arg ROS_DISTRIBUTION=$(1) .
.PHONY: $(1)-test
$(1)-test: $(1)
docker run -t --rm foxglove_bridge_$(1) colcon test --event-handlers console_cohesion+ --return-code-on-test-failure
.PHONY: $(1)-boost-asio
$(1)-boost-asio:
docker build -t foxglove_bridge_$(1)-boost-asio --pull -f Dockerfile.ros2 --build-arg ROS_DISTRIBUTION=$(1) --build-arg USE_ASIO_STANDALONE=OFF .
.PHONY: $(1)-test-boost-asio
$(1)-test-boost-asio: $(1)-boost-asio
docker run -t --rm foxglove_bridge_$(1)-boost-asio colcon test --event-handlers console_cohesion+ --return-code-on-test-failure
endef
$(foreach distribution,$(ROS1_DISTRIBUTIONS),$(eval $(call generate_ros1_targets,$(strip $(distribution)))))
$(foreach distribution,$(ROS2_DISTRIBUTIONS),$(eval $(call generate_ros2_targets,$(strip $(distribution)))))
default: ros2
.PHONY: ros1
ros1:
docker build -t foxglove_bridge_ros1 --pull -f Dockerfile.ros1 .
.PHONY: ros2
ros2:
docker build -t foxglove_bridge_ros2 --pull -f Dockerfile.ros2 .
.PHONY: rosdev
rosdev:
docker build -t foxglove_bridge_rosdev --pull -f .devcontainer/Dockerfile .
clean:
docker rmi $(docker images --filter=reference="foxglove_bridge_*" -q)
.PHONY: lint
lint: rosdev
docker run -t --rm -v $(CURDIR):/src foxglove_bridge_rosdev python3 /src/scripts/format.py /src