forked from DataDrake/abi-wizard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (52 loc) · 1.27 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
PKGNAME = abi-wizard
DESTDIR ?=
PREFIX ?= /usr
BINDIR = $(PREFIX)/bin
GOPROJROOT = $(GOSRC)/$(PROJREPO)
GOLDFLAGS = -ldflags "-s -w"
GOTAGS = ""
GOCC = go
GOFMT = $(GOCC) fmt -x
GOGET = $(GOCC) get $(GOLDFLAGS)
GOBUILD = CGO_ENABLED=0 $(GOCC) build -v $(GOLDFLAGS) $(GOTAGS)
GOTEST = $(GOCC) test
GOVET = $(GOCC) vet
GOINSTALL = $(GOCC) install $(GOLDFLAGS)
GOBUILDDEP = $(GOINSTALL)
GOCLEANDEP = $(GOCC) clean -cache -modcache
include Makefile.waterlog
GOLINT = golint -set_exit_status
all: build
build:
@$(call stage,BUILD)
@$(GOBUILD)
@$(call pass,BUILD)
test:
@$(call stage,TEST)
@$(GOTEST) ./...
@$(call pass,TEST)
validate:
@$(call stage,FORMAT)
@$(GOFMT) ./...
@$(call pass,FORMAT)
@$(call stage,VET)
@$(call task,Running 'go vet'...)
@$(GOVET) ./...
@$(call pass,VET)
@$(call stage,LINT)
@$(call task,Running 'golint'...)
@$(GOLINT) `go list ./... | grep -v vendor`
@$(call pass,LINT)
install:
@$(call stage,INSTALL)
install -D -m 00755 $(PKGNAME) $(DESTDIR)$(BINDIR)/$(PKGNAME)
@$(call pass,INSTALL)
uninstall:
@$(call stage,UNINSTALL)
rm -f $(DESTDIR)$(BINDIR)/$(PKGNAME)
@$(call pass,UNINSTALL)
clean:
@$(call stage,CLEAN)
@$(call task,Removing executable...)
@rm $(PKGNAME)
@$(call pass,CLEAN)