(library
 (name wasm_of_ocaml_compiler_dynlink)
 (public_name wasm_of_ocaml-compiler.dynlink)
 (library_flags (-linkall))
 (foreign_stubs
  (language c)
  (names stubs))
 (libraries
  wasm_of_ocaml-compiler
  js_of_ocaml-compiler
  js_of_ocaml-compiler.runtime
  compiler-libs.bytecomp))

(rule
 (targets stubs.c)
 (deps
  (glob_files *.ml))
 (mode promote)
 (action
  (with-stdout-to
   %{targets}
   (run ../../lib/gen_stubs/gen_stubs.exe %{deps}))))
