<page xmlns="http://projectmallard.org/1.0/" type="guide" id="recipe-files">
<info>
    <!-- Place this at the start of the section -->
    <title type="sort">0</title>
    <link type="guide" xref="index#recipes"/>
</info>

<title>Recipe Files</title>

<p>
To describe your project to Bake you need to have a <em>recipe</em> file in the toplevel directory of your project.
This text file is called <em>Recipe</em> (case sensitive) and defines the components of your project using <link xref="variables">variables</link> and <link xref="rules">rules</link>.
</p>

<p>
The toplevel recipe must contain the variable <em>project.name</em> which defines the name of the project.
</p>
<example>
<p>
For example, the <em>foo</em> project has a file called <em>Recipe</em> in the toplevel of the project.
This file contains:
</p>
<code>
project {
  name = foo
}
</code>
</example>
<p>
Optionally you can specify the version of the project with <em>project.version</em> and the minimum version of Bake required by specifying <em>project.minimum-bake-version</em>.
</p>
<example>
<code>
project {
  name = foo
  version = 0.0.1
  minimum-bake-version = 1.0
}
</code>
</example>
<p>
To make your project more managable you can have recipe files in the subdirectories under the toplevel recipe file.
Each recipe inherits all the variables from the parent so you can define common values in one recipe and use them in any recipes below this one.
You can run Bake from any directory containing a recipe; it will find the toplevel one itself and load all its decendendants.
</p>
<example>
<p>
For example, projects are commonly structured to have source files in a <em>src</em> subdirectory and data files in a <em>data</em> subdirectory.
In this case you would have three recipes, one for defining the project, one for defining the data files and one for defining how the source is compiled:
</p>
<code>
Recipe
data/Recipe
src/Recipe
</code>
</example>
<note>
<p>
You can put comments in your recipes by using the '#' symbol at the start of a line.
</p>
</note>
</page>
