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 build: get
@echo "Building $(GOFILES) to ./bin" @go build -v
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) go build -v -o bin/$(GONAME) $(GOFILES)
get: get:
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) go get -v . @go get -v
install: install:
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) go install $(GOFILES) @go install
run: build 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 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:
@clear @clear
clean: clean:
@echo "Cleaning" @echo "Cleaning"
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) go clean @go clean
example: example:
@echo "# Example output" > EXAMPLE.md @echo "# Example output" > EXAMPLE.md