-
Notifications
You must be signed in to change notification settings - Fork 110
/
Copy pathMakefile
55 lines (46 loc) · 1.6 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
########################################################################################################################
# Copyright (c) 2018 IoTeX
# This is an alpha (internal) release and is not suitable for production. This source code is provided ‘as is’ and no
# warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent
# permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache
# License 2.0 that can be found in the LICENSE file.
########################################################################################################################
# Go parameters
GOCMD=go
GOLINT=golint
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BUILD_TARGET_SERVER=server
BUILD_TARGET_TXINJ=txinjector
all: build test
.PHONY: build
build:
$(GOBUILD) -o ./bin/$(BUILD_TARGET_SERVER) -v ./$(BUILD_TARGET_SERVER)
$(GOBUILD) -o ./bin/$(BUILD_TARGET_TXINJ) -v ./tools/txinjector
.PHONY: fmt
fmt:
$(GOCMD) fmt ./...
.PHONY: lint
lint:
go list ./... | grep -v /vendor/ | xargs $(GOLINT)
.PHONY: test
test: fmt
rm -f ./e2etests/db.test
$(GOTEST) -short ./...
.PHONY: mockgen
mockgen:
@./misc/scripts/mockgen.sh
.PHONY: stringer
stringer:
sh ./misc/scripts/stringer.sh
.PHONY: clean
clean:
$(GOCLEAN)
rm -f ./bin/$(BUILD_TARGET_SERVER)
rm -f ./bin/$(BUILD_TARGET_TXINJ)
.PHONY: run
run:
$(GOBUILD) -o ./bin/$(BUILD_TARGET_SERVER) -v ./$(BUILD_TARGET_SERVER)
./bin/$(BUILD_TARGET_SERVER) -stderrthreshold=WARNING -log_dir=./log -config=e2etests/config_local_delegate.yaml