-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (35 loc) · 1.31 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
DATE := $(shell date '+%Y-%m-%dT%H:%M:%S')
VERSION = $(shell git describe --tags)
HEAD = $(shell git rev-parse HEAD)
LD_FLAGS = -X github.com/tendermint/starport/starport/internal/version.Version='$(VERSION)' \
-X github.com/tendermint/starport/starport/internal/version.Head='$(HEAD)' \
-X github.com/tendermint/starport/starport/internal/version.Date='$(DATE)'
BUILD_FLAGS = -mod=readonly -ldflags='$(LD_FLAGS)'
all: install
mod:
@go mod tidy
pre-build:
@echo "Fetching latest tags"
@git fetch --tags
build-static:
@go get github.com/go-bindata/go-bindata/...
@go-bindata -pkg cosmosfaucet -prefix starport/pkg/cosmosfaucet -o starport/pkg/cosmosfaucet/openapi_generated.go starport/pkg/cosmosfaucet/openapi/...
build: mod pre-build
@mkdir -p build/
@go build $(BUILD_FLAGS) -o build/ ./starport/interface/cli/...
@go mod tidy
clean:
@rm -rf build
ui:
@rm -rf starport/ui/dist
-@which npm 1>/dev/null && cd starport/ui && npm install 1>/dev/null && npm run build 1>/dev/null
go get github.com/rakyll/statik
install: ui build
@go install $(BUILD_FLAGS) ./...
cli: build
@go install $(BUILD_FLAGS) ./...
lint:
golangci-lint run --out-format=tab --issues-exit-code=0
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" | xargs gofmt -d -s
.PHONY: lint
.PHONY: all mod pre-build build ui install