diff --git a/Makefile b/Makefile index fb57953..1a3855b 100644 --- a/Makefile +++ b/Makefile @@ -1,30 +1,24 @@ -GOPATH=$(shell pwd)/vendor:$(shell pwd) -GOBIN=$(shell pwd)/bin -GOFILES=$(wildcard *.go) -GONAME=$(shell basename "$(PWD)") - build: get - @echo "Building $(GOFILES) to ./bin" - @GOPATH=$(GOPATH) GOBIN=$(GOBIN) go build -v -o bin/$(GONAME) $(GOFILES) + @go build -v get: - @GOPATH=$(GOPATH) GOBIN=$(GOBIN) go get -v . + @go get -v install: - @GOPATH=$(GOPATH) GOBIN=$(GOBIN) go install $(GOFILES) + @go install run: build - @GOPATH=$(GOPATH) GOBIN=$(GOBIN) go run $(GOFILES) --config=$(shell pwd)/smartctl_exporter.yaml --debug --verbose + @go run . --config=$(shell pwd)/smartctl_exporter.yaml --debug --verbose run-sudo: build - sudo bin/$(GONAME) --config=$(shell pwd)/smartctl_exporter.yaml --debug --verbose + sudo smartctl_exporter --config=$(shell pwd)/smartctl_exporter.yaml --debug --verbose clear: @clear clean: @echo "Cleaning" - @GOPATH=$(GOPATH) GOBIN=$(GOBIN) go clean + @go clean example: @echo "# Example output" > EXAMPLE.md