Let’s say my project has libraries lib1, lib2 and lib3
and executables exe1, exe2 and exe3.
How do I tell jbuilder to build only exe1?
How do I tell jbuilder to build only lib3?
With my previous ocaml build tool of choice:
obuild build exe-exe1
obuild build lib-lib3
If your libraries are all in their respective folders, like
./lib2 etc. You need to call something like
jbuilder build lib1/lib1.cma
jbuilder build bin/exe1.exe (yes, even on unix you need to append the .exe file extension)
jbuilder build bin/exe1.bc (to build bytecode executable)
you can even directly execute them if you want to, like this
jbuilder exec bin/exe1.exe command_line_params - it will build it if needed
Currently, I have to issue the much less convenient:
jbuilder build _build/default/src/<myprogram>.exe
And I am thinking
jbuilder build myprogram.exe
would be way more convenient …
jbuilder build exe-myprogram
would be more classy.
I’m pretty sure you just have to write
jbuilder src/myprogram.exe instead of all that. If you also want to run it easily you can also use a
(public_name myprogram) option in the jbuild file, which will let you run it with
jbuilder exec myprogram.
jbuilder build src/my_program.exe