forked from ignite/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (35 loc) · 1.21 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
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: mod pre-build
@go get -u github.com/gobuffalo/packr/v2/packr2
@cd ./starport/interface/cli/starport && packr2
@mkdir -p build/
@go build $(BUILD_FLAGS) -o build/ ./starport/interface/cli/...
@packr2 clean
@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