forked from adamlaska/machine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.mk
More file actions
55 lines (44 loc) · 1.45 KB
/
main.mk
File metadata and controls
55 lines (44 loc) · 1.45 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
53
54
55
# Initialize version and gc flags
GO_LDFLAGS := -X `go list ./version`.GitCommit=`git rev-parse --short HEAD 2>/dev/null`
GO_GCFLAGS :=
# Full package list
PKGS := $(shell go list -tags "$(BUILDTAGS)" ./... | grep -v "/vendor/" | grep -v "/cmd")
# Resolving binary dependencies for specific targets
GOLINT_BIN := $(GOPATH)/bin/golint
GOLINT := $(shell [ -x $(GOLINT_BIN) ] && echo $(GOLINT_BIN) || echo '')
# Honor debug
ifeq ($(DEBUG),true)
# Disable function inlining and variable registerization
GO_GCFLAGS := -gcflags "-N -l"
else
# Turn of DWARF debugging information and strip the binary otherwise
GO_LDFLAGS := $(GO_LDFLAGS) -w -s
endif
# Honor static
ifeq ($(STATIC),true)
# Append to the version
GO_LDFLAGS := $(GO_LDFLAGS) -extldflags -static
endif
# Honor verbose
VERBOSE_GO :=
GO := go
ifeq ($(VERBOSE),true)
VERBOSE_GO := -v
endif
include mk/build.mk
include mk/coverage.mk
include mk/dev.mk
include mk/test.mk
include mk/validate.mk
.all_build: build build-clean build-x
.all_coverage: coverage-generate coverage-html coverage-send coverage-serve coverage-clean
.all_release: release-checksum release
.all_test: test-short test-long test-integration
.all_validate: dco fmt vet lint
default: build
install:
cp $(PREFIX)/bin/$(PKG_NAME) /usr/local/bin
clean: coverage-clean build-clean
test: dco fmt test-short lint vet
validate: dco fmt lint vet test-long
.PHONY: .all_build .all_coverage .all_release .all_test .all_validate test build validate clean