2020-12-18 15:48:28 +01:00
|
|
|
BIN := ./bin/doggo
|
2020-12-09 18:11:09 +01:00
|
|
|
|
|
|
|
HASH := $(shell git rev-parse --short HEAD)
|
|
|
|
BUILD_DATE := $(shell date '+%Y-%m-%d %H:%M:%S')
|
2020-12-13 16:33:44 +01:00
|
|
|
VERSION := ${HASH}
|
2020-12-09 18:11:09 +01:00
|
|
|
|
|
|
|
.PHONY: build
|
2020-12-18 15:48:28 +01:00
|
|
|
build:
|
|
|
|
go build -o ${BIN} -ldflags="-X 'main.buildVersion=${VERSION}' -X 'main.buildDate=${BUILD_DATE}'" ./cmd/doggo/
|
2020-12-09 18:11:09 +01:00
|
|
|
|
|
|
|
.PHONY: run
|
|
|
|
run: build ## Build and Execute the binary after the build step
|
2020-12-18 15:48:28 +01:00
|
|
|
${BIN}
|
2020-12-09 18:11:09 +01:00
|
|
|
|
2020-12-17 12:27:44 +01:00
|
|
|
.PHONY: clean
|
2020-12-09 18:11:09 +01:00
|
|
|
clean:
|
|
|
|
go clean
|
2020-12-18 15:48:28 +01:00
|
|
|
- rm -f ${BIN}
|
2020-12-09 18:11:09 +01:00
|
|
|
|
2020-12-17 12:27:44 +01:00
|
|
|
.PHONY: lint
|
|
|
|
lint:
|
|
|
|
golangci-lint run
|
|
|
|
|
|
|
|
.PHONY: fresh
|
|
|
|
fresh: clean build
|