(executables
 (names main)
 (libraries
  ppxlib
  toplevel_expect_test
  js_of_ocaml.deriving
  js_of_ocaml-ppx_deriving_json)
 (modes byte)
 (link_flags (-linkall)))

(rule
 (targets ppx.mlt.corrected)
 (deps
  ../../../lib/deriving_json/.js_of_ocaml_deriving.objs/byte/deriving_Json.cmi
  ../../../lib/deriving_json/.js_of_ocaml_deriving.objs/byte/deriving_Json_lexer.cmi)
 (action
  (run %{exe:main.bc} %{dep:ppx.mlt})))

(rule
 (targets gen.mlt.corrected)
 (deps
  ../../../lib/deriving_json/.js_of_ocaml_deriving.objs/byte/deriving_Json.cmi
  ../../../lib/deriving_json/.js_of_ocaml_deriving.objs/byte/deriving_Json_lexer.cmi)
 (action
  (run %{exe:main.bc} %{dep:gen.mlt})))

(rule
 (alias runtest)
 (enabled_if
  (>= %{ocaml_version} 5.1))
 ;; (package js_of_ocaml-ppx)
 (action
  (diff ppx.mlt ppx.mlt.corrected)))

(rule
 (alias runtest)
 (enabled_if
  (>= %{ocaml_version} 5.3))
 ;; (package js_of_ocaml-ppx)
 (action
  (diff gen.mlt gen.mlt.corrected)))
