-
Notifications
You must be signed in to change notification settings - Fork 66
/
Makefile
108 lines (79 loc) · 2.93 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
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
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 "$(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=TestZed/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 ./...
fmt:
gofmt -s -w .
git diff --exit-code -- '*.go'
tidy:
go mod tidy
git diff --exit-code -- go.mod go.sum
SAMPLEDATA:=zed-sample-data/README.md
$(SAMPLEDATA):
git clone --depth=1 https://github.com/brimdata/zed-sample-data $(@D)
sampledata: $(SAMPLEDATA)
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:
@GOBIN="$(CURDIR)/bin" go install github.com/golang/mock/[email protected]
@PATH="$(CURDIR)/bin:$(PATH)" 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
.PHONY: test-services
test-services: build
@ZTEST_PATH="$(CURDIR)/dist:$(CURDIR)/bin" \
ZTEST_TAG=services \
go test -run TestZed/ppl/zqd/ztests/redis .
perf-compare: build $(SAMPLEDATA)
scripts/perf-compare.sh
output-check: build $(SAMPLEDATA)
scripts/output-check.sh
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/Makefile compiler/parser/support.go compiler/parser/parser.peg
$(MAKE) -C compiler/parser
# This rule is best for edit-compile-debug cycle of peg development. It should
# properly trigger rebuilds of peg-generated code, but best to run
# "make -C compiler/parser" when changing versions of pigeon.
.PHONY: peg
peg: compiler/parser/parser.go
.PHONY: markdown-lint
markdown-lint:
@npm install --no-save [email protected]
@npx markdownlint docs
# 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 sampledata test-ci
.PHONY: perf-compare build install clean generate test-generate