(executable
 (name ffi_types_stubgen)
 (modules ffi_types_stubgen)
 (libraries yaml.bindings.types ctypes.stubs ctypes))

(rule
 (targets ffi_ml_types_stubgen.c)
 (deps ./ffi_types_stubgen.exe)
 (action
  (with-stdout-to
   %{targets}
   (run %{deps}))))

(rule
 (targets ffi_ml_types_stubgen.exe)
 (deps
  (:c ./ffi_ml_types_stubgen.c)
  ../../vendor/libyaml_c_stubs%{ext_lib})
 (action
  (run %{cc} %{c} -I../../vendor %{read-lines:../../config/ctypes-cflags} -I
    %{ocaml_where} -o %{targets})))
