OCamake - Copyright (c)2002-2003 Nicolas Cannasse & Motion Twin.
The last version of this software can be found at : http://tech.motion-twin.com
This software is provided "AS IS" without any warranty of any kind, merchantability or fitness for a particular purpose. You should use it at your own risks, as the author and his company won't be responsible for any problem that the usage of this software could raise.
OCamake is an automatic compiler for the Objective Caml language. It removes pain from the user which does not need anymore to write a Makefile. OCamake can work either as an application which compile your program or as a Makefile generator (using the
-mak flag). OCamake has also special features for integration under Microsoft Visual Studio.
OCamake is a source-only distribution, so you need to compile it first. Type the following command-line:
ocamlc unix.cma str.cma ocamake.ml -o ocamake.exe
This should produce a file "
ocamake.exe". Copy this file in your
To compile your project, simply call OCamake with the files you want to compile:
ocamake *.ml *.mli
To remove all intermediate files that have been produced by the compiler :
ocamake -clean *.ml *.mli
To generate a Makefile:
ocamake -mak *.ml *.mli
(Windows users can use
nmake instead of make and should use
nmake wclean to remove intermediate files)
OCamake works with the following files :
ml, mli : theses files are added to the list of files to build
cmo, cmx, cma, cmxa, dll, so, lib, a, o, obj : theses files are added to the library list
mll, mly : theses files are compiled using
ocamlyacc, and their result are added to the list of files to build.
dsp, vcproj (Visual Studio Project) : all the files included in the project are added to the ocamake file list.
Once the final file list is made, OCamake run
ocamldep to build module dependencies tree, and then build and link the tree in the good order (for more informations on the algorithm used, see sources).
Only modified sources files or files with one dependency modified are rebuilt.
dsp file has been found or if the
-epp flag has been set, then all compilation errors are processed by OCamake to transform them into a Visual Studio compatible format.
dsp file has been found or if the
-cpp flag has been set, the character ranges in Ocaml errors are replaced by the corresponding expression found in the source file.
The following command-line options are available :
-clean : delete all the intermediate and ouput files for the target build.
-mak : generate a
Makefile for this project (still experimental).
-opt : turn on native compilation.
-a : build a library (
cma or cmxa).
-o <output> : set the output file for the project.
-all : rebuild the entire project.
-cpp : convert characters range in errors to file expression.
-epp : use MSVC error messages format.
-g : compile and link in debug mode.
-pp <command> : pipe source through preprocessor.
-cp <flag> : add this flag to the compiler command line paramaters.
-lp <flag> : add this flag to the linker command line paramaters.
-I <path> : add the path to the list of include directories.
-n <file> : remove that file from the file list : this can be useful when you want to have all the files but one (
ocamake -n myfile.ml *.ml *.mli).
-v : verbose mode - this print all the commands that ocamake is running in order to build the project.
-P <file> : add priority to a given file when having cycle between modules.
The full source code of OCamake is included, so you can modify, use, and redistribute it as you want for any usage conform to the licence. This code is under the LGPL (GNU Lesser General Public Licence), you can get more informations on www.gnu.org.
Nicolas Cannasse firstname.lastname@example.org
Website : http://tech.motion-twin.com
Thanks to Lexifi.