Quantcast
Channel: OCaml - Topics tagged dune
Viewing all articles
Browse latest Browse all 520

How do I specify an Ocaml to Coq dependency across dune files?

$
0
0

@cpitclaudel wrote:

Hi all,

I have a Coq file set up to create an OCaml file through extraction. The Coq file (extraction.v) is built with dune:

(coq.theory
 (name test)
 (modules Extraction))

Extraction.v has just this:

Require Import Extraction.
Extraction "test.ml" nat.

Running dune build Extraction.vo creates extraction.vo and test.ml in the build directory, as expected.

Now in the ocaml/ subdirectory of my main directory I main.ml, which uses the code in test.ml, and another dune file:

(executable
 (name main)
 (modules test main))

At the moment, I use a custom makefile to copy the generated test.ml from Dune’s build directory to ocaml/, which isn’t great. How can I teach dune to understand that it needs to compile Extraction.v to generate main.ml? And how do I ask it to copy the generated test.ml into the ocaml/ directory?

Or should I not copy test.ml at all? (In that case, how do I just tell dune to build it by compiling Extraction.vo?

Thanks!

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 520

Trending Articles