some clean up
added Makefile
This commit is contained in:
parent
8f1463b2ef
commit
5d5c779b43
8 changed files with 98 additions and 43 deletions
44
Makefile
Normal file
44
Makefile
Normal 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)
|
Reference in a new issue