(library
  (name opam_file_format)
  (public_name opam-file-format)
  (synopsis "Parser and printer for the opam file syntax")
  (wrapped false)
  (modules :standard \ flags)
  (flags :standard (:include flags.sexp)))

(rule
  (with-stdout-to flags.ml
    (echo "print_string (if String.sub Sys.ocaml_version 0 5 = \"4.02.\" then \"(-w -50)\" else \"()\")")))

(rule
  (with-stdout-to flags.sexp
    (run ocaml %{dep:flags.ml})))

(ocamlyacc opamBaseParser)
(ocamllex opamLexer)

(env (dev
 (flags (:standard -warn-error -A))))
