This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
56 lines (45 loc) · 1.5 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
########################################################################################################################
# Copyright (c) 2019 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
BUILD_TARGET_SERVER=server
# Pkgs
ALL_PKGS := $(shell go list ./... )
PKGS := $(shell go list ./... | grep -v /test/ )
ROOT_PKG := "github.com/iotexproject/iotex-analytics"
# Docker parameters
DOCKERCMD=docker
all: clean build test
.PHONY: build
build:
$(GOBUILD) -o ./bin/$(BUILD_TARGET_SERVER) -v .
.PHONY: fmt
fmt:
$(GOCMD) fmt ./...
.PHONY: lint
lint:
go list ./... | grep -v /vendor/ | xargs $(GOLINT)
.PHONY: test
test: fmt
$(GOTEST) -short -p 1 ./...
.PHONY: clean
clean:
@echo "Cleaning..."
$(ECHO_V)rm -rf ./bin/$(BUILD_TARGET_SERVER)
$(ECHO_V)$(GOCLEAN) -i $(PKGS)
.PHONY: run
run:
$(GOBUILD) -o ./bin/$(BUILD_TARGET_SERVER) -v .
./bin/$(BUILD_TARGET_SERVER)
.PHONY: docker
docker:
$(DOCKERCMD) build -t $(USER)/iotex-analytics:latest .