User guide

Creating Projects
lists of components being used, which are combined here to form the COMPONENTS
variable.
COMPONENTS is then used to construct: the include search path, and a list of the makefile
fragments supplied by the various components. These are then used by app_rules.mk.
system.mk
This file is included into the top level makefile for system library projects, and is supplied
in the build directory of the altera_hal component. It is responsible for defining the rules
used to build the system library project.
In practice this file defers the rule definitions to the included file, system_rules.mk;
system.mk restricts itself to simply configuring variables required by system_rules.mk.
The key feature of this file is that it includes the auto-generated file, generated_all.mk,
to obtain a list of the components to build into the library. generated_all.mk defines four
lists of components being used, which are combined here to form the COMPONENTS
variable.
COMPONENTS is then used to construct the source search path, the include search path, and
a list of the makefile fragments supplied by the various components. These are then used
by system_rules.mk.
generated_all.mk
The file generated_all.mk is generated from the contents of the SOPC Builder system
and .stf files, and is stored within the system library project. The rule used to generate
generated_all.mk is defined in gtf_rules.mk.
This file defines a list of make variables which are used by both application and system
projects. In particular this file defines the following variables:
COMPONENTS_PROCESSOR
COMPONENTS_OS
COMPONENTS_SOFTWARE
COMPONENTS_DEVICE_DRIVERS
These four variables provide a white space separated list of all of the components which
are to be used to build this system.
These lists are used by both app.mk and system.mk to construct search paths for
include and source files, and also to locate all of the component.mk files that are to be
included into the makefile. See below for a description of the component.mk files.
app_rules.mk
This file provides the common rules which are shared between HAL application projects
and HAL-based operating system (e.g. MicroC/OS-II) application projects. It defines the
all and clean rules, and then includes the files gnu_rules.mk and gtf_rules.mk.
app_rules.mk includes the auto-generated file generated_app.mk which defines all of
the "post .elf" build rules, such as the rules used to build flash programming files. The
content of generated_app.mk is dependent upon the system configuration and is
generated based on the settings in the SOPC Builder system and .stf files.
app_rules.mk is also responsible for ensuring that the build for the associated system
library project is up to date before proceeding with the build for the application project.
This file is located in the build directory of the altera_hal component.
system_rules.mk
This file provides the common rules which are shared between HAL application projects
and HAL-based operating system (e.g. MicroC/OS-II) system projects. It defines the all
and clean rules, and includes the files gnu_rules.mk and gtf_rules.mk.
35