(executable
  (name main)
  (public_name orpie)
  (preprocess
    (action
      (system "camlp5o %{input-file}")))
  (flags (:standard -w -27-35-52 -thread))
  (libraries curses gsl num str threads))


; Use orpie.opam as the authoritative source of version number
(rule
  (targets version.ml)
  (action (system "grep '^version:' %{deps} | sed -E 's/^version: *\"([^\"]*)\"/let version = \"\\1\"/' > %{targets}"))
  (deps (file %{project_root}/orpie.opam)))


; Support $PREFIX for overriding installation location
(rule
  (targets install.ml)
  (action (run %{project_root}/scripts/compute_prefix subst %{deps} %{targets}))
  (deps (file install.ml.in)))


(ocamllex txtin_lexer)

(ocamlyacc txtin_parser)

