summaryrefslogtreecommitdiff
path: root/prom-exporter-snmp/Makefile
blob: 438f42b7afc50249a8de5cf1600508ad7e63036c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
VERSION := "invalid"
GITHUB_BASEURL := "https://github.com/prometheus/snmp_exporter/releases/download/"

.PHONY: clean

all: i386/snmp_exporter amd64/snmp_exporter arm64/snmp_exporter

%/snmp_exporter: snmp_exporter-$(VERSION).linux-%.tar.gz
	mkdir -p $(shell echo $@ | sed 's#/.*##')
	tar -C $(shell echo $@ | sed 's#/.*##') -xzf "$<" --strip-components=1

snmp_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 snmp_exporter-$(VERSION).linux-*.tar.gz