2017-10-27 22:45:31 +04:00
2018-05-25 11:56:14 +04:00
PACKAGES := $( patsubst %.opam,%,$( notdir $( shell find src vendors -name \* .opam -print) ) )
2017-11-14 02:47:13 +04:00
2018-07-19 01:15:53 +04:00
active_protocol_versions := $( shell cat active_protocol_versions)
active_protocol_directories := $( shell tr -- - _ < active_protocol_versions)
2018-05-25 11:56:14 +04:00
current_opam_version := $( shell opam --version)
2018-01-18 19:18:55 +04:00
i n c l u d e s c r i p t s / v e r s i o n . s h
2018-05-25 11:56:14 +04:00
i f n e q ( $ { c u r r e n t _ o p a m _ v e r s i o n } , $ { o p a m _ v e r s i o n } )
$(error Unexpected opam version (found : ${current_opam_version }, expected : ${opam_version }))
e n d i f
2018-01-18 19:18:55 +04:00
2018-07-05 01:08:20 +04:00
current_ocaml_version := $( shell opam exec -- ocamlc -version)
2017-10-27 22:45:31 +04:00
all :
2018-07-05 01:08:20 +04:00
i f n e q ( $ { c u r r e n t _ o c a m l _ v e r s i o n } , $ { o c a m l _ v e r s i o n } )
$( error Unexpected ocaml version ( found: ${ current_ocaml_version } , expected: ${ ocaml_version } ) )
e n d i f
2018-07-23 17:40:55 +04:00
@dune build \
2018-01-16 19:30:58 +04:00
src/bin_node/main.exe \
2018-02-14 14:01:23 +04:00
src/bin_client/main_client.exe \
src/bin_client/main_admin.exe \
2018-05-26 13:11:45 +04:00
src/bin_signer/main_signer.exe \
2018-02-15 20:07:08 +04:00
src/lib_protocol_compiler/main_native.exe \
2018-07-19 01:15:53 +04:00
$( foreach p, $( active_protocol_directories) , src/proto_$( p) /bin_baker/main_baker_$( p) .exe) \
$( foreach p, $( active_protocol_directories) , src/proto_$( p) /bin_endorser/main_endorser_$( p) .exe) \
$( foreach p, $( active_protocol_directories) , src/proto_$( p) /bin_accuser/main_accuser_$( p) .exe)
2018-01-16 19:30:58 +04:00
@cp _build/default/src/bin_node/main.exe tezos-node
2018-02-14 14:01:23 +04:00
@cp _build/default/src/bin_client/main_client.exe tezos-client
@cp _build/default/src/bin_client/main_admin.exe tezos-admin-client
2018-05-26 13:11:45 +04:00
@cp _build/default/src/bin_signer/main_signer.exe tezos-signer
2018-01-30 19:30:22 +04:00
@cp _build/default/src/lib_protocol_compiler/main_native.exe tezos-protocol-compiler
2018-07-19 01:15:53 +04:00
@for p in $( active_protocol_directories) ; do \
2018-07-19 01:42:31 +04:00
cp _build/default/src/proto_$$ p/bin_baker/main_baker_$$ p.exe tezos-baker-` echo $$ p | tr -- _ -` ; \
cp _build/default/src/proto_$$ p/bin_endorser/main_endorser_$$ p.exe tezos-endorser-` echo $$ p | tr -- _ -` ; \
cp _build/default/src/proto_$$ p/bin_accuser/main_accuser_$$ p.exe tezos-accuser-` echo $$ p | tr -- _ -` ; \
2018-07-19 01:15:53 +04:00
done
2017-10-27 22:45:31 +04:00
2018-02-05 23:08:28 +04:00
all.pkg :
2018-07-23 17:40:55 +04:00
@dune build \
2018-05-25 11:56:14 +04:00
$( patsubst %.opam,%.install, $( shell find src vendors -name \* .opam -print) )
2018-02-05 23:08:28 +04:00
$(addsuffix .pkg,${PACKAGES}) : %.pkg :
2018-07-23 17:40:55 +04:00
@dune build \
2018-05-25 11:56:14 +04:00
$( patsubst %.opam,%.install, $( shell find src vendors -name $* .opam -print) )
2018-02-05 23:08:28 +04:00
$(addsuffix .test,${PACKAGES}) : %.test :
2018-07-23 17:40:55 +04:00
@dune build \
2018-05-25 11:56:14 +04:00
@$( patsubst %/$* .opam,%,$( shell find src vendors -name $* .opam) ) /runtest
2018-01-29 04:06:47 +04:00
2018-01-31 15:23:03 +04:00
doc-html : all
2018-07-23 17:40:55 +04:00
@dune build @doc
2018-07-18 11:07:39 +04:00
@./tezos-client -protocol ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK man -verbosity 3 -format html | sed " s# ${ HOME } #\$ $HOME #g " > docs/api/tezos-client.html
@./tezos-admin-client man -verbosity 3 -format html | sed " s# ${ HOME } #\$ $HOME #g " > docs/api/tezos-admin-client.html
@./tezos-signer man -verbosity 3 -format html | sed " s# ${ HOME } #\$ $HOME #g " > docs/api/tezos-signer.html
@./tezos-baker-alpha man -verbosity 3 -format html | sed " s# ${ HOME } #\$ $HOME #g " > docs/api/tezos-baker-alpha.html
@./tezos-endorser-alpha man -verbosity 3 -format html | sed " s# ${ HOME } #\$ $HOME #g " > docs/api/tezos-endorser-alpha.html
@./tezos-accuser-alpha man -verbosity 3 -format html | sed " s# ${ HOME } #\$ $HOME #g " > docs/api/tezos-accuser-alpha.html
2017-11-11 14:40:20 +04:00
@mkdir -p $$ ( pwd ) /docs/_build/api/odoc
@rm -rf $$ ( pwd ) /docs/_build/api/odoc/*
@cp -r $$ ( pwd ) /_build/default/_doc/* $$ ( pwd ) /docs/_build/api/odoc/
2018-07-24 18:54:45 +04:00
@${ MAKE } -C docs html
doc-linkcheck :
@${ MAKE } -C docs linkcheck
2017-11-03 19:02:38 +04:00
2017-10-27 22:45:31 +04:00
build-test :
2018-07-23 17:40:55 +04:00
@dune build @buildtest
2017-10-27 22:45:31 +04:00
test :
2018-07-23 17:40:55 +04:00
@dune runtest
2018-01-29 04:26:41 +04:00
@./scripts/check_opam_test.sh
2017-10-27 22:45:31 +04:00
2018-01-27 14:21:41 +04:00
test-indent :
2018-07-23 17:40:55 +04:00
@dune build @runtest_indent
2018-01-27 14:21:41 +04:00
2018-02-22 14:07:26 +04:00
fix-indent :
@src/lib_stdlib/test-ocp-indent.sh fix
2017-10-27 22:45:31 +04:00
build-deps :
@./scripts/install_build_deps.sh
docker-image :
@./scripts/create_docker_image.sh
2018-01-26 19:28:13 +04:00
install :
2018-07-23 17:40:55 +04:00
@dune build @install
@dune install
2018-01-26 19:28:13 +04:00
2018-02-21 21:34:55 +04:00
uninstall :
2018-07-23 17:40:55 +04:00
@dune uninstall
2018-02-21 21:34:55 +04:00
2017-10-27 22:45:31 +04:00
clean :
2018-07-23 17:40:55 +04:00
@-dune clean
2018-02-15 20:07:08 +04:00
@-rm -f \
tezos-node \
tezos-client \
2018-07-19 01:15:53 +04:00
tezos-signer \
2018-02-15 20:07:08 +04:00
tezos-admin-client \
tezos-protocol-compiler \
2018-07-19 01:42:31 +04:00
$( foreach p, $( active_protocol_versions) , tezos-baker-$( p) tezos-endorser-$( p) tezos-accuser-$( p) )
2018-03-15 21:25:38 +04:00
@-${ MAKE } -C docs clean
2018-07-18 11:07:39 +04:00
@-rm -f docs/api/tezos-{ baker,endorser,accuser} -alpha.html docs/api/tezos-{ admin-,} client.html docs/api/tezos-signer.html
2017-10-27 22:45:31 +04:00
.PHONY : all test build -deps docker -image clean