Source

camlspotter.bitbucket.org / omy / OMyMakefile.html

Full commit
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>OMyMakefile &mdash; OMyMakefile v1.0.0 documentation</title>
    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '#',
        VERSION:     '1.0.0',
        COLLAPSE_MODINDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="top" title="OMyMakefile v1.0.0 documentation" href="index.html" />
    <link rel="next" title="OMyTar" href="OMyTar.html" />
    <link rel="prev" title="OMyExternal" href="OMyExternal.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="OMyTar.html" title="OMyTar"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="OMyExternal.html" title="OMyExternal"
             accesskey="P">previous</a> |</li>
        <li><a href="index.html">OMyMakefile v1.0.0 documentation</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="omymakefile">
<h1>OMyMakefile<a class="headerlink" href="#omymakefile" title="Permalink to this headline"></a></h1>
<p>Useful functions to build OCaml projects</p>
<div class="section" id="directories">
<h2>Directories<a class="headerlink" href="#directories" title="Permalink to this headline"></a></h2>
<p id="index-37">BIG_ROOT</p>
<blockquote>
<div class="highlight-python"><pre>= $(dir .)</pre>
</div>
<p>The build root directory</p>
</blockquote>
<p id="index-38">PREFIX</p>
<blockquote>
<div class="highlight-python"><pre>= $(getenv PREFIX)</pre>
</div>
<p>The prefix. Equal to the PREFIX environment variable</p>
</blockquote>
</div>
<div class="section" id="installation-mark-files">
<h2>Installation mark files<a class="headerlink" href="#installation-mark-files" title="Permalink to this headline"></a></h2>
<p id="index-39">INSTALLED</p>
<blockquote>
<div class="highlight-python"><pre>= $(BIG_ROOT)/installed</pre>
</div>
<p>Installation mark files are put inside this directory.</p>
</blockquote>
<p id="index-40">Installed(packs)</p>
<blockquote>
Returns the installation mark files of $(packs)</blockquote>
<p id="index-41">CreateInstalled(pack, targets)</p>
<blockquote>
Create $(Installed $(pack)) file from the digests of $(targets)</blockquote>
</div>
<div class="section" id="misc-tools">
<h2>Misc tools<a class="headerlink" href="#misc-tools" title="Permalink to this headline"></a></h2>
<p id="index-42">mkdir_if_not_exists(dir)</p>
<blockquote>
ditto.</blockquote>
</div>
<div class="section" id="ocamlfind">
<h2>OCamlFind<a class="headerlink" href="#ocamlfind" title="Permalink to this headline"></a></h2>
<p id="index-43">USE_OCAMLFIND</p>
<blockquote>
<div class="highlight-python"><pre>=  true</pre>
</div>
<p>OMy requires OCamlFind! Do not ask me how to use OMy without OCamlFind. Please.</p>
</blockquote>
<p id="index-44">OCAMLFIND_PREINSTALLED_PACKAGES[]</p>
<blockquote>
<div class="highlight-python"><pre>=  bigarray camlp4 dbm dynlink graphics num num-top stdlib str threads unix</pre>
</div>
<p>Preinstalled libraries which are always available for normal ocaml.</p>
<p>You may want to add the required packages which are built and installed out of OMy framework:</p>
<div class="highlight-python"><pre>include OMyMakefile

OCAMLFIND_PREINSTALLED_PACKAGES += findlib # findlib has been installed already, independently

