-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
87 lines (65 loc) · 2.84 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
SHELL:=/bin/bash
ROOT_DIR:=$(shell dirname "$(realpath $(firstword $(MAKEFILE_LIST)))")
MAKE_GADGETS_DIR:=tools/adore_cli/make_gadgets
MAKE_GADGETS_FILES := $(wildcard $(MAKE_GADGETS_DIR)/*)
ifeq ($(MAKE_GADGETS_FILES),)
$(shell git submodule update --init)
endif
include ${MAKE_GADGETS_DIR}/make_gadgets.mk
#include tools/make_gadgets/docker/docker-tools.mk
.EXPORT_ALL_VARIABLES:
SOURCE_DIRECTORY:=${ROOT_DIR}
ADORE_CLI_WORKING_DIRECTORY:=${ROOT_DIR}
ADORE_DIRECTORY:=${ROOT_DIR}
SUBMODULES_PATH:=${ROOT_DIR}/tools
VENDOR_PATH:=${ROOT_DIR}/vendor
ROS_NODE_PATH:=${ROOT_DIR}/ros2_workspace/src
ADORE_LIBRARY_PATH:=${ROOT_DIR}/libraries
#BRANCH:=$(shell make get_sanitized_branch_name)
BRANCH:=$(shell bash ${MAKE_GADGETS_DIR}/tools/branch_name.sh)
ADORE_CLI_BRANCH:=$(shell bash ${MAKE_GADGETS_DIR}/tools/branch_name.sh)
ADORE_CLI_IMAGE:=$(shell cd tools/adore_cli && make image_adore_cli)_${BRANCH}
ADORE_CLI_CONTAINER_NAME:=$(subst :,_,${ADORE_CLI_IMAGE})
include ${SUBMODULES_PATH}/adore_cli/ci_teststand/ci_teststand.mk
include utils.mk
include tools/adore_cli/adore_cli.mk
.PHONY: build
build: clean stop_adore_cli build_vendor_libraries build_adore_cli_core build_adore_cli build_user_libraries build_ros_nodes ## Build and setup adore cli
.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: ## Start ADORe supporting services
cd tools/lichtblick && make start
.PHONY: stop_services
stop_services: ## Stop ADORe supporting services
cd tools/lichtblick && make stop
.PHONY: build_vendor_libraries
build_vendor_libraries: ## Builds vendor libraries located in: ${VENDOR_PATH}
cd "${VENDOR_PATH}" && make build
.PHONY: build_user_libraries
build_user_libraries: ## Builds user libraries located in: ${ADORE_LIBRARY_PATH}
make run cmd="cd libraries && make build"
.PHONY: build_documentation
build_documentation: ## Builds ADORe Documentation in: ./documentation
cd documentation && make build
.PHONY: build_ros_nodes
build_ros_nodes: ## Builds ROS2 nodes located in: ${ROS_NODE_PATH}
make run cmd="cd ros2_workspace && make build"
.PHONY: clean
clean: clean_adore_cli ## Clean ADORe build artifacts
cd vendor && make clean
cd libraries && make clean
cd ros2_workspace && make clean
rm -rf build
.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: test
test: ci_test