go-jsonnet/Makefile
Weston McNamee 27b4c60bc7 feat: Improve performance of substr by 84.44%
This pulls in the implementation of substr into native Go instead of interpretted Jsonnet.

benchmark                       old ns/op     new ns/op     delta
Benchmark_Builtin_substr-16     97121527      15115905      -84.44%

part of #111
2020-01-26 09:20:58 +01:00

74 lines
1.8 KiB
Makefile

all: install.dependencies generate generate.stdlib build.bazel test tidy
.PHONY: all
# https://github.com/golang/go/issues/30515
# We temporarily set GO111MODULE=off here to avoid adding these binaries to the go.mod|sum files
# As they are not needed during runtime
install.dependencies : export GO111MODULE=off
install.dependencies:
git submodule init
git submodule update
go get github.com/clipperhouse/gen
go get github.com/clipperhouse/set
go get github.com/fatih/color
go get github.com/axw/gocov/gocov
go get github.com/mattn/goveralls
go get github.com/sergi/go-diff/diffmatchpatch
if ! go get github.com/golang/tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi;
.PHONY: install.dependencies
build.bazel:
bazel build //cmd/jsonnet
.PHONY: build.bazel
_build.bazel.os:
bazel build --platforms=@io_bazel_rules_go//go/toolchain:$(OS)_amd64 //cmd/jsonnet
.PHONY: build.bazel.os
build.bazel.linux : OS=linux
build.bazel.linux: _build.bazel.os
.PHONY: build.bazel.linux
build.bazel.darwin : OS=darwin
build.bazel.darwin: _build.bazel.os
.PHONY: build.bazel.darwin
build.bazel.windows : OS=windows
build.bazel.windows: _build.bazel.os
.PHONY: build.bazel.windows
build:
go build ./cmd/jsonnet
.PHONY: build
build.old:
go build ./cmd/jsonnet -o jsonnet-old
.PHONY: build.old
test:
./tests.sh
.PHONY: test
benchmark : FILTER="Builtin"
benchmark: build
./benchmark.sh ${FILTER}
.PHONY: benchmark
generate:
go generate
.PHONY: generate
generate.stdlib:
go run cmd/dumpstdlibast/dumpstdlibast.go cpp-jsonnet/stdlib/std.jsonnet > astgen/stdast.go
.PHONY: generate.stdlib
tidy:
go mod tidy
bazel run //:gazelle -- update-repos -from_file=go.mod -to_macro=bazel/deps.bzl%jsonnet_go_dependencies
.PHONY: tidy
gazelle:
bazel run //:gazelle
.PHONY: gazelle