If your libraries are all in their respective folders, like ./lib1./lib2 etc. You need to call something like
jbuilder build lib1/lib1.cma
or
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) jbuilder build bin/exe1.bc.js (if you want to compile to javascript using js_of_ocaml)
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
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.