add make subcommands to run and check bench
This commit is contained in:
parent
d192379d3c
commit
6ca172c4c1
1 changed files with 16 additions and 1 deletions
17
Makefile
17
Makefile
|
|
@ -1,7 +1,7 @@
|
||||||
# This really ought to be `/usr/bin/env bash`, but nix flakes don't like that.
|
# This really ought to be `/usr/bin/env bash`, but nix flakes don't like that.
|
||||||
SHELL := /bin/sh
|
SHELL := /bin/sh
|
||||||
|
|
||||||
.PHONY: hoogle format haddock usage tag format_nix format_haskell format_check lint ps_bridge
|
.PHONY: hoogle format haddock usage tag format_nix format_haskell format_check lint ps_bridge bench bench_check
|
||||||
|
|
||||||
usage:
|
usage:
|
||||||
@echo "usage: make <command> [OPTIONS]"
|
@echo "usage: make <command> [OPTIONS]"
|
||||||
|
|
@ -16,6 +16,8 @@ usage:
|
||||||
@echo " format_check -- Check if all haskell stuff have been formatted correctly"
|
@echo " format_check -- Check if all haskell stuff have been formatted correctly"
|
||||||
@echo " lint -- Get hlint suggestions for project"
|
@echo " lint -- Get hlint suggestions for project"
|
||||||
@echo " ps_bridge -- Generate purescript bridge files"
|
@echo " ps_bridge -- Generate purescript bridge files"
|
||||||
|
@echo " bench -- Generate bench report bench.csv"
|
||||||
|
@echo " bench_check -- Check if bench report is up-to-date"
|
||||||
|
|
||||||
hoogle:
|
hoogle:
|
||||||
pkill hoogle || true
|
pkill hoogle || true
|
||||||
|
|
@ -51,3 +53,16 @@ lint:
|
||||||
PS_BRIDGE_OUTPUT_DIR := agora-purescript-bridge/
|
PS_BRIDGE_OUTPUT_DIR := agora-purescript-bridge/
|
||||||
ps_bridge:
|
ps_bridge:
|
||||||
cabal run exe:agora-purescript-bridge -- -o $(PS_BRIDGE_OUTPUT_DIR)
|
cabal run exe:agora-purescript-bridge -- -o $(PS_BRIDGE_OUTPUT_DIR)
|
||||||
|
|
||||||
|
bench:
|
||||||
|
cabal run agora-bench
|
||||||
|
|
||||||
|
BENCH_TMPDIR := $(shell mktemp -d)
|
||||||
|
BENCH_TMPFILE := $(BENCH_TMPDIR)/bench.csv
|
||||||
|
bench_check:
|
||||||
|
(cabal run agora-bench -- -o "$(BENCH_TMPFILE)" \
|
||||||
|
|| $(bench) -o "$(BENCH_TMPFILE)") >> /dev/null
|
||||||
|
diff bench.csv $(BENCH_TMPFILE) \
|
||||||
|
|| (echo "bench.csv is outdated"; exit 1)
|
||||||
|
# TODO: do the clean-up even if `diff` fails.
|
||||||
|
rm -rf $(BENCH_TMPDIR)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue