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
.
-
Edit
build
as appropriate -
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. -
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.