Specifications

Details of how each makefile is created and maintained vary depending on the project type, and on project
options that you control. The authoritative specification of project contents is always the makefile,
regardless how it is created or updated.
By default, the Nios II SBT manages the list of source files in your makefile, based on actions you take in
Eclipse. However, in the case of applications and libraries, you have the option to manage sources
manually. Both styles of source management are discussed in the following sections.
Eclipse Source Management
Nios II application and user library makefiles are based on source files and properties that you specify
directly. Eclipse source management allows you to add and remove source files with standard Eclipse
actions, such as dragging a source file into and out of the Project Explorer view and adding a new source
file through the File menu.
You can examine and modify many makefile properties in the Nios II Application Properties or Nios II
Library Properties dialog box. To open the dialog box, right-click the project, click Properties > Nios II
Application Properties or Properties > Nios II Library Properties.
Modifying a Makefile with Eclipse Source Management
Table 2-1: GUI Actions that Modify an Application or Makefile with Eclipse Source Management
Modification Where Modified
Specifying the application or user library
name
Nios II Application Properties or Nios II Library
Properties dialog box.
Adding or removing source files For more information, refer to the Eclipse help
system.
Specifying a path to an associated BSP Project References dialog box.
Specifying a path to an associated user
library
Project References dialog box.
Enabling, disabling or modifying compiler
options
Nios II Application Properties or Nios II Library
Properties dialog box.
After the SBT has created a makefile, you can modify the makefile in the following ways:
With the Nios II SBT for Eclipse.
With Nios II SBT commands from the Nios II Command Shell.
When modifying a makefile, the SBT preserves any previous nonconflicting modifications, regardless how
those modifications were made.
After you modify a makefile with the Nios II Command Shell, in Eclipse you must right-click the project
and click Update linked resource to keep the Eclipse project view in step with the makefile.
When the Nios II SBT for Eclipse modifies a makefile, it locks the makefile to prevent corruption by other
processes. You cannot edit the makefile from the command line until the SBT has removed the lock.
If you want to exclude a resource (a file or a folder) from the Nios II makefile temporarily, without
deleting it from the project, you can use the Remove from Nios II Build command. Right-click the
resource and click Remove from Nios II Build. When a resource is excluded from the build, it does not
appear in the makefile, and Eclipse ignores it. However, it is still visible in the Project Explorer, with a
2-12
Eclipse Source Management
NII5V2
2015.05.14
Altera Corporation
Getting Started with the Graphical User Interface
Send Feedback