Skip to content

Commit

Permalink
feat: create makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
Tshaka Eric Lekholoane authored and tshakalekholoane committed Aug 21, 2022
1 parent e4ad89d commit 9fce482
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## help: print this help message
.PHONY: help
help:
@echo "Usage:"
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'

## audit: format, vet, and test code
.PHONY: audit
audit:
@echo "Formatting code."
gofumpt -w .
@echo "Vetting code."
go vet ./...
staticcheck ./...
@echo "Running tests."
go test -race -vet=off ./...

ver = $(shell git describe --always --dirty --tags --long)
linker_flags = "-s -X 'tshaka.co/bat/internal/cli.ver=${ver}'"
## build: build the cmd/bat application
.PHONY: build
build:
@echo "Building bat."
GOOS=linux GOARCH=amd64 go build -ldflags=${linker_flags} ./cmd/bat/

## release: package bat binary into a zip file
.PHONY: release
release: build
@echo "Packaging bat."
zip bat.zip ./bat

0 comments on commit 9fce482

Please sign in to comment.