-
Notifications
You must be signed in to change notification settings - Fork 721
/
Makefile
100 lines (79 loc) · 3.91 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
help: ## Print documentation
@{ grep -hE '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST); echo -e '$(EXTRA_HELP)'; } | sed 's/^ //' | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-33s\033[0m %s\n", $$1, $$2}'
include lib.mk
include nix.mk
PROJECT_NAME = cardano-node
NUM_PROC = $(nproc --all)
## One of: shey alra mary alzo bage coay
ERA ?= coay
PROFILE ?= default-${ERA}
BACKEND ?= supervisor
REV ?= master
ITER ?=
BATCH ?=
ARGS ?=
CMD ?=
RUN ?=
lint hlint: ## Run the CI version of hlint
nix build --no-link '.#checks/hlint' --cores 0
haddock-hoogle haddocks hoogle:
if test -z "$$IN_NIX_SHELL"; then nix-shell --run 'cabal update && cabal haddock all --haddock-hoogle'; else cabal update && cabal haddock all --haddock-hoogle; fi
host-hlint: ## Run the system (not Nix) version of hlint
hlint bench cardano-{api,cli,node,node-capi,node-chairman,submit-api,testnet,tracer}
stylish-haskell: ## Apply stylish-haskell on all *.hs files
@find . -type f -name "*.hs" -not -path '.git' -print0 | xargs -0 stylish-haskell -i
cabal-hashes:
nix run .#checkCabalProject
cli node:
cabal --ghc-options="+RTS -qn8 -A32M -RTS" build cardano-$@
trace-documentation:
cabal run -- exe:cardano-node trace-documentation --config 'configuration/cardano/mainnet-config-new-tracing.yaml' --output-file 'doc/new-tracing/tracers_doc_generated.md'
###
### Workbench
###
workbench-ci: workbench-ci-test ci-test-auto ci-test-autonix
CI_TARGETS := hlint workbench-ci haddock-hoogle
ci: ci-report ci-targets
ci-report:
@echo -e "\033[34mGoals under test\033[0m: \033[33m$(CI_TARGETS)\033[0m"
ci-targets: $(CI_TARGETS)
workbench-internals-walkthrough:
emn nix/workbench/doc.org
##
## Base targets:
##
shell: ## Nix shell, (workbench from /nix/store), vars: PROFILE, CMD, RUN
nix-shell -A 'workbench-shell' --max-jobs 8 --cores 0 --show-trace --argstr profileName ${PROFILE} --argstr backendName ${BACKEND} ${ARGS} ${if ${CMD},--command "${CMD}"} ${if ${RUN},--run "${RUN}"}
shell-dev shell-prof shell-nix: shell
shell-nix: ARGS += --arg 'useCabalRun' false ## Nix shell, (workbench from Nix store), vars: PROFILE, CMD, RUN
shell-prof: ARGS += --arg 'profiling' '"space"' ## Nix shell, everything Haskell built profiled
analyse: RUN := wb analyse std ${TAG}
analyse: shell
list-profiles: ## List workbench profiles
nix build .#all-profiles-json && cat result
show-profile: ## NAME=profile-name
@test -n "${NAME}" || { echo 'HELP: to specify profile to show, add NAME=profle-name' && exit 1; }
nix build .#all-profiles-json --json --option substitute false | jq '.[0].outputs.out' -r | xargs jq ".\"${NAME}\" | if . == null then error(\"\n###\n### Error: unknown profile: ${NAME} Please consult: make list-profiles\n###\") else . end"
ps: ## Plain-text list of profiles
@nix build .#workbench.profile-names-json --json | jq '.[0].outputs.out' -r | xargs jq '.[]' --raw-output
##
## Profile-based cluster shells (autogenerated targets)
##
## wb_profiles.mk is autogenerated by `cardano-profile lib-make`. It contains all known profile families and flavours (minus the era, backend and shell type suffixes).
## After adding or removing profile definitions in `cardano-profile`, you'll probably want to also commit a regenerated version of that file.
##
include wb_profiles.mk
$(eval $(call define_profile_targets, $(LOCAL_PROFILES)))
$(eval $(call define_profile_targets_nomadcloud,$(CLOUD_PROFILES)))
###
### Misc
###
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 $(shell find . -name '*~' -or -name '*.swp')
cls:
echo -en "\ec"
.PHONY: cabal-hashes clean cli cls cluster-profiles help node run-test shell shell-dev stylish-haskell $(LOCAL_PROFILES) workbench-ci-test