blob: 03f10489edbfacec8053ca36063e9661e1f4268a [file] [log] [blame]
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace ocaml_binary}
/***/
{template .soyweb}
{call buck.page}
{param title: 'ocaml_binary()' /}
{param navid: 'rule_ocaml_binary' /}
{param prettify: true /}
{param description}
A ocaml_binary() rule builds a native OCaml executable.
{/param}
{param content}
{call buck.rule}
{param status: 'UNFROZEN' /}
{param overview}
<p>
A ocaml_binary() rule builds both native and bytecode executables from the supplied set of OCaml and C source files
and dependencies.
</p>
<p>
{call ocaml_common.supported_language_version /}
</p>
{/param}
{param args}
{call buck.name_arg /}
{call ocaml_common.srcs_arg /}
{call ocaml_common.deps_arg /}
{call buck.platform_deps_arg /}
{call ocaml_common.compiler_flags_arg /}
{/param} // close args
{param examples}
{call ocaml_common.more_examples /}
{literal}<pre class="prettyprint lang-py">
ocaml_binary(
name='greet',
srcs=[
'main.ml',
'lex.mll',
'parser.mly',
'hashtable.c',
],
deps=[
':greeting',
':bridge',
],
)
ocaml_library(
name='greeting',
srcs=[
'greeting.ml',
],
deps=[
':join',
],
)
ocaml_library(
name='join',
srcs=[
'join.ml',
],
)
cxx_library(
name='bridge',
srcs=[
'bridge.c',
],
)
</pre>{/literal}
{/param}
{/call} // close buck.rule
{/param}
{/call}
{/template}