-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
84 lines (58 loc) · 3.13 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
PROJECT_NAME = bcc-node
NUM_PROC = $(nproc --all)
help: ## Print documentation
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
stylish-haskell: ## Apply stylish-haskell on all *.hs files
@find . -type f -name "*.hs" -not -path '.git' -not -path '*.stack-work*' -print0 | xargs -0 stylish-haskell -i
cabal-hashes:
$$(nix-build ./nix -A tbcoNix.checkCabalProject --no-out-link)
ghci: ## Run repl
@stack ghci $(PROJECT_NAME):lib --haddock-deps --ghci-options=-fobject-code --nix
ghcid: ## Run ghcid
@ghcid --command "stack ghci $(PROJECT_NAME):lib --nix -j12 --ghci-options=-fobject-code"
run-test: ## Build & run test
@stack build --fast --nix && \
stack test --fast --nix
test-ghci: ## Run repl on test suites
@stack ghci $(PROJECT_NAME):lib $(PROJECT_NAME):test:$(PROJECT_NAME)-test --ghci-options=-fobject-code --nix
test-ghcid: ## Run ghcid on test suites
@ghcid --command "stack ghci --nix $(PROJECT_NAME):lib $(PROJECT_NAME):test:$(PROJECT_NAME)-test --ghci-options=-fobject-code"
test-ghcid-nix: ## Run ghcid on test suites with Nix
@ghcid --command="stack ghci --test --main-is $(PROJECT_NAME):test:$(PROJECT_NAME)-test --nix -j$(NUM_PROC)"
test-chairmans-cluster:
@scripts/chairmans-cluster/cluster-test.sh
profiles:
@./nix/workbench/wb dump-profiles
profile-names:
@./nix/workbench/wb profile-names
CLUSTER_PROFILE ?= default-alzo
CLUSTER_ARGS_EXTRA ?=
cluster-shell:
nix-shell --max-jobs 8 --cores 0 --show-trace --argstr clusterProfile ${CLUSTER_PROFILE} --arg 'autoStartCluster' true
shell-dev: CLUSTER_ARGS_EXTRA += --arg 'workbenchDevMode' true
cluster-shell: CLUSTER_ARGS_EXTRA += --arg 'autoStartCluster' true --arg 'workbenchDevMode' true
cluster-shell-dev: CLUSTER_ARGS_EXTRA += --arg 'autoStartCluster' true --arg 'workbenchDevMode' true
cluster-shell-trace: CLUSTER_ARGS_EXTRA += --arg 'autoStartCluster' true --argstr 'autoStartClusterArgs' '--trace --trace-workbench'
cluster-shell-dev-trace: CLUSTER_ARGS_EXTRA += --arg 'autoStartCluster' true --arg 'workbenchDevMode' true --argstr 'autoStartClusterArgs' '--trace --trace-workbench'
shell-dev cluster-shell-dev cluster-shell-trace cluster-shell-dev-trace: shell
shell:
nix-shell --max-jobs 8 --cores 0 --show-trace --argstr clusterProfile ${CLUSTER_PROFILE} ${CLUSTER_ARGS_EXTRA}
cli node:
cabal --ghc-options="+RTS -qn8 -A32M -RTS" build bcc-$@
BENCH_REPEATS ?= 3
BENCH_CONFIG ?= both
BENCH_TAG ?= HEAD
BENCH_XARGS ?=
profile-chainsync:
scripts/mainnet-via-fetcher.sh ${BENCH_XARGS} --node-config-${BENCH_CONFIG} --repeats ${BENCH_REPEATS} --nix --profile time --tag ${BENCH_TAG}
profile-chainsync-fast: BENCH_XARGS=--skip-prefetch
profile-chainsync-fast: profile-chainsync
clean-profile proclean:
rm -f *.html *.prof *.hp *.stats *.eventlog
clean: clean-profile
rm -rf logs/ socket/ cluster.*
full-clean: clean
rm -rf db dist-newstyle .stack-work $(shell find . -name '*~' -or -name '*.swp')
cls:
echo -en "\ec"
.PHONY: stylish-haskell cabal-hashes ghcid ghcid-test run-test test-ghci test-ghcid help clean clean-profile proclean cls setup restore