diff --git a/Makefile b/Makefile index 1759b03..97f20dd 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,9 @@ +PLATFORMS := linux/amd64 windows/amd64 darwin/amd64 linux/arm64 + +temp = $(subst /, ,$@) +os = $(word 1, $(temp)) +arch = $(word 2, $(temp)) + defualt: build build: @@ -5,3 +11,8 @@ build: install: GO111MODULE=on go install -o sia_exporter *.go + +release: $(PLATFORMS) + +$(PLATFORMS): + GO111MODULE=on GOOS=$(os) GOARCH=$(arch) go build -o 'sia_exporter-$(os)-$(arch)' *.go