From b8fded1f60790d0dec7812b330e2a65968427aa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorben=20G=C3=BCnther?= Date: Sun, 27 Jun 2021 01:13:21 +0200 Subject: [PATCH] Makefile: Update, add lint section --- Makefile | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 2fa0a9c..0e24d18 100644 --- a/Makefile +++ b/Makefile @@ -1,24 +1,25 @@ -NAME := srhtctl -PREFIX ?= /usr/local -GO?=go -GOFLAGS?= +.POSIX: -GOSRC!=find . -name '*.go' -GOSRC+=go.mod go.sum +GO = go +RM = rm +GOFLAGS = +PREFIX = /usr -all: $(NAME) +all: srhtctl -RM?=rm -f - -clean: - $(RM) srhtctl - -$(NAME): $(GOSRC) +srhtctl: $(GO) build $(GOFLAGS) \ -o $@ +clean: + $(RM) -rf srhtctl install: $(NAME) install -dm755 '$(DESTDIR)$(PREFIX)/bin' install -m755 $(NAME) '$(DESTDIR)$(PREFIX)/bin/$(NAME)' -.PHONY: clean all +lint: + go vet ./... + revive ./... + staticcheck ./... + +.PHONY: srhtctl -- 2.44.0