-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
51 lines (38 loc) · 1.53 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
VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//')
COMMIT := $(shell git log -1 --format='%H')
DOCKER := $(shell which docker)
export GO111MODULE = on
all: ci-lint ci-test install
###############################################################################
# Build / Install
###############################################################################
LD_FLAGS = -X github.com/forbole/juno/v3/cmd.Version=$(VERSION) \
-X github.com/forbole/juno/v3/cmd.Commit=$(COMMIT)
BUILD_FLAGS := -ldflags '$(LD_FLAGS)'
build: go.sum
ifeq ($(OS),Windows_NT)
@echo "building wasmx binary..."
@go build -mod=readonly $(BUILD_FLAGS) -o build/wasmx.exe ./cmd/wasmx
else
@echo "building wasmx binary..."
@go build -mod=readonly $(BUILD_FLAGS) -o build/wasmx ./cmd/wasmx
endif
install: go.sum
@echo "installing wasmx binary..."
@go install -mod=readonly $(BUILD_FLAGS) ./cmd/wasmx
###############################################################################
# Tests / CI
###############################################################################
lint:
golangci-lint run --out-format=tab
lint-fix:
golangci-lint run --fix --out-format=tab --issues-exit-code=0
.PHONY: lint lint-fix
format:
find . -name '*.go' -type f -not -path "*.git*" | xargs gofmt -w -s
find . -name '*.go' -type f -not -path "*.git*" | xargs misspell -w
find . -name '*.go' -type f -not -path "*.git*" | xargs goimports -w -local github.com/disperze/wasmx
.PHONY: format
clean:
rm -f tools-stamp ./build/**
.PHONY: install build ci-test ci-lint clean