ligo/test/proto_alpha/Makefile
Grégoire Henry 370112f9b8 Makefile: simplify the compilation process.
This patch is co-authored with: cagdas.bozman@ocamlpro.com

With this patch the economic protocol is now compiled as as
"functor-pack", parameterized over the environment. This will ease the
protocol reusability outside of the tezos source tree (e.g. for a
michelson Web IDE) and will allow proper unit testing of the economic
protocol.

This functorization allows to break the dependency of the
'tezos-protocol-compiler' on various '.mli' of the node, and hence
we don't need anymore the unusual compilation schema:

  a.mli -> b.mli -> b.ml -> a.ml

where 'A' is linked after 'B' but 'a.mli' should still be compiled
before 'b.mli'. This will simplify a switch to 'ocp-build' or 'jbuiler'.
2017-10-11 13:44:09 +00:00

131 lines
2.9 KiB
Makefile

SRCDIR=../../src
TESTS := \
transaction \
origination \
endorsement \
vote \
include ../Makefile.shared
SOURCE_DIRECTORIES := \
${CLIENT_SOURCE_DIRECTORIES} \
${SRCDIR}/proto \
${SRCDIR}/client/embedded \
${SRCDIR}/client/embedded/alpha \
${SRCDIR}/client/embedded/alpha/baker \
../lib
LIB := \
${PACKERLIB} ${MINUTILSLIB} ${UTILSLIB} ${COMPILERLIB} \
${NODELIB} ${EMBEDDED_CLIENT_PROTOCOLS} ${CLIENTLIB} ${TESTLIB}
PACKAGES := \
${CLIENT_PACKAGES} \
kaputt \
OPENED_MODULES := \
${CLIENT_OPENED_MODULES} \
Client_alpha Client_proto_alpha Tezos_context
${SRCDIR}/client/embedded/alpha/%.cmi: ${SRCDIR}/client/embedded/alpha/%.mli
${MAKE} -C ${SRCDIR} client/embedded/client_alpha.cmx
${SRCDIR}/client/embedded/alpha/%.cmx: ${SRCDIR}/client/embedded/alpha/%.ml
${MAKE} -C ${SRCDIR} client/embedded/client_alpha.cmx
############################################################################
## Transactions
.PHONY:run-test-transaction
run-test-transaction:
@echo
./test-transaction
TEST_TRANSACTION_IMPLS := \
proto_alpha_helpers.ml \
test_transaction.ml
test-transaction: ${LIB} ${TEST_TRANSACTION_IMPLS:.ml=.cmx}
@echo COMPILE $(notdir $@)
@${OCAMLOPT} -linkall -linkpkg ${OCAMLFLAGS} -o $@ $^
clean::
rm -f test-transaction
############################################################################
## Origination
.PHONY:run-test-origination
run-test-origination:
@echo
./test-origination
TEST_ORIGINATION_IMPLS := \
proto_alpha_helpers.ml \
test_origination.ml
test-origination: ${LIB} ${TEST_ORIGINATION_IMPLS:.ml=.cmx}
@echo COMPILE $(notdir $@)
@${OCAMLOPT} -linkall -linkpkg ${OCAMLFLAGS} -o $@ $^
clean::
rm -f test-origination
############################################################################
## Endorsement
.PHONY:run-test-endorsement
run-test-endorsement:
@echo
./test-endorsement
TEST_ENDORSEMENT_IMPLS := \
proto_alpha_helpers.ml \
test_endorsement.ml
test-endorsement: ${LIB} ${TEST_ENDORSEMENT_IMPLS:.ml=.cmx}
@echo COMPILE $(notdir $@)
@${OCAMLOPT} -linkall -linkpkg ${OCAMLFLAGS} -o $@ $^
clean::
rm -f test-endorsement
############################################################################
## Vote
.PHONY:run-test-vote
run-test-vote:
@echo
./test-vote
TEST_VOTE_IMPLS := \
proto_alpha_helpers.ml \
test_vote.ml
test-vote: ${LIB} ${TEST_VOTE_IMPLS:.ml=.cmx}
@echo COMPILE $(notdir $@)
@${OCAMLOPT} -linkall -linkpkg ${OCAMLFLAGS} -o $@ $^
clean::
rm -f test-vote
############################################################################
## Michelson Parser
.PHONY: run-test-michelson-parser
run-test-michelson-parser:
@echo
./test-michelson-parser
TEST_MICHELSON_PARSER_IMPLS := \
proto_alpha_helpers.ml \
test_michelson_parser.ml
test-michelson-parser: ${LIB} ${TEST_MICHELSON_PARSER_IMPLS:.ml=.cmx}
@echo COMPILE $(notdir $@)
@${OCAMLOPT} -linkall -linkpkg ${OCAMLFLAGS} -o $@ $^
clean::
rm -f test-michelson-parser