-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
33 lines (24 loc) · 1.08 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
LINTER_PARAMS=--root=AVR-HAL --extensions=hpp,cpp,h,c --filter=-legal/copyright,-build/include,-runtime/arrays,-runtime/references,-build/c++11,-build/namespaces,-runtime/explicit,-runtime/printf,-runtime/int --linelength=150
SOURCES := $(shell find . -type f \( -name "*.cpp" -o -name "*.h" \) | grep -v "cmake-build")
all: unit_tests_run examples SingleDeviceTests checkFormat checkStyle
.PHONY: clean checkStyle format checkFormat examples unit_tests_run SingleDeviceTests
clean:
make -C examples clean
rm -rf unit_tests/cmake-build
rm -rf tests/SingleDevice/cmake-build
checkStyle:
@cpplint $(LINTER_PARAMS) $(SOURCES)
format:
@clang-format-5.0 -i $(SOURCES)
checkFormat:
@! clang-format-5.0 $(SOURCES) -output-replacements-xml | grep -c "<replacement " >/dev/null
@echo "Format OK"
examples:
make -C examples
unit_tests_run:
cd unit_tests; mkdir cmake-build; cd cmake-build; cmake ..
make -C unit_tests/cmake-build unit_tests.run -j5
@echo "Success!"
SingleDeviceTests:
cd tests/SingleDevice; mkdir cmake-build; cd cmake-build; cmake ..
make -C tests/SingleDevice/cmake-build -j5