(jbuild_version 1)

(library
 ((name migrate_parsetree)
  (public_name ocaml-migrate-parsetree)
  (wrapped false)
  (libraries (compiler-libs.common result))
  (flags (:standard -open Result))
  (modules (:standard \ migrate_parsetree_driver_main))
  (preprocess (action (run ${exe:../tools/pp.exe} ${read:ast-version} ${<})))))

(library
 ((name migrate_parsetree_driver_main)
  (public_name ocaml-migrate-parsetree.driver-main)
  (modules (migrate_parsetree_driver_main))
  (library_flags (-linkall))
  (libraries (migrate_parsetree))))

(rule
 (copy#
  compiler-functions/${read:compiler-functions-file}
  migrate_parsetree_compiler_functions.ml))

(rule
 ((targets (ast-version compiler-functions-file))
  (action  (run ${OCAML} ${path:config/gen.ml} ${ocaml_version}))))
