-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathMakefile
More file actions
125 lines (98 loc) · 4.27 KB
/
Makefile
File metadata and controls
125 lines (98 loc) · 4.27 KB
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
SHELL:=/bin/bash
MAKEFLAGS += --no-print-directory
.NOTPARALLEL:
ROOT_DIR:=$(shell dirname "$(realpath $(firstword $(MAKEFILE_LIST)))")
# This will automatically check if submodules have been updated when the
# Makefile is invoked for the first time.
MAKE_GADGETS_DIR := adore_cli/make_gadgets
MAKE_GADGETS_HAS_FILES := $(shell [ -d $(MAKE_GADGETS_DIR) ] && [ -n "$$(find $(MAKE_GADGETS_DIR) -mindepth 1 -maxdepth 1 -not -name '.git' 2>/dev/null)" ] && echo "yes")
ifeq ($(MAKE_GADGETS_HAS_FILES),)
$(shell git submodule update --init --recursive >&2 || true)
endif
$(shell git config core.hooksPath .githooks >&2 || true)
include ${MAKE_GADGETS_DIR}/make_gadgets.mk
.EXPORT_ALL_VARIABLES:
SOURCE_DIRECTORY:=${ROOT_DIR}
SUBMODULES_PATH:=${ROOT_DIR}
VENDOR_PATH:=${ROOT_DIR}/vendor
ROS_NODE_PATH:=${ROOT_DIR}/ros2_workspace/src
ADORE_LIBRARY_PATH:=${ROOT_DIR}/libraries
DOCKER_BUILDKIT?=1
DOCKER_CONFIG?=
# Branch information
BRANCH:=$(shell bash ${MAKE_GADGETS_DIR}/tools/branch_name.sh)
include ${SUBMODULES_PATH}/adore_cli/ci_teststand/ci_teststand.mk
include utils.mk
include adore_cli/adore_cli.mk
include adore_cli/package.mk
.PHONY: clean
clean: stop docker_host_context_check stop clean_adore_cli clean_tag_history ## Clean ADORe build artifacts
cd vendor && make clean
cd ros2_workspace && make clean
cd adore_embedded && make clean
rm -rf build
$(shell [ -d "$(VENDOR_PATH)/build" ] || (cd vendor && $(MAKE) --no-print-directory build >&2))
.PHONY: build
build: docker_host_context_check stop_adore_cli build_vendor_libraries build_adore_cli build_ros_workspace build_services ## Build and setup adore cli
@make clean_tag_history
.PHONY: build_adore_embedded
build_adore_embedded: docker_host_context_check # Build ADORe Embedded docker image
cd adore_embedded && make build
.PHONY: build_all
build_all: clean build #build_services
.PHONY: build_services
build_services: ## Build ADORe supporting services such as Foxglove Studio aka Lichtblick Suite
cd tools/lichtblick && make build
.PHONY: start_services
start_services: docker_host_context_check ## Start ADORe supporting services
cd tools/lichtblick && make start
.PHONY: stop_services
stop_services: docker_host_context_check ## Stop ADORe supporting services
cd tools/lichtblick && make stop
.PHONY: build_vendor_libraries
build_vendor_libraries: docker_host_context_check ## Builds vendor libraries located in: ${VENDOR_PATH}
cd "${VENDOR_PATH}" && make build
.PHONY: build_documentation
build_documentation: docker_host_context_check ## Builds ADORe Documentation in: ./documentation
echo todo
#cd documentation && make build
.PHONY: build_ros_workspace
build_ros_workspace: ## Builds ROS2 workspace located in: ${ROS_NODE_PATH}
if [ -f /.dockerenv ]; then \
cd ros2_workspace && make build; \
else \
make run cmd="cd ros2_workspace && make build"; \
fi
.PHONY: check_adore_binaries
check_adore_binaries: ## Checks for ADORe binaries
bash tools/check_adore_binaries.sh
.PHONY: lint_nodes
lint_nodes:
@if [ -f /.dockerenv ]; then \
clang-format -Werror -i -output-replacements-xml --checks=* -dry-run $(shell find ros2_workspace/src -type f \( -name "*.cpp" -or -name "*.hpp" -or -name "*.h" \)); \
else \
make run cmd="clang-format -Werror -i --checks=* -output-replacements-xml -dry-run $(shell find ros2_workspace/src -type f \( -name "*.cpp" -or -name "*.hpp" -or -name "*.h" \))"; \
fi
.PHONY: due_diligence_scan
due_diligence_scan: ## Scan repo for eclipse due diligence, checks if source files have the proper doc header.
python3 tools/eclipse_due_diligence_scanner.py --ignore tools/.eclipse_due_diligance_ignore
.PHONY: due_diligence_fix
due_diligence_fix: ## Fix due diligence issues
python3 tools/eclipse_due_diligence_scanner.py --ignore tools/.eclipse_due_diligance_ignore --fix
.PHONY: benchmark
benchmark: ## Run the ROS Topic benchmark script
if [ -f /.dockerenv ]; then \
bash tools/ros_topic_benchmark.sh; \
else \
make run cmd="bash tools/ros_topic_benchmark.sh"; \
fi
.PHONY: package_adore_ros2_msgs
package_adore_ros2_msgs: ## Build & package adore_ros2_msgs
if [ -f /.dockerenv ]; then \
cd ros2_workspace && make package_adore_ros2_msgs; \
else \
make run cmd="cd ros2_workspace && make package_adore_ros2_msgs"; \
fi
.PHONY: test
test: ## Run ADORe Unit Tests
bash .ci test