some clean up

added Makefile
This commit is contained in:
Mahmoud Rahbar Azad 2018-10-25 21:18:45 +02:00
parent 8f1463b2ef
commit 5d5c779b43
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 7DBBD39E2BFEB784
8 changed files with 98 additions and 43 deletions

44
Makefile Normal file
View file

@ -0,0 +1,44 @@
SHELL := /bin/bash
TARGET := hetzner-sb-notifier
.DEFAULT_GOAL: $(TARGET)
# These will be provided to the target
VERSION := 1.0.0
BUILD := `git rev-parse HEAD`
.PHONY: all build clean uninstall fmt simplify check run
all: check build
$(TARGET):
@go build -o $(TARGET)
build: $(TARGET)
@true
clean:
@echo "Performing clean"
@rm -f $(TARGET)
uninstall: clean
@echo "Performing uninstall"
@rm -f $$(which ${TARGET})
fmt:
@echo "Performing fmt"
@gofmt -l -w .
simplify:
@echo "Performing simplify"
@gofmt -s -l -w .
check:
@echo "Performing check"
@test -z $(shell gofmt -l main.go | tee /dev/stderr) || echo "[WARN] Fix formatting issues with 'make fmt'"
@for d in $$(go list ./...); do golint $${d}; done
@go tool vet .
run: install
@echo "Performing run"
@$(TARGET)