(ocamllex cppo_lexer)

(ocamlyacc cppo_parser)

(rule
 (targets cppo_version.ml)
 (action
  (with-stdout-to
   %{targets}
   (echo "let cppo_version = \"%{version:cppo}\""))))

(executable
 (name cppo_main)
 (package cppo)
 (public_name cppo)
 (modules :standard \ compat)
 (preprocess (per_module
  ((action (progn
    (run ocaml %{dep:compat.ml} %{input-file})
    (cat %{input-file}))) cppo_eval)))
 (libraries unix str))
