-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (38 loc) · 1.15 KB
/
Makefile
File metadata and controls
47 lines (38 loc) · 1.15 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
# Copyright (c) 2023 Dmitry Ponomarev
# Distributed under the MPL v2.0 License, available in the file LICENSE.
# Author: Dmitry Ponomarev <ponomarevda96@gmail.com>
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
BUILD_DIR:=$(ROOT_DIR)/build
BUILD_EXAMPLES_DIR:=$(BUILD_DIR)/src/examples
define build_sitl
$(info Build example $(1)...)
mkdir -p $(BUILD_EXAMPLES_DIR)/$(1)
cd $(BUILD_EXAMPLES_DIR)/$(1) && cmake $(ROOT_DIR)/examples/$(1) && make -s
endef
define run_sitl
$(info Run example $(1)...)
$(BUILD_EXAMPLES_DIR)/$(1)/ubuntu
endef
.PHONY: ubuntu ubuntu-build ubuntu-run
ubuntu-build:
$(call build_sitl,ubuntu)
ubuntu-run:
@if [ ! -x "$(BUILD_EXAMPLES_DIR)/ubuntu/ubuntu" ]; then \
$(MAKE) ubuntu-build; \
fi
$(call run_sitl,ubuntu)
ubuntu: ubuntu-build
$(call run_sitl,ubuntu)
clean:
rm -rf build/examples/
code_style: cpplint cppcheck crlf
astyle:
./scripts/code_style/check_astyle.py src include --astylerc scripts/code_style/astylerc
cpplint:
cpplint src/*.cpp include/libdcnode/*.h include/libdcnode/*.hpp
cppcheck:
./scripts/code_style/cppcheck.sh
crlf:
./scripts/code_style/check_crlf.sh
distclean:
rm -rf build/