-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
47 lines (35 loc) · 859 Bytes
/
Makefile
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
43
44
45
46
47
LDFLAGS ?= -w -s -X main.BuildDate=$(shell date +%F)
PREFIX ?= /usr
all: build
build: janus ssh-decrypt
install: $(PREFIX)/bin/janus $(PREFIX)/bin/ssh-decrypt
.PHONY: janus
janus:
@go build -ldflags '$(LDFLAGS)' -o $@ *.go
.PHONY: ssh-decrypt
ssh-decrypt:
@go build -ldflags '$(LDFLAGS)' -o $@ cmd/decrypt.go
$(PREFIX)/bin/janus: janus
install -p -D -m 0755 $< $@
$(PREFIX)/bin/ssh-decrypt: ssh-decrypt
install -p -D -m 0755 $< $@
.PHONY: clean
clean:
rm -f janus ssh-decrypt coverage.out agent.sock
.PHONY: coverage.out
coverage.out:
@go test -v -cover -coverprofile $(@) ./...
.PHONY: cover
cover: coverage.out
@go tool cover -func $<
.PHONY: vet
vet:
@go vet ./...
.PHONY: fmt
fmt:
@test -z "$$(gofmt -d ./ | tee /dev/stderr)"
.PHONY: test
test: cover vet fmt
.PHONY: run
run: janus
@SSH_AUTH_SOCK="$(shell pwd)/agent.sock" ./janus