Adjust the Makefile for the conversion to a Go module.

This commit is contained in:
Octavian Cerna 2020-07-26 21:10:56 +03:00
parent 774dee6012
commit 81e49a31c3

View file

@ -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