Skip to content
Example build system for making mixed C/Ocaml binaries where the main program is in C
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
build
clean
generic
main
main.c
prog.ml
prog.mli
wrapper.c
wrapper.h

README.md

ocaml-main-program-in-c

Example build system for making mixed C/Ocaml binaries where the main program will be in C.

Should work on Unixes and Windows mingw.

Consists of three bash files: build, clean, and generic.

  1. Edit build as appropriate

  2. Run build. This builds the static and dynamic library (if on Windows) and test links them. It outputs the linker and link flags used for static and dynamic linking.

  3. Run clean to clean up everything except the executable(s)

For example, as shipped, we build libprog.a and (on windows) libprog.dll. It will build main(.exe) (statically linked) on all platforms and main-shared.exe (relying on the .dll) on Windows.

Credit: Gerd Stoplmann for his article which forms the basis of this script.

You can’t perform that action at this time.