summaryrefslogtreecommitdiff
path: root/prom-exporter-modbus/Makefile
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2023-05-10 15:38:44 +0200
committerChristian Pointner <equinox@spreadspace.org>2023-05-10 15:38:44 +0200
commitf442a4ff9babe748b34dc61139428e828f3838fa (patch)
tree4fe63993ab4f2712f92b9a1d5c0773703bc3b9bc /prom-exporter-modbus/Makefile
parentingnore arm64 subdirs (diff)
add modbus exporter
Diffstat (limited to 'prom-exporter-modbus/Makefile')
-rw-r--r--prom-exporter-modbus/Makefile20
1 files changed, 20 insertions, 0 deletions
diff --git a/prom-exporter-modbus/Makefile b/prom-exporter-modbus/Makefile
new file mode 100644
index 0000000..cb9d3a4
--- /dev/null
+++ b/prom-exporter-modbus/Makefile
@@ -0,0 +1,20 @@
+VERSION := "invalid"
+GITHUB_BASEURL := "https://github.com/RichiH/modbus_exporter/releases/download"
+
+.PHONY: clean
+
+all: i386/modbus_exporter amd64/modbus_exporter arm64/modbus_exporter
+
+%/modbus_exporter: modbus_exporter-$(VERSION).linux-%.tar.gz
+ mkdir -p $(shell echo $@ | sed 's#/.*##')
+ tar -C $(shell echo $@ | sed 's#/.*##') -xzf "$<" --strip-components=1
+
+modbus_exporter-$(VERSION).linux-%.tar.gz:
+ wget -nc --progress=dot:mega "$(GITHUB_BASEURL)/v$(VERSION)/$(shell echo $@ | sed s/i386/386/)" -O "$@"
+ sha256sum -c --ignore-missing sha256sums.txt
+
+clean:
+ rm -rf i386
+ rm -rf amd64
+ rm -rf arm64
+ rm -f modbus_exporter-$(VERSION).linux-*.tar.gz