User guide

Nios II IDE Help System
.stf file—The .stf file describes a project's software configuration, and is
generated by the Nios II IDE. For application projects, application.stf identifies
the project's associated system library. For system libraries, system.stf contains
the information captured through the System Library properties page in the IDE.
.cdtbuild file—The .cdtbuild file describes a project’s tool chain options, and is
generated by the Nios II IDE. The .cdtbuild file contains the information captured
through the C/C++ Build properties page in the IDE.
The .ptf, .stf, and .cdtbuild files are machine-generated files. You should not edit them
by hand.
HAL Source Code:
HAL source code is provided in a distributed form, meaning that the source is distributed
through a number of components. There is no single directory that contains all of the
source used to build the HAL system library. Which components are used to build the
system library is dependent on the system configuration (i.e. the SOPC Builder system and
.stf files).
Software components
provided with the Nios II Embedded Design Suite (EDS) are located
in the <Nios II EDS install path>/components directories. Peripheral components are
located in the <Altera complete design suite install path>/ip/sopc_builder_ip
directories.
All system libraries are built using the altera_hal component, which provides the core
HAL functionality, and the processor component, altera_nios2, which contains processor-
specific definitions for accessing the hardware. Additional components might also be
included which provide device drivers, operating system extension, and/or additional
system software (e.g. file systems).
Each component provides a makefile fragment, component.mk, which described the
source files it provides, and how they should be built into the system. This is described in
more detail below.
Makefile Overview:
The HAL build system locates the source code supplied by the components using the SOPC
Builder system, and information supplied by the user through the Nios II IDE. This is
achieved using a number of individual makefiles. At the top level of the build process are
the makefiles generated by the Nios II IDE. These include makefile fragments supplied
with the altera_hal component. These fragments define the source code to build, and the
rules which are to be applied. Figure 1 and Figure 2 below illustrate which files are
included into the top level makefile for application projects and system library projects.
Figure 1. The structure of a makefile for application projects
32