(library
  (name gwrepl_deps)
  (flags -linkall)
  (libraries
    stdlib
    str
    unix
    geneweb_core
    geneweb_def
    geneweb_util
    geneweb_gwdb
    %%%GWDB_PKG%%%
    %%%SOSA_PKG%%%
  )
  (modules)
)

(rule
  (target data.cppo.ml)
  (deps .depend (:maker mk_data.ml))
  (action (with-stdout-to %{target} (run ocaml unix.cma %{maker})))
)

(rule
  (target data.ml)
  (deps data.cppo.ml)
  (action (run %{bin:cppo} %%%CPPO_D%%% %{deps} -o %{target}))
)

(executable
 (name gwrepl)
 (public_name gwrepl)
 (link_flags -linkall -custom)
 (libraries compiler-libs.toplevel unix)
 (preprocess
  (per_module
   ((action (run %{bin:cppo} %%%CPPO_D%%% %{input-file})) gwrepl_exe)
   ((pps ppx_blob) data)
  )
 )
 (modes byte object)
 (modules gwrepl data)
)
