Skip to content

Example build system for making mixed C/Ocaml binaries where the main program is in C

Notifications You must be signed in to change notification settings

johnwhitington/ocaml-main-program-in-c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Example build system for making mixed C/Ocaml binaries where the main program is in C

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published