camlspotter.bitbucket.org / omy / _sources / GeneralUsage.txt

================================
General usage of OMy
================================

Installation steps
===========================

0. Create a new directory and cd into it.

1. ``omake --install`` to create OMakefile and OMakeroot.

2. Copy OMy's OMy* files.

3. Edit OMakefile and include OMy* files at its head::

    include OMyMakefile
    include OMyExternal # If you want
    include OMyTar      # If you want 

4. If your project requires OCamlFind packages, and if they are installed already, you should add their names to OCAML_PREINSTALLED_PACKS::

      OCAML_PREINSTALLED_PACKS[] += llvm

   If a package is listed in OCAMLPACKS or CAMLP4PACKS but not in OCAML_PREINSTALLED_PACKS, 
   OMy thinks that the package is buildable from the source code.

5. Write your build rules using OMy functions. Happy hacking!

Living with package sources
===========================

In OMy framework, you can have more than one sub-projects, where some of them provide OCamlFind packages for others::

    $ ls -R
    ./:
        OMakefile
        OMakeroot 
        OMyMakefile
        library_x/
        program_y/

    ./library_x:
        OMakefile
        library.ml

    ./program_y:
        OMakefile
        program.ml
 
Here library_x provides an OCamlFind package "library_x", and program_y uses it. 
OMakefiles under library_x/ and program_y/ should look as follows.

library_x/OMakefile::

    LIBFILES[]=
        library

    CMODULES[]=

    CLIBRARY[]=

    MyOCamlPackage(library_x, $(LIBFILES), $(CMODULES), $(CLIBRARY))
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.