(library
 (name belenios_tool_common)
 (modules tool_verifydiff tool_tkeygen tool_election tool_credgen tool_mkelection)
 (libraries belenios))

(library
 (name belenios_tool_js_common)
 (modules tool_js_common tool_js_i18n)
 (libraries js_of_ocaml js_of_ocaml-lwt belenios-platform belenios)
 (preprocess (pps js_of_ocaml-ppx lwt_ppx)))

(install
 (files belenios-tool.html)
 (section share)
 (package belenios-server))

(executable
 (name tool_cmdline)
 (public_name belenios-tool)
 (package belenios-tool)
 (modules tool_cmdline)
 (libraries cmdliner belenios-platform-native belenios belenios_tool_common))

(executable
 (name tool_js_booth)
 (modes js)
 (modules tool_js_booth)
 (js_of_ocaml (javascript_files ../../ext/sjcl/sjcl.js ../../ext/jsbn/BigIntCompatFull.js ../platform/js/random.js))
 (libraries js_of_ocaml-lwt belenios-platform-js belenios belenios_tool_common belenios_tool_js_common)
 (preprocess (pps js_of_ocaml-ppx lwt_ppx)))

(executable
 (name tool_js_credgen)
 (modes js)
 (modules tool_js_credgen)
 (js_of_ocaml (javascript_files ../../ext/sjcl/sjcl.js ../../ext/jsbn/BigIntCompatFull.js ../platform/js/random.js))
 (libraries js_of_ocaml-lwt belenios-platform-js belenios belenios_tool_common belenios_tool_js_common)
 (preprocess (pps js_of_ocaml-ppx lwt_ppx)))

(executable
 (name tool_js_tkeygen)
 (modes js)
 (modules tool_js_tkeygen)
 (js_of_ocaml (javascript_files ../../ext/sjcl/sjcl.js ../../ext/jsbn/BigIntCompatFull.js ../platform/js/random.js))
 (libraries js_of_ocaml-lwt belenios-platform-js belenios belenios_tool_common belenios_tool_js_common)
 (preprocess (pps js_of_ocaml-ppx lwt_ppx)))

(executable
 (name tool_js_ttkeygen)
 (modes js)
 (modules tool_js_ttkeygen)
 (js_of_ocaml (javascript_files ../../ext/sjcl/sjcl.js ../../ext/jsbn/BigIntCompatFull.js ../platform/js/random.js))
 (libraries js_of_ocaml-lwt belenios-platform-js belenios belenios_tool_common belenios_tool_js_common)
 (preprocess (pps js_of_ocaml-ppx lwt_ppx)))

(executable
 (name tool_js_pd)
 (modes js)
 (modules tool_js_pd)
 (js_of_ocaml (javascript_files ../../ext/sjcl/sjcl.js ../../ext/jsbn/BigIntCompatFull.js ../platform/js/random.js))
 (libraries js_of_ocaml-lwt belenios-platform-js belenios belenios_tool_common belenios_tool_js_common)
 (preprocess (pps js_of_ocaml-ppx lwt_ppx)))

(executable
 (name tool_js_questions)
 (modes js)
 (modules tool_js_questions)
 (js_of_ocaml (javascript_files ../../ext/sjcl/sjcl.js ../../ext/jsbn/BigIntCompatFull.js ../platform/js/random.js))
 (libraries js_of_ocaml-lwt belenios-platform-js belenios belenios_tool_common belenios_tool_js_common)
 (preprocess (pps js_of_ocaml-ppx lwt_ppx)))

(executable
 (name tool_js_shuffle)
 (modes js)
 (modules tool_js_shuffle)
 (js_of_ocaml (javascript_files ../../ext/sjcl/sjcl.js ../../ext/jsbn/BigIntCompatFull.js ../platform/js/random.js))
 (libraries js_of_ocaml-lwt belenios-platform-js belenios belenios_tool_common belenios_tool_js_common)
 (preprocess (pps js_of_ocaml-ppx lwt_ppx)))

(executable
 (name tool_js)
 (modes js)
 (modules tool_js)
 (js_of_ocaml (javascript_files ../../ext/sjcl/sjcl.js ../../ext/jsbn/BigIntCompatFull.js ../platform/js/random.js))
 (libraries js_of_ocaml-lwt belenios-platform-js belenios belenios_tool_common belenios_tool_js_common)
 (preprocess (pps js_of_ocaml-ppx lwt_ppx)))
