-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (31 loc) · 797 Bytes
/
Copy pathMakefile
File metadata and controls
42 lines (31 loc) · 797 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
41
42
VERSION ?= dev
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null)
DATE ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
LDFLAGS := -s -w \
-X main.version=$(VERSION) \
-X main.commit=$(COMMIT) \
-X main.date=$(DATE)
build:
go build -ldflags="$(LDFLAGS)" -o bin/sl ./cmd/sl
cp bin/sl bin/simplelogin
PREFIX ?= /usr/local
install: build
install -d $(DESTDIR)$(PREFIX)/bin
install -m 755 bin/sl $(DESTDIR)$(PREFIX)/bin/sl
install -m 755 bin/simplelogin $(DESTDIR)$(PREFIX)/bin/simplelogin
test:
go test ./...
man:
go run ./cmd/gen-man man/
lint:
golangci-lint run ./...
fmt:
gofmt -w .
vet:
go vet ./...
coverage:
go test -coverprofile=coverage.out ./...
go tool cover -func=coverage.out
clean:
rm -rf bin/ man/
.PHONY: build install test man lint fmt vet coverage clean