(install
 (section bin)
 (package coq)
 (files (coqtop_bin.exe as coqtop)))

(executable
 (name coqtop_bin)
 (public_name coqtop.opt)
 (package coq)
 (modules coqtop_bin)
 (libraries coq.toplevel)
 (link_flags -linkall))

(executable
 (name coqtop_byte_bin)
 (public_name coqtop.byte)
 (package coq)
 (modules coqtop_byte_bin)
 (libraries compiler-libs.toplevel coq.toplevel)
 (modes byte)
 (link_flags -linkall))

(executable
 (name coqc_bin)
 (public_name coqc)
 (package coq)
 (modules coqc_bin)
 (libraries coq.toplevel)
 ; Adding -ccopt -flto to links options could be interesting, however,
 ; it doesn't work on Windows
 (link_flags -linkall))

(install
 (section bin)
 (package coq)
 (files (coqc_bin.bc as coqc.byte)))

; Workers
(executables
 (names coqqueryworker_bin coqtacticworker_bin coqproofworker_bin)
 (public_names coqqueryworker.opt coqtacticworker.opt coqproofworker.opt)
 (package coq)
 (modules :standard \ coqtop_byte_bin coqtop_bin coqc_bin)
 (libraries coq.toplevel)
 (link_flags -linkall))

; Workers installed targets
(alias
 (name topworkers)
 (deps %{bin:coqqueryworker.opt} %{bin:coqtacticworker.opt} %{bin:coqproofworker.opt}))
