-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (34 loc) · 865 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
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
GOMOD=$(GOCMD) mod
GOGENERATE=$(GOCMD) generate
GOLIST=$(GOCMD) list
# Git parameters
GITCMD=git
GITCHECKOUT=$(GITCMD) checkout
# Sources parameters
SOURCE_ENTRYPOINT=./cmd
# Binary parameters
BINARY_NAME=dbc4go
BINARY_DESTINATION=./bin
BINARY_PATH=$(BINARY_DESTINATION)/$(BINARY_NAME)
# Tagets
# Build with contracts
buildwc:
$(GOGENERATE) ./... && $(GOBUILD) -o $(BINARY_PATH) -v $(SOURCE_ENTRYPOINT) && $(GITCHECKOUT) -- .
build:
$(GOBUILD) -o $(BINARY_PATH) -v $(SOURCE_ENTRYPOINT)
# Unit tests
utest:
$(GOTEST) --cover `$(GOLIST) ./... | grep -v "/examples"`
utestwc:
$(GOGENERATE) ./...
$(GOTEST) --cover `$(GOLIST) ./... | grep -v "/examples"`
$(GITCHECKOUT) -- .
clean:
$(GOCLEAN) $(SOURCE_ENTRYPOINT)
rm -f $(BINARY_PATH)