From: German Service Network Date: Sat, 13 Dec 2025 10:21:14 +0000 (+0100) Subject: Create Makefile X-Git-Url: https://git.gsnw.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b58937e1f75a9c632136f1aa8f321fd78a62c862;p=EnergyLogger4000-Reader.git Create Makefile --- diff --git a/Makefile b/Makefile new file mode 100644 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