Specifications

The Nios II SBT creates two kinds of makefiles:
Application or user library makefile—A simple makefile that builds the application or user library with
user-provided source files
BSP makefile—A more complex makefile, generated to conform to user-specified settings and the
requirements of the target hardware system
It is not necessary to use to the generated application and user library makefiles if you prefer to write your
own. However, Altera recommends that you use the SBT to manage and modify BSP makefiles.
Generated makefiles are platform-independent, calling only utilities provided with the Nios II EDS (such
as nios2-elf-gcc).
The generated makefiles have a straightforward structure, and each makefile has in-depth comments
explaining how it works. Altera recommends that you study these makefiles for further information about
how they work. Generated BSP makefiles consist of a single main file and a small number of makefile
fragments, all of which reside in the BSP directory. Each application and user library has one makefile,
located in the application or user library directory.
Modifying Makefiles
It is not necessary to edit makefiles by hand. The Nios II SBT for Eclipse offers GUI tools for makefile
management.
For more information, refer to the Getting Started with the Graphical User Interface chapter of the Nios II
Software Developer’s Handbook.
Table 4-2: Command-Line Utilities for Updating Makefiles
Project Type Utilities
Application nios2-app-update-makefile
Library nios2-lib-update-makefile
BSP
(3)
nios2-bsp-update-settings
nios2-bsp-generate-files
Note: After making changes to a makefile, run make clean before rebuilding your project. If you are
using the Nios II SBT for Eclipse, this happens automatically.
Related Information
Getting Started with the Graphical User Interface on page 2-1
Updating Your BSP on page 4-32
Makefile Targets
Altera recommends that you study the generated makefiles for further details about the application
makefile targets.
(3)
For more information about updating BSP makefiles, refer to Updating Your BSP .
NII5V2
2015.05.14
Modifying Makefiles
4-3
Nios II Software Build Tools
Altera Corporation
Send Feedback