Subdirs()</pre>
</div>
</blockquote>
<p id="index-45">BYTE_ENABLED</p>
<blockquote>
<div class="highlight-python"><pre>=  true</pre>
</div>
<p>If set false in a project directory, byte compilation is disabled there.</p>
</blockquote>
</div>
<div class="section" id="spot-files-ocamlspotter">
<h2>Spot files (OCamlSpotter)<a class="headerlink" href="#spot-files-ocamlspotter" title="Permalink to this headline"></a></h2>
<p id="index-46">setenv(OCAML_ANNOT, 1)</p>
<blockquote>
Define OCAML_ANNOT so that custom ocamlc/ocamlopt automatically create spot/spit/annot files</blockquote>
</div>
<div class="section" id="packages">
<h2>Packages<a class="headerlink" href="#packages" title="Permalink to this headline"></a></h2>
<dl class="docutils" id="index-47">
<dt>public.OCAMLPACKS[]</dt>
<dd>OCaml packages required for compilation. MyCaml* functions automatically add necessary dependencies over packages in $(OCAMLPACKS).</dd>
</dl>
<dl class="docutils" id="index-48">
<dt>public.CAMLP4PACKS[]</dt>
<dd>CamlP4 syntax extension packages required for parsing. MyCaml* functions automatically add necessary dependencies over packages in $(CAMLP4PACKS).</dd>
</dl>
</div>
<div class="section" id="dependencies">
<h2>Dependencies<a class="headerlink" href="#dependencies" title="Permalink to this headline"></a></h2>
<p id="index-49">RequirePackages(packages)</p>
<blockquote>
Add dependencies of any build activity over $(packages).
This introduces implicit rule: <em>you may need to export it, if you use this function in a local context.</em></blockquote>
<p id="index-50">OCamlRequirePackages(packages)</p>
<blockquote>
<p>Add dependencies of OCaml compiled files (cmx, cmo, etc.) over $(packages).
$(packages) listed in OCAMLFIND_PREINSTALLED_PACKAGES are ignored.</p>
<p>Usually you do not need to call this function. Use OCAMLPACKS variable instead.
This introduces implicit rule: <em>you may need to export it, if you use this function in a local context.</em></p>
</blockquote>
<p id="index-51">OCamlRequireCamlP4Packages(packages)</p>
<blockquote>
<p>Add dependencies of OCaml dependency analysis and build over $(packages).
Use this for adding dependencies for CamlP4 extensions.
$(packages) listed in OCAMLFIND_PREINSTALLED_PACKAGES are ignored.</p>
<p>Usually you do not need to call this function. Use CAML4PACKS variable instead.
This introduces implicit rule: <em>you may need to export it, if you use this function in a local context.</em></p>
</blockquote>
<p id="index-52">%.auto.mli: %.ml</p>
<blockquote>
<tt class="docutils literal"><span class="pre">omake</span> <span class="pre">xxx.auto.mli</span></tt> generates .mli file from xxx.ml</blockquote>
</div>
<div class="section" id="build-rules">
<h2>Build rules<a class="headerlink" href="#build-rules" title="Permalink to this headline"></a></h2>
<p id="index-53">MyOCamlPackage(library_name, files, cmodules, linkopts)</p>
<blockquote>
<dl class="docutils">
<dt>Add a rule for OCaml package $(library_name).cmo, $(library_name).cmx and etc.</dt>
<dd><dl class="first last docutils">
<dt>library_name</dt>
<dd>target package name</dd>
<dt>files</dt>
<dd>ML module names (without .ml)</dd>
<dt>cmodules</dt>
<dd>C source files (without .c)</dd>
<dt>linkopts</dt>
<dd>C library link option (without OCaml -cclib options)</dd>
</dl>
</dd>
</dl>
<p>Example: MyOCamlPackage(foo, alpha beta, $(EMPTY), $(EMPTY))</p>
<p>Todo: external C library</p>
</blockquote>
<p id="index-54">MyOCamlProgram(name, files)</p>
<blockquote>
<dl class="docutils">
<dt>Add a rule to build a program $(name)</dt>
<dd><dl class="first last docutils">
<dt>name</dt>
<dd>Name of the program</dd>
<dt>files</dt>
<dd>OCaml module names (without .ml)</dd>
</dl>
</dd>
</dl>
</blockquote>
<p id="index-55">MyOCamlLibrary(name, files)</p>
<blockquote>
<dl class="docutils">
<dt>Add a rule to build OCaml library $(name)</dt>
<dd><dl class="first last docutils">
<dt>name</dt>
<dd>Name of the library</dd>
<dt>files</dt>
<dd>OCaml module name (without .ml)</dd>
</dl>
</dd>
</dl>
</blockquote>
</div>
<div class="section" id="subdir-traversal">
<h2>Subdir traversal<a class="headerlink" href="#subdir-traversal" title="Permalink to this headline"></a></h2>
<p id="index-56">Subdirs_except(dirs)</p>
<blockquote>
Recursively traverse the subdirs except $(dirs)</blockquote>
<p id="index-57">Subdirs()</p>
<blockquote>
Recursively traverse all the subdirs</blockquote>
<p id="index-58">Subdirs_only(dirs)</p>
<blockquote>
Recursively traverse the given subdirs $(dirs)</blockquote>
</div>
<div class="section" id="dependency-dot-files-for-graphviz">
<h2>Dependency dot files for Graphviz<a class="headerlink" href="#dependency-dot-files-for-graphviz" title="Permalink to this headline"></a></h2>
<p id="index-59">Dot()</p>
<blockquote>
Add a rule for <tt class="docutils literal"><span class="pre">depend.dot</span></tt> for a dependency graph of OCaml files in the current directory</blockquote>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <h3><a href="index.html">Table Of Contents</a></h3>
            <ul>
<li><a class="reference external" href="#">OMyMakefile</a><ul>
<li><a class="reference external" href="#directories">Directories</a></li>
<li><a class="reference external" href="#installation-mark-files">Installation mark files</a></li>
<li><a class="reference external" href="#misc-tools">Misc tools</a></li>
<li><a class="reference external" href="#ocamlfind">OCamlFind</a></li>
<li><a class="reference external" href="#spot-files-ocamlspotter">Spot files (OCamlSpotter)</a></li>
<li><a class="reference external" href="#packages">Packages</a></li>
<li><a class="reference external" href="#dependencies">Dependencies</a></li>
<li><a class="reference external" href="#build-rules">Build rules</a></li>
<li><a class="reference external" href="#subdir-traversal">Subdir traversal</a></li>
<li><a class="reference external" href="#dependency-dot-files-for-graphviz">Dependency dot files for Graphviz</a></li>
</ul>
</li>
</ul>

            <h4>Previous topic</h4>
            <p class="topless"><a href="OMyExternal.html"
                                  title="previous chapter">OMyExternal</a></p>
            <h4>Next topic</h4>
            <p class="topless"><a href="OMyTar.html"
                                  title="next chapter">OMyTar</a></p>
            <h3>This Page</h3>
            <ul class="this-page-menu">
              <li><a href="_sources/OMyMakefile.txt"
                     rel="nofollow">Show Source</a></li>
            </ul>
          <div id="searchbox" style="display: none">
            <h3>Quick search</h3>
              <form class="search" action="search.html" method="get">
                <input type="text" name="q" size="18" />
                <input type="submit" value="Go" />
                <input type="hidden" name="check_keywords" value="yes" />
                <input type="hidden" name="area" value="default" />
              </form>
              <p class="searchtip" style="font-size: 90%">
              Enter search terms or a module, class or function name.
              </p>
          </div>
          <script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="OMyTar.html" title="OMyTar"
             >next</a> |</li>
        <li class="right" >
          <a href="OMyExternal.html" title="OMyExternal"
             >previous</a> |</li>
        <li><a href="index.html">OMyMakefile v1.0.0 documentation</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
      &copy; Copyright 2011, Jun FURUSE.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.4.
    </div>
  </body>
</html>