-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (40 loc) · 1.04 KB
/
Makefile
File metadata and controls
52 lines (40 loc) · 1.04 KB
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
.PHONY: dep-ensure test cover all lint
TOOL_NAME := bcrypt
# Load relative to the common.mk file
include $(dir $(lastword $(MAKEFILE_LIST)))/vars.mk
include ./vars.mk
all:
@$(MAKE) get-build-deps
@$(MAKE) dep-ensure
@$(MAKE) vet
@$(MAKE) lint
@$(MAKE) cover
@$(MAKE) build
build:
@go build -ldflags="-X 'main.buildDate=$(BUILD_DATE)' -X main.commit=$(GIT_HASH) -s -w" -o $(TOOL_PATH)
@echo "*** Binary created under $(TOOL_PATH) ***"
clean:
@rm -rf $(BUILD_DIR)
dep-ensure:
$(DEP_ENSURE) -vendor-only
get-build-deps:
@echo "+ Downloading build dependencies"
@go get golang.org/x/tools/cmd/goimports
@go get golang.org/x/lint/golint
@go get -u github.com/golang/dep/cmd/dep
vet:
@echo "+ Vet"
@go vet ./...
lint:
@echo "+ Linting package"
@golint .
$(call fmtcheck, .)
test:
@echo "+ Testing package"
$(GO_TEST) .
cover: test
@echo "+ Tests Coverage"
@mkdir -p $(BUILD_DIR)
@touch $(BUILD_DIR)/cover.out
@go test -coverprofile=$(BUILD_DIR)/cover.out
@go tool cover -html=$(BUILD_DIR)/cover.out -o=$(BUILD_DIR)/coverage.html