🧑‍💻 Updated Makefile

This commit is contained in:
Maxim Lebedev 2022-03-26 00:02:05 +05:00
parent aba900e19d
commit 3093eba507
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5
1 changed files with 19 additions and 20 deletions

View File

@ -1,28 +1,27 @@
SHELL:=/bin/bash #!/usr/bin/make -f
PROJECT_NAME=indieauth SHELL = /bin/sh
VERSION=$(shell cat VERSION)
GO_BUILD_ENV=CGO_ENABLED=0 GOOS=linux GOARCH=amd64
GO_FILES=$(shell go list ./... | grep -v /vendor/)
build: #### Start of system configuration section. ####
$(GO_BUILD_ENV) go build .
run: srcdir = .
go run .
clean: GO ?= go
go clean GOFLAGS ?=
EXECUTABLE ?= indieauth
test: #### End of system configuration section. ####
go test -race -cover ./...
dep: .PHONY: all clean check help
go mod download
gen: all: main.go
go generate ./... $(GO) build -v $(GOFLAGS) -o $(EXECUTABLE) $<
lint: clean: ## Delete all files in the current directory that are normally created by building the program
golangci-lint run $(GO) clean
.PHONY: build run clean test dep gen lint check: ## Perform self-tests
$(GO) test -v -cover -failfast -short -shuffle=on $(GOFLAGS) $(srcdir)/...
.PHONY: help
help: ## Display this help screen
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'