diff --git a/Makefile b/Makefile index 55017ad..5be5095 100644 --- a/Makefile +++ b/Makefile @@ -6,24 +6,24 @@ LIBS=$(shell pkg-config --libs libbsd libconfig libmodbus libmosquitto) -pthread SRCS=src/* TESTS=tests/*.c -all: growatt +all: growatt_exporter doc: $(SRCS) doxygen .doxygen -growatt: $(SRCS) - $(CC) -v $(CFLAGS) $(LIBS) -Wall -Werror -O3 -o growatt src/*.c +growatt_exporter: $(SRCS) + $(CC) -v $(CFLAGS) $(LIBS) -Wall -Werror -O3 -o growatt_exporter src/*.c lint: clang-format --verbose --Werror -i --style=file $(SRCS) $(TESTS) clang-tidy --checks='*,-altera-id-dependent-backward-branch,-altera-unroll-loops,-bugprone-assignment-in-if-condition,-cert-err33-c,-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,-cppcoreguidelines-avoid-magic-numbers,-llvm-header-guard,-llvmlibc-restrict-system-libc-headers,-readability-function-cognitive-complexity' --format-style=llvm $(SRCS) $(TESTS) -- $(CFLAGS) .PHONY: lint -test: growatt $(TESTS) +test: growatt_exporter $(TESTS) $(CC) -v $(shell pkg-config --libs --cflags libbsd libmodbus) -Wall -Werror -o tests/mock-server $(TESTS) timeout 30 mosquitto_sub -h test.mosquitto.org -p 1884 -u rw -P readwrite -t homeassistant/sensor/growatt/state -d & ./tests/mock-server & - ./growatt config-example.conf || true + ./growatt_exporter config-example.conf || true clean: - $(RM) growatt tests/mock-server + $(RM) growatt_exporter tests/mock-server diff --git a/README.md b/README.md index 58d2bb5..fc69ed8 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ make 2. Copy binary: -`cp growatt /opt/growatt-exporter` +`cp growatt_exporter /opt/growatt-exporter` 3. Create config file `/etc/growatt-exporter.conf`: diff --git a/docker-build.sh b/docker-build.sh index 027cd01..90d2fac 100755 --- a/docker-build.sh +++ b/docker-build.sh @@ -5,7 +5,7 @@ set -euxo pipefail cd "$(dirname "$0")" channel="${1:-stable}" # can be overriden with "bullseye" for example -target=growatt +target=growatt_exporter container=${target}-builder-${channel} volume=/root/HOST cc=clang