11# AimDB Makefile
22# Simple automation for common development tasks
33
4- .PHONY : help build test clean fmt fmt-check clippy doc all check test-embedded test-wasm wasm wasm-test examples deny audit security publish publish-check
4+ .PHONY : help build test clean clean-embedded fmt fmt-check clippy doc all check test-embedded test-wasm wasm wasm-test examples deny audit security publish publish-check
55.DEFAULT_GOAL := help
66
7+ # Separate target dir for embedded checks so an interrupted example build
8+ # (cargo build --target thumbv7em-none-eabihf) cannot leave corrupted .rmeta
9+ # files that break the next cargo check run (E0786). Clean it with
10+ # `make clean-embedded`.
11+ EMBEDDED_CHECK_TARGET_DIR := target/embedded-check
12+
713# Colors for output
814GREEN := \033[0;32m
915YELLOW := \033[0;33m
@@ -255,6 +261,12 @@ doc:
255261clean :
256262 @printf " $( GREEN) Cleaning...$( NC) \n"
257263 cargo clean
264+ @rm -rf $(EMBEDDED_CHECK_TARGET_DIR )
265+
266+ clean-embedded :
267+ @printf " $( GREEN) Cleaning embedded check artifacts...$( NC) \n"
268+ @rm -rf $(EMBEDDED_CHECK_TARGET_DIR )
269+ cargo clean --target thumbv7em-none-eabihf
258270
259271# # Testing commands
260272test-wasm :
@@ -266,29 +278,29 @@ test-wasm:
266278test-embedded :
267279 @printf " $( BLUE) Testing embedded/MCU cross-compilation compatibility...$( NC) \n"
268280 @printf " $( YELLOW) → Checking aimdb-data-contracts (no_std + alloc) on thumbv7em-none-eabihf target$( NC) \n"
269- cargo check --package aimdb-data-contracts --target thumbv7em-none-eabihf --no-default-features --features alloc
281+ cargo check --package aimdb-data-contracts --target thumbv7em-none-eabihf --target-dir $( EMBEDDED_CHECK_TARGET_DIR ) -- no-default-features --features alloc
270282 @printf " $( YELLOW) → Checking aimdb-core (no_std minimal) on thumbv7em-none-eabihf target$( NC) \n"
271- cargo check --package aimdb-core --target thumbv7em-none-eabihf --no-default-features --features alloc
283+ cargo check --package aimdb-core --target thumbv7em-none-eabihf --target-dir $( EMBEDDED_CHECK_TARGET_DIR ) -- no-default-features --features alloc
272284 @printf " $( YELLOW) → Checking aimdb-core (no_std + alloc + json-serialize) on thumbv7em-none-eabihf target$( NC) \n"
273- cargo check --package aimdb-core --target thumbv7em-none-eabihf --no-default-features --features " alloc,json-serialize"
285+ cargo check --package aimdb-core --target thumbv7em-none-eabihf --target-dir $( EMBEDDED_CHECK_TARGET_DIR ) -- no-default-features --features " alloc,json-serialize"
274286 @printf " $( YELLOW) → Checking aimdb-core (no_std/embassy) on thumbv7em-none-eabihf target$( NC) \n"
275- cargo check --package aimdb-core --target thumbv7em-none-eabihf --no-default-features --features alloc
287+ cargo check --package aimdb-core --target thumbv7em-none-eabihf --target-dir $( EMBEDDED_CHECK_TARGET_DIR ) -- no-default-features --features alloc
276288 @printf " $( YELLOW) → Checking aimdb-embassy-adapter on thumbv7em-none-eabihf target$( NC) \n"
277- cargo check --package aimdb-embassy-adapter --target thumbv7em-none-eabihf --no-default-features --features " embassy-runtime"
289+ cargo check --package aimdb-embassy-adapter --target thumbv7em-none-eabihf --target-dir $( EMBEDDED_CHECK_TARGET_DIR ) -- no-default-features --features " embassy-runtime"
278290 @printf " $( YELLOW) → Checking aimdb-embassy-adapter with network support on thumbv7em-none-eabihf target$( NC) \n"
279- cargo check --package aimdb-embassy-adapter --target thumbv7em-none-eabihf --no-default-features --features " embassy-runtime,embassy-net-support"
291+ cargo check --package aimdb-embassy-adapter --target thumbv7em-none-eabihf --target-dir $( EMBEDDED_CHECK_TARGET_DIR ) -- no-default-features --features " embassy-runtime,embassy-net-support"
280292 @printf " $( YELLOW) → Checking aimdb-embassy-adapter with profiling on thumbv7em-none-eabihf target$( NC) \n"
281- cargo check --package aimdb-embassy-adapter --target thumbv7em-none-eabihf --no-default-features --features " embassy-runtime,profiling"
293+ cargo check --package aimdb-embassy-adapter --target thumbv7em-none-eabihf --target-dir $( EMBEDDED_CHECK_TARGET_DIR ) -- no-default-features --features " embassy-runtime,profiling"
282294 @printf " $( YELLOW) → Checking aimdb-embassy-adapter with metrics on thumbv7em-none-eabihf target$( NC) \n"
283- cargo check --package aimdb-embassy-adapter --target thumbv7em-none-eabihf --no-default-features --features " embassy-runtime,metrics"
295+ cargo check --package aimdb-embassy-adapter --target thumbv7em-none-eabihf --target-dir $( EMBEDDED_CHECK_TARGET_DIR ) -- no-default-features --features " embassy-runtime,metrics"
284296 @printf " $( YELLOW) → Checking aimdb-mqtt-connector (Embassy) on thumbv7em-none-eabihf target$( NC) \n"
285- cargo check --package aimdb-mqtt-connector --target thumbv7em-none-eabihf --no-default-features --features " embassy-runtime"
297+ cargo check --package aimdb-mqtt-connector --target thumbv7em-none-eabihf --target-dir $( EMBEDDED_CHECK_TARGET_DIR ) -- no-default-features --features " embassy-runtime"
286298 @printf " $( YELLOW) → Checking aimdb-mqtt-connector (Embassy + defmt) on thumbv7em-none-eabihf target$( NC) \n"
287- cargo check --package aimdb-mqtt-connector --target thumbv7em-none-eabihf --no-default-features --features " embassy-runtime,defmt"
299+ cargo check --package aimdb-mqtt-connector --target thumbv7em-none-eabihf --target-dir $( EMBEDDED_CHECK_TARGET_DIR ) -- no-default-features --features " embassy-runtime,defmt"
288300 @printf " $( YELLOW) → Checking aimdb-knx-connector (Embassy) on thumbv7em-none-eabihf target$( NC) \n"
289- cargo check --package aimdb-knx-connector --target thumbv7em-none-eabihf --no-default-features --features " embassy-runtime"
301+ cargo check --package aimdb-knx-connector --target thumbv7em-none-eabihf --target-dir $( EMBEDDED_CHECK_TARGET_DIR ) -- no-default-features --features " embassy-runtime"
290302 @printf " $( YELLOW) → Checking aimdb-knx-connector (Embassy + defmt) on thumbv7em-none-eabihf target$( NC) \n"
291- cargo check --package aimdb-knx-connector --target thumbv7em-none-eabihf --no-default-features --features " embassy-runtime,defmt"
303+ cargo check --package aimdb-knx-connector --target thumbv7em-none-eabihf --target-dir $( EMBEDDED_CHECK_TARGET_DIR ) -- no-default-features --features " embassy-runtime,defmt"
292304
293305# # Example projects
294306examples :
0 commit comments