Fix picture and update links (#12244)
[betaflight.git] / make / checks.mk
blobd506fe0cc36fd925ea1ce45d102afc2c1bb59d3c
1 checks: check-target-independence \
2 check-fastdata-usage-correctness \
3 check-platform-included
5 check-target-independence:
6 $(V1) for test_target in $(VALID_TARGETS); do \
7 FOUND=$$(grep -rE "\W$${test_target}(\W.*)?$$" src/main | grep -vE "(//)|(/\*).*\W$${test_target}(\W.*)?$$" | grep -vE "^src/main/target"); \
8 if [ "$${FOUND}" != "" ]; then \
9 echo "Target dependencies for target '$${test_target}' found:"; \
10 echo "$${FOUND}"; \
11 exit 1; \
12 fi; \
13 done
15 check-fastdata-usage-correctness:
16 $(V1) NON_TRIVIALLY_INITIALIZED=$$(grep -Ern "\W?FAST_DATA_ZERO_INIT\W.*=.*" src/main/ | grep -Ev "=\s*(false|NULL|0(\.0*f?)?)\s*[,;]"); \
17 if [ "$${NON_TRIVIALLY_INITIALIZED}" != "" ]; then \
18 echo "Non-trivially initialized FAST_DATA_ZERO_INIT variables found, use FAST_DATA instead:"; \
19 echo "$${NON_TRIVIALLY_INITIALIZED}"; \
20 exit 1; \
21 fi; \
22 TRIVIALLY_INITIALIZED=$$(grep -Ern "\W?FAST_DATA\W.*;" src/main/ | grep -v "="); \
23 EXPLICITLY_TRIVIALLY_INITIALIZED=$$(grep -Ern "\W?FAST_DATA\W.*;" src/main/ | grep -E "=\s*(false|NULL|0(\.0*f?)?)\s*[,;]"); \
24 if [ "$${TRIVIALLY_INITIALIZED}$${EXPLICITLY_TRIVIALLY_INITIALIZED}" != "" ]; then \
25 echo "Trivially initialized FAST_DATA variables found, use FAST_DATA_ZERO_INIT instead to save FLASH:"; \
26 echo "$${TRIVIALLY_INITIALIZED}\n$${EXPLICITLY_TRIVIALLY_INITIALIZED}"; \
27 exit 1; \
30 check-platform-included:
31 $(V1) PLATFORM_NOT_INCLUDED=$$(find src/main -type d -name target -prune -o -type f -name \*.c -exec grep -L "^#include \"platform.h\"" {} \;); \
32 if [ "$$(echo $${PLATFORM_NOT_INCLUDED} | grep -v -e '^$$' | wc -l)" -ne 0 ]; then \
33 echo "The following compilation units do not include the required target specific configuration provided by 'platform.h':"; \
34 echo "$${PLATFORM_NOT_INCLUDED}"; \
35 exit 1; \