-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
86 lines (64 loc) · 1.95 KB
/
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
PROJ := go-MasterPassword
VERSION := $(shell git describe --tags --dirty)
export CLI := gompw
ORG_PATH := github.com/TerraTech
REPO_PATH := $(ORG_PATH)/$(PROJ)
REPO_DIR := $(GOPATH)/src/$(REPO_PATH)
CMD_PATH := $(REPO_PATH)/cmd
LINT_PATH := $(REPO_DIR)/lint
export PATH := $(PWD)/bin:$(PATH)
FQGOLIBS_PATH := $(GOPATH)/src/futurequest.net/FQgolibs-Public/
VENDOR_DST := futurequest.net/FQgolibs
VENDOR_SUBPKGS_FQ := FQdebug FQfile FQtesting FQversion
GOFILES := $(filter-out ./vendor/% ./@_VERSION_@.go,$(shell find ./ -type f -name '*.go' -print))
BUILDHOST ?= $(shell hostname -s)
$( shell mkdir -p bin )
user=$(shell id -u -n)
group=$(shell id -g -n)
LD_FLAGS="-w -X main.VERSION=$(VERSION) -X main.BUILDHOST=$(BUILDHOST)"
build: bin/$(CLI)
bin/$(CLI): $(GOFILES)
@GOBIN=$(PWD)/bin go install -v -ldflags $(LD_FLAGS) $(CMD_PATH)/$(CLI)
.PHONY: help
help:
@cat files/make_help.txt
.PHONY: install
install: build
@scripts/install.sh
.PHONY: test
test:
@go test -v $(shell go list ./... | grep -v '/vendor/')
.PHONY: vendor
vendor:
@scripts/update_vendor.sh $(FQGOLIBS_PATH) $(VENDOR_DST) $(VENDOR_SUBPKGS_FQ)
.PHONY: vendorDry
vendorDry:
@scripts/update_vendor-dryrun.sh $(FQGOLIBS_PATH) $(VENDOR_DST) $(VENDOR_SUBPKGS_FQ)
.PHONY: glide
glide:
@scripts/update_glide.sh
@make vendor
.PHONY: vet
vet:
@go vet $(shell go list ./... | grep -v '/vendor/')
.PHONY: fmt
fmt:
@go fmt $(shell go list ./... | grep -v '/vendor/')
#test and testify runs the crypto tests which OOM the system
LINT_OPTS := --enable-all --disable=lll --disable=test --disable=testify --cyclo-over=15
.PHONY: lintcmd
lintcmd:
@gometalinter $(LINT_OPTS) cmd/... | sort | tee $(LINT_PATH)/lint.cmd.txt
.PHONY: lintpkg
lintpkg:
@gometalinter $(LINT_OPTS) \
-e "warning: duplicate of pkg/crypto/masterPassword_test.go" \
pkg/... | sort | tee $(LINT_PATH)/lint.pkg.txt
.PHONY: lintall
lintall: lintcmd lintpkg
.PHONY: clean
clean:
@scripts/clean.sh
.PHONY: testall
testall: test vet fmt
FORCE: