-
Notifications
You must be signed in to change notification settings - Fork 71
Expand file tree
/
Copy pathMakefile
More file actions
91 lines (67 loc) · 2.32 KB
/
Makefile
File metadata and controls
91 lines (67 loc) · 2.32 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
export GO111MODULE=on
VERSION = $(shell git describe --tags --dirty --always)
LDFLAGS = -s -X github.com/brimdata/super/cli.version=$(VERSION)
BUILD_COMMANDS = ./cmd/super
ifeq ($(GO),$(shell command -v go 2>/dev/null))
$(error Go is not installed or not in PATH)
endif
ifeq "$(filter-out 386 arm mips mipsle, $(shell go env GOARCH))" ""
$(error 32-bit architectures are unsupported; see https://github.com/brimdata/super/issues/4044)
endif
# This enables a shortcut to run a single test from the ./ztests suite, e.g.:
# make TEST=TestSPQ/ztests/suite/cut/cut
ifneq "$(TEST)" ""
test-one: test-run
endif
# Uncomment this to trigger re-builds of the peg files when the grammar
# is out of date. We are commenting this out to work around issue #1717.
#PEG_DEP=peg
vet:
go vet ./...
$(MAKE) -C book $@
fmt:
gofmt -s -w .
git diff --exit-code -- '*.go'
tidy:
go mod tidy
git diff --exit-code -- go.mod go.sum
bin/minio: Makefile
@curl -o $@ --compressed --create-dirs \
https://dl.min.io/server/minio/release/$$(go env GOOS)-$$(go env GOARCH)/archive/minio.RELEASE.2022-05-04T07-45-27Z
@chmod +x $@
generate:
go generate ./...
test-generate: generate
git diff --exit-code
test-unit:
@go test -short ./...
test-system: build bin/minio
@ZTEST_PATH="$(CURDIR)/dist:$(CURDIR)/bin" go test .
test-run: build bin/minio
@ZTEST_PATH="$(CURDIR)/dist:$(CURDIR)/bin" go test . -v -run $(TEST)
test-heavy: build
@PATH="$(CURDIR)/dist:$(PATH)" go test -tags=heavy ./mdtest
build: $(PEG_DEP)
@mkdir -p dist
@go build -ldflags='$(LDFLAGS)' -o dist ./cmd/...
install:
@go install -ldflags='$(LDFLAGS)' $(BUILD_COMMANDS)
.PHONY: installdev
installdev:
@go install -ldflags='$(LDFLAGS)' ./cmd/...
compiler/parser/parser.go: compiler/parser/parser.peg go.mod
go tool pigeon -support-left-recursion -o $@ $<
go tool goimports -w $@
.PHONY: peg
peg: compiler/parser/parser.go
.PHONY: markdown-lint
markdown-lint:
@npm install --no-save markdownlint-cli@0.35.0
@npx markdownlint --ignore-path .gitignore .
# CI performs these actions individually since that looks nicer in the UI;
# this is a shortcut so that a local dev can easily run everything.
test-ci: fmt tidy vet test-generate test-unit test-system test-heavy
clean:
@rm -rf dist
.PHONY: fmt tidy vet test-unit test-system test-heavy test-ci
.PHONY: build install clean generate test-generate