(rule
 (targets libs.ml.gen)
 (deps
  ../bin/main.exe
  ../dune-file
  ../dune-project
  (source_tree ../bin)
  (source_tree ../src)
  (source_tree ../otherlibs)
  (source_tree ../vendor))
 (action
  (with-stdout-to
   libs.ml.gen
   (run
    %{dep:../bin/main.exe}
    internal
    bootstrap-info
    --no-print-directory
    --root
    %{env:PWD=.}
    --profile
    %{profile}))))

(alias
 (name runtest)
 (deps
  (alias check)))

(rule
 (alias check)
 (action
  (diff libs.ml libs.ml.gen)))

(ocamllex pps)

(executable
 (name duneboot)
 (modules :standard \ configure bootstrap)
 (libraries unix))

(executable
 (name configure)
 (preprocess
  (action
   (run tail -n +2 %{input-file})))
 (modules configure))

(executable
 (name bootstrap)
 (modules bootstrap))
