]> git.gsnw.org Git - EnergyLogger4000-Reader.git/commitdiff
Create Makefile
authorGerman Service Network <support@gsnw.de>
Sat, 13 Dec 2025 10:21:14 +0000 (11:21 +0100)
committerGerman Service Network <support@gsnw.de>
Sat, 13 Dec 2025 10:21:14 +0000 (11:21 +0100)
Makefile [new file with mode: 0644]

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..7c08428
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,36 @@
+MKFILE_PATH := $(patsubst %/,%, $(dir $(realpath $(firstword $(MAKEFILE_LIST)))))
+DATE := $(shell date +%Y-%m-%d)
+
+.DEFAULT_GOAL := help
+
+check_and_install_rust:
+       @if command -v rustc >/dev/null 2>&1; then \
+               echo "Rust is already installed"; \
+       else \
+               echo "Rust is not installed"; \
+               curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y; \
+               export PATH="$HOME/.cargo/bin:$PATH"; \
+               echo "Rust has been installed"; \
+       fi
+
+build: check_and_install_rust
+       cargo build
+
+build-release: check_and_install_rust
+       cargo build --release
+
+clean:
+       cargo clean
+
+update:
+       cargo update
+
+test:
+       cargo test --test binary_integration_test -- --nocapture
+
+help:
+       @echo "build : Build debug binary"
+       @echo "build-release : Build release binary"
+       @echo "clean : Clean cargo"
+       @echo "update : Update cargo packages"
+       @echo "test : Startet cargo test mit println Ausgabe"
\ No newline at end of file