doggo/Makefile

29 lines
588 B
Makefile
Raw Normal View History

2020-12-14 07:19:54 +01:00
DOGGO-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
build: ## Build the doggo binary
mkdir -p bin/; \
cd cmd/; \
go build -ldflags="-X 'main.buildVersion=${VERSION}' -X 'main.buildDate=${BUILD_DATE}'" -o ${DOGGO-BIN} ./... && \
mv ${DOGGO-BIN} ../bin/${DOGGO-BIN}
.PHONY: run
run: build ## Build and Execute the binary after the build step
./bin/${DOGGO-BIN}
2020-12-17 12:27:44 +01:00
.PHONY: clean
2020-12-09 18:11:09 +01:00
clean:
go clean
- rm -f ./bin/${BIN}
2020-12-17 12:27:44 +01:00
.PHONY: lint
lint:
golangci-lint run
.PHONY: fresh
fresh: clean build