-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
41 lines (31 loc) · 1021 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
.POSIX:
.SUFFIXES:
.PHONY: debug release lint clean version install_vendor editdoc
.SILENT: version
SOURCES = $(shell find . -type f -name '*.go' -not -path "./vendor/*")
BINARY=vssh
FULL=github.com/stephane-martin/vssh
VERSION=0.3.1
LDFLAGS=-ldflags '-X main.version=${VERSION}' -gcflags "all=-N -l"
LDFLAGS_RELEASE=-ldflags '-X main.version=${VERSION}'
debug: ${BINARY}_debug
release: ${BINARY}
install_vendor:
go install -i ./vendor/...
${BINARY}_debug: ${SOURCES}
dep ensure
env CGO_ENABLED=0 go build -tags 'netgo osusergo' -o ${BINARY}-debug ${LDFLAGS} ${FULL}
${BINARY}: ${SOURCES}
env CGO_ENABLED=0 go build -tags 'netgo osusergo' -o ${BINARY} ${LDFLAGS_RELEASE} ${FULL}
upx --best ${BINARY}
gpg --detach-sign --armor ${BINARY}
editdoc:
nohup restview README.rst 1>/dev/null 2>/dev/null &
nvim README.rst
pkill restview
clean:
rm -f ${BINARY} ${BINARY}_debug
version:
echo ${VERSION}
lint:
golangci-lint run -E dupl,goconst,gosec,interfacer,maligned,prealloc,scopelint,unconvert,unparam