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

<title>Project Example</title>

<p>
Here is an example of a <link xref="recipe-files">recipe</link> for a simple project:
</p>
<code>
# This is the recipe for the foo project

# Describe this project
project {
  name = foo
  version = 0.0.1
  minimum-bake-version = 1.0
}

# There is a README file that needs to be distributed with the project
data.meta {
  files = README
  install = false
}

# Describe the C program in this project
programs.example-program {
  sources = main.c \
            module.c
}

# Describe an image that is required for this project
data.images {
  files = image1.png
  install-directory = $(options.project-data-directory)/images
}
</code>
<p>
The first line is a comment, and is ignored by Bake.
</p>
<p>
The <em>project.name</em> <link xref="variables">variable</link> defines this recipe as being for the <em>foo</em> project.
This variable tells Bake that this is the top level recipe for this project.
The <em>project.version</em> variable specified this is version <em>0.0.1</em> of the foo project.
The <em>project.minimum-bake-version</em> means that this project requires Bake version 1.0 to build.
</p>
<p>
The <em>data.meta</em> variables states that there is a file called README that is part of the project.
This file should be <link xref="releasing">distributed</link> with the project but is not installed or used in compilation.
</p>
<p>
The <em>programs.example-program.sources</em> variable describes a C <link xref="programs">program</link> that this project produces.
This variable means that when <link xref="building">building</link> Bake will compile a C program called <em>example-program</em> using the source file <em>example-program.c</em>.
The produced executable will be <link xref="installing">installed</link> into an appropriate location and the source file will be distributed with the project.
Note that this variable is spread over more than one line to make it more readable.
</p>
<p>
The <em>data.images.files</em> variables defines some data files that are part of this project.
They will be installed into a subdirectory of the project data directory <em>$(project-data-directory)</em>.
</p>
</page>
