-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (28 loc) · 802 Bytes
/
Copy pathMakefile
File metadata and controls
40 lines (28 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
SHELL := /bin/bash
BINARY := termcourse
OUTPUT ?= $(BINARY)
PACKAGE := ./cmd/termcourse
VERSION ?= $(shell git describe --tags --dirty 2>/dev/null)
LDFLAGS := $(if $(VERSION),-X github.com/merefield/termcourse.buildVersion=$(VERSION),)
.PHONY: build test race-test fmt fmt-check vet integration-test check install clean
build:
go build -buildvcs=false -trimpath -ldflags "$(LDFLAGS)" -o $(OUTPUT) $(PACKAGE)
test:
go test ./...
race-test:
go test -race ./...
fmt:
gofmt -w .
fmt-check:
test -z "$$(gofmt -l .)"
vet:
go vet ./...
integration-test:
bats test
check: fmt-check vet race-test integration-test build
install: build
mkdir -p $${DESTDIR}$${PREFIX:-/usr/local}/bin
install -m 0755 $(OUTPUT) $${DESTDIR}$${PREFIX:-/usr/local}/bin/$(BINARY)
clean:
go clean
rm -f $(OUTPUT)