-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
57 lines (44 loc) · 1.43 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
.PHONY: clean test coverage asan format format-check ci lf-test lib proto examples
test: unit-test examples
# Generate protobuf code
proto:
python3 external/nanopb/generator/nanopb_generator.py -Iexternal/nanopb/generator/proto/ -Iexternal/proto -L'#include "nanopb/%s"' -Dexternal/proto message.proto
# Build reactor-uc as a static library
lib:
cmake -Bbuild
cmake --build build
make -C build
# Build federated example
examples:
cmake -Bbuild/posix/federated/ examples/posix/federated
make -C build/posix/federated/
# Build and run the unit tests
unit-test:
cmake -Bbuild -DBUILD_TESTS=ON
cmake --build build
make test -C build
# Build and run lf tests
lf-test:
make -C test/lf
# Get coverage data on unit tests
coverage:
cmake -Bbuild -DBUILD_TESTS=ON -DTEST_COVERAGE=ON
cmake --build build
make coverage -C build
# Compile tests with AddressSanitizer and run them
asan:
cmake -Bbuild -DASAN=ON -DBUILD_TESTS=ON
cmake --build build
make test -C build
# Format the code base
SRC_FILES := $(shell find ./src -path ./src/generated -prune -o -name '*.c' -print)
HDR_FILES := $(shell find ./include -path ./include/reactor-uc/generated -prune -o -name '*.h' -print)
format:
clang-format -i -style=file $(SRC_FILES) $(HDR_FILES)
# Check that the code base is formatted
format-check:
clang-format --dry-run --Werror -style=file $(SRC_FILES) $(HDR_FILES)
# Run the entire CI flow
ci: clean test coverage format-check
clean:
rm -rf build