(library
 (name reason_omp)
 (public_name reason.ocaml-migrate-parsetree)
 (wrapped true)
 (libraries ppxlib.astlib)
 (modules :standard \ migrate_parsetree_driver_main)
 (preprocess
  (action
   (run %{exe:../tools/pp.exe} %{read:ast-version} %{input-file})))
 ; (ppx.driver
 ;  (main       Migrate_parsetree.Driver.run_main)
 ;  (flags      --dump-ast)
 ;  (lint_flags --null))
 )

(rule
 (targets caml_format_doc.ml)
 (deps caml_format_doc.cppo.ml)
 (action
  (run %{bin:cppo} -V OCAML:%{ocaml_version} %{deps} -o %{targets})))

; Not needed for reason repo (vendored)
; (library
;  (name reason.migrate_parsetree_driver_main)
;  (public_name reason.ocaml-migrate-parsetree.driver-main)
;  (modules reason.migrate_parsetree_driver_main)
;  (library_flags -linkall)
;  (libraries reason_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} %{dep:config/gen.ml} %{ocaml_version})))
